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

Rename top-level JSON fields #1842

Open
wagoodman opened this issue May 23, 2023 · 4 comments
Open

Rename top-level JSON fields #1842

wagoodman opened this issue May 23, 2023 · 4 comments
Assignees
Labels
breaking-change Change is not backwards compatible json Regarding JSON output
Milestone

Comments

@wagoodman
Copy link
Contributor

There are a couple of fields that feel like they should be renamed to better represent what they contain:

  • artifacts -> packages: the original idea is that this field would be a mix of all nodes in the SBOM graph, however, it's been way more practical to break out files into its own section, and there are no other types.
  • artifactRelationships -> relationships: given the last point, this just represents relationships between any two nodes, so we don't need artifacts in the name
@wagoodman wagoodman added the breaking-change Change is not backwards compatible label May 23, 2023
@wagoodman wagoodman added this to the Stabilize user surfaces milestone May 23, 2023
@wagoodman wagoodman added the json Regarding JSON output label May 25, 2023
@wagoodman
Copy link
Contributor Author

If we have a config switch that allows to legacy behavior we can leverage https://github.com/anchore/go-struct-converter in the same way as done in spdx/tools-golang to support x many versions in the future (where the first would be "legacy" and "current").

@wagoodman wagoodman self-assigned this Nov 3, 2023
@wagoodman
Copy link
Contributor Author

wagoodman commented Nov 3, 2023

dev note: draft branch started at https://github.com/anchore/syft/compare/rename-top-level-json-fields

This should be coordinated with #1419 so we can get the last remaining breaking changes before syft 1.0 in.

@wagoodman
Copy link
Contributor Author

I think there is good reason to wait until syft 2.0 to make this change:

  1. this change will break 99% of consumers (ok, not 99% exactly, but a lot of folks for common use cases)

  2. currently we do not bump syft versions with schema versions (where a breaking change in one is a breaking change in another), so folks would not have much warning that this could happen

  3. we are planning to allow for multiple supported encoding versions for the syft-json format in the future, which would be a very nice way to facilitate a controlled fallback for users that want the latest syft capabilities but not the latest schema versions

  4. given the previous point, we could develop breaking changes in a version called dev and incorporate such breaking schema changes into multiple releases ahead of switching the default schema version that syft outputs

So though we could make this change for syft 1.0, we ought to wait until we implement #846 to make this transition smoother.

@wagoodman wagoodman removed this from the Syft 1.0 milestone Jan 24, 2024
@wagoodman wagoodman added this to OSS Feb 7, 2024
@wagoodman wagoodman moved this to Ready in OSS Feb 7, 2024
@wagoodman wagoodman moved this from Ready to Backlog in OSS Feb 14, 2024
@wagoodman
Copy link
Contributor Author

Moving back to the backlog since this will land after #846 , which isn't ready yet.

@kzantow kzantow added this to the Syft 2.0 milestone Oct 30, 2024
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 json Regarding JSON output
Projects
Status: Backlog
Development

No branches or pull requests

2 participants