-
Notifications
You must be signed in to change notification settings - Fork 3
fix: remove bom-refs only for deleted components in build public #196
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
360b308
fix: build public now considers different aggregates in compositions …
CBeck-96 0efd12b
chore: black
CBeck-96 7a5f9f2
chore: isort
CBeck-96 fa205f1
docs: updates function description
CBeck-96 62762f8
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi 3009877
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi b36dba5
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi c0e1af3
tests: fixed inconsistencies caused´by subcomponents introduced in th…
CBeck-96 9ee0ea5
chore: black
CBeck-96 d6c5a00
refactor: removes debug print
CBeck-96 81035da
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi 4606219
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi 32d17e9
Merge branch 'main' into 154-build-public-messes-up-compositions
CBeck-96 92a047f
Merge branch 'main' into 154-build-public-messes-up-compositions
italvi f4d2daf
fix: only bom-refs from removed components are delted from compositions
CBeck-96 70224b6
chore: isort
CBeck-96 a5f0d10
refacture: removes uneeded imports
CBeck-96 5b1aea3
refacture: removes only_top_level flag
CBeck-96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import unittest | ||
| from typing import Sequence | ||
|
|
||
| from cdxev.auxiliary import sbomFunctions as sbF | ||
|
|
||
|
|
||
| class TestComponentFunctions(unittest.TestCase): | ||
| def test_extract_components(self) -> None: | ||
| example_list: Sequence[dict] = [ | ||
| { | ||
| "bom-ref": "first_level_1", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "second_level_1", | ||
| }, | ||
| { | ||
| "bom-ref": "second_level_2", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "third_level_1", | ||
| }, | ||
| { | ||
| "bom-ref": "third_level_2", | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| "bom-ref": "first_level_2", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "second_level_3", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "third_level_3", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "fourth_level_1", | ||
| } | ||
| ], | ||
| } | ||
| ], | ||
| }, | ||
| { | ||
| "bom-ref": "second_level_4", | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| "bom-ref": "first_level_3", | ||
| "components": [ | ||
| { | ||
| "bom-ref": "second_level_5", | ||
| } | ||
| ], | ||
| }, | ||
| ] | ||
| components = sbF.extract_components(example_list) | ||
| self.assertEqual( | ||
| set(sbF.get_ref_from_components(components)), | ||
| set( | ||
| [ | ||
| "first_level_1", | ||
| "first_level_2", | ||
| "first_level_3", | ||
| "second_level_1", | ||
| "second_level_2", | ||
| "second_level_3", | ||
| "second_level_4", | ||
| "second_level_5", | ||
| "third_level_1", | ||
| "third_level_2", | ||
| "third_level_3", | ||
| "fourth_level_1", | ||
| ] | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.