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

Add support for conan lock v2 #2461

Conversation

houdini91
Copy link
Contributor

@houdini91 houdini91 commented Jan 1, 2024

In conan 2.x i see there is a requries field listing the packages instead of the graph_lock.

For spec change details see https://github.com/conan-io/tribe/blob/main/design/034-new_lockfiles.md. and https://docs.conan.io/2/tutorial/versioning/lockfiles.html#tutorial-versioning-lockfiles.

Closes #2050
Closes #2462

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@houdini91
Copy link
Contributor Author

The change suggested addes the ConanReference object as the metadata instead of ConanLockEntry, this requires a json schema update.

Do we want to reuse the same metadata structure or define another?

@wagoodman
Copy link
Contributor

Do we want to reuse the same metadata structure or define another?

We should add another similar to what you have done. However, I think we should still make a breaking change:

  1. rename the existing pkg.ConanLockEntry to pkg.ConanV1LockEntry
  2. rename pkg.ConanReference to pkg.ConanV2LockEntry

this implies a breaking update to the JSON schema.

syft/pkg/conan.go Outdated Show resolved Hide resolved
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@houdini91
Copy link
Contributor Author

houdini91 commented Jan 16, 2024

@wagoodman @tgerla i think i have addressed your comments.
Can you help me understand how can i regenerate the json schema with updates (probably some script?)

@wagoodman
Copy link
Contributor

@houdini91 to regenerate the JSON schema:

make generate-json-schema

the docs about this is here

I can get this across the finish line today 👍

@wagoodman wagoodman changed the base branch from main to conan-ref-support February 2, 2024 21:50
@wagoodman wagoodman added the enhancement New feature or request label Feb 2, 2024
@wagoodman wagoodman changed the base branch from conan-ref-support to main February 2, 2024 21:52
@wagoodman wagoodman changed the base branch from main to conan-ref-support February 2, 2024 21:56
@wagoodman wagoodman changed the title conan lock 2.x requires field support Add support for conan lock v2 Feb 2, 2024
@wagoodman
Copy link
Contributor

I rebased and made some alterations to help get tests passing, however, I don't have write access. I'll merge this as-is into a feature branch in the repo and get it reviewed in a separate PR (you'll still have attribution in the changelog and this PR 👍 ).

@wagoodman wagoodman merged commit 4d82f19 into anchore:conan-ref-support Feb 2, 2024
8 of 10 checks passed
wagoodman pushed a commit that referenced this pull request Feb 2, 2024
* conan lock 2.x requires field support

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

* PR review, struct renaming

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

---------

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
wagoodman added a commit that referenced this pull request Feb 7, 2024
* Add support for conan lock v2 (#2461)

* conan lock 2.x requires field support

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

* PR review, struct renaming

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

---------

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

* decompose conanlock parser + add tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: mikey strauss <mdstrauss91@gmail.com>
@wagoodman wagoodman removed the enhancement New feature or request label Feb 7, 2024
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
* Add support for conan lock v2 (anchore#2461)

* conan lock 2.x requires field support

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

* PR review, struct renaming

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

---------

Signed-off-by: houdini91 <mdstrauss91@gmail.com>

* decompose conanlock parser + add tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: mikey strauss <mdstrauss91@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants