Skip to content

Conversation

@heliocastro
Copy link
Owner

@heliocastro heliocastro commented Nov 7, 2025

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.

Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
@heliocastro heliocastro self-assigned this Nov 7, 2025
Copilot AI review requested due to automatic review settings November 7, 2025 09:56
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>
Copy link

Copilot AI left a 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.

Comment on lines +34 to +37
SHA1GIT = (
["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"],
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
)
Copy link

Copilot AI Nov 7, 2025

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\".

Suggested change
SHA1GIT = (
["SHA-1-GIT", "SHA1-GIT", "SHA1GIT", "SWHID"],
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
)
SHA1GIT = "SHA1GIT"

Copilot uses AI. Check for mistakes.
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.",
Copy link

Copilot AI Nov 7, 2025

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.\",

Suggested change
"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.",

Copilot uses AI. Check for mistakes.
)
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"
Copy link

Copilot AI Nov 7, 2025

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.\",

Suggested change
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 "

Copilot uses AI. Check for mistakes.
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",
Copy link

Copilot AI Nov 7, 2025

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\",

Suggested change
"matches if the line count equals [lineCount] or if [lineCount] is None",
" matches if the line count equals [lineCount] or if [lineCount] is None",

Copilot uses AI. Check for mistakes.

detected_license: str | None = Field(
default=None,
description="The concluded license as SPDX expression or None"
Copy link

Copilot AI Nov 7, 2025

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.\",

Suggested change
description="The concluded license as SPDX expression or None"
description="The concluded license as SPDX expression or None "

Copilot uses AI. Check for mistakes.
@heliocastro heliocastro merged commit e139a4c into heliocastro:main Nov 7, 2025
8 checks passed
@heliocastro heliocastro deleted the feat/curations_split branch November 7, 2025 10:02
@heliocastro heliocastro restored the feat/curations_split branch November 7, 2025 10:05
@heliocastro heliocastro deleted the feat/curations_split branch November 7, 2025 10:06
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.

1 participant