-
Notifications
You must be signed in to change notification settings - Fork 1
feat(curations): Start split of classes in proper locations #10
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(curations): Start split of classes in proper locations #10
Conversation
Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
Initial repository configuration implementation allocated all enum and model classes in a single file location. Even being functional, it was diverging from Ort main Kotlin representation, so a proper split was necessary. Started with the curations model objects, and is the template for the next iterations. Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
1454e5d to
9b98b9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the project to version 0.3.0 and introduces significant refactoring of the curation models and VCS type handling. The key changes include:
- Removed the PyYAML dependency
- Upgraded Ruff from 0.14.3 to 0.14.4
- Created new, properly structured model classes for VCS information, hash algorithms, and package curations
- Refactored repository configuration to use the new Curations model
- Deleted the separate curations-schema.json file (consolidated into repository-configuration-schema.json)
- Added Python 3.14 classifier
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Version bump to 0.3.0, removed PyYAML dependency, updated Ruff version, added Python 3.14 classifier |
| uv.lock | Updated lock file reflecting dependency and version changes |
| .pre-commit-config.yaml | Updated Ruff pre-commit hook to v0.14.4 |
| src/ort/models/vcstype.py | New VcsType model with alias support for version control systems |
| src/ort/models/vcsinfo.py | New VcsInfo model for VCS repository information |
| src/ort/models/hash_algorithm.py | New HashAlgorithm enum with support for various hash algorithms |
| src/ort/models/hash.py | New Hash model bundling algorithm and value |
| src/ort/models/package_curation_data.py | New PackageCurationData model with strict validation |
| src/ort/models/package_curation.py | New PackageCuration model wrapping curation data |
| src/ort/models/config/license_finding_curation_reason.py | New enum for license finding curation reasons |
| src/ort/models/config/license_finding_curation.py | New LicenseFindingCuration model with validation |
| src/ort/models/config/curations.py | New unified Curations model combining packages and license findings |
| src/ort/models/repository_configuration.py | Refactored to use new Curations model, removed duplicate VcsMatcher classes |
| schemas/repository-configuration-schema.json | Consolidated schema including all curation definitions |
| schemas/curations-schema.json | File deleted (consolidated into main schema) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SHA1GIT = ( | ||
| ["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"], | ||
| "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", | ||
| ) |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SHA1GIT enum member is incorrectly defined as a tuple instead of a string value. Python Enum members should have simple values. This will cause the enum serialization to fail and the JSON schema to contain invalid nested arrays (lines 76-84 in the schema). The value should be a single string like the other enum members, for example: SHA1GIT = \"SHA1GIT\".
| SHA1GIT = ( | |
| ["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"], | |
| "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", | |
| ) | |
| SHA1GIT = "SHA1GIT" |
| path: str = Field( | ||
| default="", | ||
| description="The path inside the VCS to take into account." | ||
| "If the VCS supports checking out only a subdirectory, only this path is checked out.", |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between concatenated string literals in the description. Add a space before 'If' on line 32: description=\"The path inside the VCS to take into account. If the VCS supports checking out only a subdirectory, only this path is checked out.\",
| "If the VCS supports checking out only a subdirectory, only this path is checked out.", | |
| " If the VCS supports checking out only a subdirectory, only this path is checked out.", |
| ) | ||
| start_lines: list[int] | None = Field( | ||
| default=None, | ||
| description="A matcher for the start line of a license finding, matches if the start line matches any of" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between concatenated string literals in the description. Add a space before '[startLines]' on line 38: description=\"A matcher for the start line of a license finding, matches if the start line matches any of [startLines] or if [startLines] is empty.\",
| description="A matcher for the start line of a license finding, matches if the start line matches any of" | |
| description="A matcher for the start line of a license finding, matches if the start line matches any of " |
| line_count: int | None = Field( | ||
| default=None, | ||
| description="A matcher for the line count of a license finding" | ||
| "matches if the line count equals [lineCount] or if [lineCount] is None", |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between concatenated string literals in the description. Add a space before 'matches' on line 43: description=\"A matcher for the line count of a license finding matches if the line count equals [lineCount] or if [lineCount] is None\",
| "matches if the line count equals [lineCount] or if [lineCount] is None", | |
| " matches if the line count equals [lineCount] or if [lineCount] is None", |
|
|
||
| detected_license: str | None = Field( | ||
| default=None, | ||
| description="The concluded license as SPDX expression or None" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between concatenated string literals in the description. Add a space before 'for' on line 49: description=\"The concluded license as SPDX expression or None for no license, see https://spdx.dev/spdx-specification-21-web-version#h.jxpfx0ykyb60.\",
| description="The concluded license as SPDX expression or None" | |
| description="The concluded license as SPDX expression or None " |
Initial repository configuration implementation allocated all enum and
model classes in a single file location.
Even being functional, it was diverging from Ort main Kotlin
representation, so a proper split was necessary.
Started with the curations model objects, and is the template for the subsequent iterations.