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

Update opossum schema for classification and config #244

Merged
merged 5 commits into from
Feb 24, 2025

Conversation

abraemer
Copy link
Contributor

Summary of changes

  • slightly refactor tests to make _assert_expected_file_equals_generated_file a bit more lenient by treating None and empty containers as equivalent
  • Update OpossumFileModels to reflect schema: include config toplevel key and classification key for OpossumPackage
  • The change of the OpossumFileModel classes triggers a few changes throughout the code base to preserve them in back-and-forth conversions and merges
  • There are new tests for merge_opossum and generate for a new input file with config+classification

Context and reason for change

See opossum-tool/OpossumUI#2800

Compatibility

This change is backwards compatible. Everything that worked before still works. However old version of opossum-file do not work on new opossum files that include classification or config.

How can the changes be tested

Tests are included. If you want to see it for yourself, you can run:

uv run opossum-file generate --opossum tests/data/opossum_input_with_classification.opossum

@abraemer abraemer force-pushed the update-opossum-schema-for-classification branch from 5dac3ce to 5e88468 Compare February 19, 2025 07:45
* includes config toplevel key and classification key for externalAttribution
* The change of the OpossumFileModel classes triggers a few changes throughout the code base
* There are new tests for merge_opossum and generate for a new input file with config+classification
@abraemer abraemer force-pushed the update-opossum-schema-for-classification branch from 5e88468 to ff176b3 Compare February 19, 2025 07:47
@Hellgartner Hellgartner self-assigned this Feb 19, 2025
* this makes a few places a bit more ergonomic (test, merge_opossums)
* when converting back, we translate an empty classifications to None to not to be backwards compatible
* This means this PR is now fully backwards compatible in the sense that we never generate
 something different from the old schema if we don't have to
@abraemer abraemer requested a review from Hellgartner February 20, 2025 15:37
@abraemer abraemer merged commit 21b9093 into main Feb 24, 2025
6 checks passed
@abraemer abraemer deleted the update-opossum-schema-for-classification branch February 24, 2025 15:26
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.

2 participants