Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate maps to sequences in package metadata #2553

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Jan 27, 2024

There are multiple map collections on package metadata that originate from sequential entries. This means that the original order of how the data is written and read is lost, which could lead to semantic differences. This PR updates these inconsistent fields to use a new []pkg.KeyValue to express these collections, preserving the order of the values from the source file read.

Fields updated:

  • ConanLockEntry.Options
  • GolangBinaryBuildinfoEntry.BuildSettings
  • JavaPomProperties.Extra though the syntax is parsed linearly ultimately it's represented and used as a map
  • JavaManifest (all of it)
  • LinuxKernelModule.Parameters
  • PhpComposerLockEntry, fields Require, Provide, RequireDev, Suggest Ultimately unnecessary to translate to a sequence since the source data is a JSON map

Note: since this updates the package metadata it requires a breaking JSON schema change.

Fixes #2405

@wagoodman wagoodman added this to the Syft 1.0 milestone Jan 27, 2024
@github-actions github-actions bot added json-schema Changes the json schema detected-breaking-change Change is not backwards compatible (detected by automation) labels Jan 27, 2024
@wagoodman wagoodman self-assigned this Jan 27, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman force-pushed the translate-maps-to-sequences branch from 835374f to 7c0f337 Compare January 27, 2024 02:55
@wagoodman wagoodman marked this pull request as ready for review January 30, 2024 21:53
@wagoodman wagoodman requested a review from a team January 30, 2024 21:53
@wagoodman wagoodman removed this from the Syft 1.0 milestone Jan 31, 2024
@wagoodman wagoodman merged commit 6107e5e into main Feb 1, 2024
11 checks passed
@wagoodman wagoodman deleted the translate-maps-to-sequences branch February 1, 2024 16:58
@wagoodman wagoodman added the breaking-change Change is not backwards compatible label Feb 2, 2024
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Change is not backwards compatible detected-breaking-change Change is not backwards compatible (detected by automation) json-schema Changes the json schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop iterating maps in catalogers
2 participants