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

feat: add basic support for Definitions #701

Merged
merged 2 commits into from
Oct 26, 2024

Conversation

hakandilek
Copy link
Contributor

@hakandilek hakandilek commented Oct 11, 2024

This PR is addressing #697 and adding the bom.definitions support.

I've intentionally left the bom.definitions.standards.signature out since the entire data structure elsewhere is also missing.

bom.definitions.standards.requirements and
bom.definitions.standards.levels are also left out and will be included with a latter PR #713

fixes #697
is part of #696

@hakandilek hakandilek requested a review from a team as a code owner October 11, 2024 12:34
@jkowalleck jkowalleck added the enhancement New feature or request label Oct 14, 2024
@jkowalleck jkowalleck changed the title feat: add bom.definitions feat: add models and properties for Defenitions Oct 14, 2024
@jkowalleck jkowalleck changed the title feat: add models and properties for Defenitions feat: add support for Defenitions Oct 14, 2024
@jkowalleck jkowalleck changed the title feat: add support for Defenitions feat: add basic support for Defenitions Oct 14, 2024
@hakandilek hakandilek changed the title feat: add basic support for Defenitions feat: add basic support for Definitions Oct 14, 2024
@hakandilek
Copy link
Contributor Author

@jkowalleck Thanks for having the preliminary look into it.

I've rebased the PR with the recent changes. Please let me know if anything is missing or should be changed.

@jkowalleck
Copy link
Member

jkowalleck commented Oct 15, 2024

@hakandilek ,
Could you add new or enhance existing test case to the model in https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/tests/_data/models.py?

When creating new models:

  • add a new function called get_bom_<yout-purpose-here> -- any function that starts with get_bom_ will do.
  • the function must return a Bom, use the _make_bom() wrapper at best.
  • In case your model does not have properly defined dependencies, add the function to the all_get_bom_funct_with_incomplete_deps.

Any function that starts with get_bom_ will be picked up, and results will be used as a test fixtures.

After that, please (re)generate the test snapshots as described here: https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/tests/_data/snapshots/README.md

@hakandilek
Copy link
Contributor Author

@jkowalleck Thanks for the feedback. I'll look into the extended test cases and let you know here.

cyclonedx/model/definition.py Outdated Show resolved Hide resolved
@hakandilek hakandilek marked this pull request as ready for review October 17, 2024 14:30
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/_internal/__init__.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/bom.py Outdated Show resolved Hide resolved
cyclonedx/model/bom.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
cyclonedx/model/definition.py Outdated Show resolved Hide resolved
@jkowalleck
Copy link
Member

@hakandilek ,

could you rebase onto latest main branch?
seams like there are conflicts in the tests/_data/models.py

@hakandilek
Copy link
Contributor Author

@hakandilek ,

could you rebase onto latest main branch? seams like there are conflicts in the tests/_data/models.py

done right now.

Copy link
Member

@jkowalleck jkowalleck left a comment

Choose a reason for hiding this comment

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

for CycloneDX#697

Signed-off-by: Hakan Dilek <hakandilek@gmail.com>
for CycloneDX#697

Signed-off-by: Hakan Dilek <hakandilek@gmail.com>
@hakandilek
Copy link
Contributor Author

some things should be changed: https://github.com/CycloneDX/cyclonedx-python-lib/pull/701/files#conversations-menu

Alright, updated those as well.

@jkowalleck jkowalleck self-requested a review October 22, 2024 16:30
@jkowalleck jkowalleck requested review from madpah and a team October 22, 2024 16:31
@jkowalleck
Copy link
Member

@madpah , could you review these changes?

@jkowalleck jkowalleck merged commit a1573e5 into CycloneDX:main Oct 26, 2024
41 checks passed
@jkowalleck
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request schema 1.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add bom.definitions
2 participants