Skip to content

feat: add cyclonedx.model.dependency.Dependency.provides #735

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

uzairchhapra
Copy link

Fixes #691

Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
@uzairchhapra uzairchhapra force-pushed the feat/691-uzair-provides branch from f2ad0ed to fb4598d Compare November 5, 2024 19:11
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
@uzairchhapra uzairchhapra marked this pull request as ready for review November 5, 2024 21:47
@uzairchhapra uzairchhapra requested a review from a team as a code owner November 5, 2024 21:47
@uzairchhapra
Copy link
Author

@jkowalleck PR is ready for review.
I am not too sure about the test cases so any guidance here would help. Thanks!

@jkowalleck jkowalleck changed the title [WIP] feat: add cyclonedx.model.dependency.Dependency.provides feat: add cyclonedx.model.dependency.Dependency.provides Nov 5, 2024
@jkowalleck
Copy link
Member

thank you for your contribution, @uzairchhapra .

the implementation looks promising.

Regarding tests, we tend to go with an integration-test snapshot-solution, over detailed unit tests.
Please add new fixtures to https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/tests/_data/models.py. your new function must start with get_bom_.
After adding new test data, please recreate the snapshots as described here: https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/tests/_data/snapshots/README.md

Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
@jkowalleck

This comment was marked as outdated.

self,
target: Dependable,
depends_on: Optional[Iterable[Dependable]] = None,
provides: Optional[Iterable[Dependable]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of adding a new parameter here, how about adding a new method instead: register_provision(self, target: Dependable, provides: Optional[Iterable[Dependable]] = None).

what do you think about this?
this would fit the original architectural plans better.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this a try

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkowalleck
How should this function work register_provision for the example mentioned pin models.py?

A -- requires -> C
B -- provides -> C

Considering register_dependency and register_provision will be called for all A, B and C, should I look for existing dependencies added in register_provision to avoid creating a new Dependency?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still open.
could you consider adding a new method?

@jkowalleck jkowalleck self-requested a review November 12, 2024 12:54
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
@jkowalleck
Copy link
Member

@uzairchhapra, I just wanted to ask how things are going.
Do you need any help with one of the open discussions/points?

@uzairchhapra
Copy link
Author

@uzairchhapra, I just wanted to ask how things are going. Do you need any help with one of the open discussions/points?

Apologies for the delayed response. I will get to this this weekend. If I remember correctly, I was stuck in making the test function work get_bom_v1_6_with_provides. I see my PR has some conflicts now, so will try to address that too.

@aespogom
Copy link

Hi everyone,
Thanks a lot for your amazing work!!
Just wanted to check in—I'm currently waiting on this fix to be released, as it's blocking some of our work. Really appreciate all the efforts from the maintainers and contributors here. Is there any estimated timeline for when this might be included in a release? Thanks in advance!

@robertlagrant
Copy link

@aespogom I'm not affiliated, but it looks as though the author has abandoned this PR. If it's blocking you, would you consider picking it up?

…ides

Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
Signed-off-by: Uzair Chhapra <uzairchhapra@gmail.com>
self,
target: Dependable,
depends_on: Optional[Iterable[Dependable]] = None,
provides: Optional[Iterable[Dependable]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still open.
could you consider adding a new method?

@jkowalleck jkowalleck marked this pull request as draft April 23, 2025 09:52
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.

feat: add cyclonedx.model.dependency.Dependency.provides
4 participants