Skip to content

Conversation

@heliocastro
Copy link
Owner

  • Removed old tests pointing to old models
  • Added validators to proper parse Identifier

- Removed old tests pointing to old models
- Added validators to proper parse Identifier

Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
@heliocastro heliocastro self-assigned this Nov 10, 2025
Copilot AI review requested due to automatic review settings November 10, 2025 13:24
@heliocastro heliocastro merged commit b6fef39 into heliocastro:main Nov 10, 2025
17 checks passed
@heliocastro heliocastro deleted the feat/split_package_manager branch November 10, 2025 13:27
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 bumps the version from 0.3.1 to 0.4.0 and performs a significant refactoring of the ORT configuration model architecture. The changes reorganize package manager and analyzer configuration code into a more modular structure under the config module.

Key Changes:

  • Refactored configuration models into dedicated config module with new classes for PackageConfiguration, RepositoryAnalyzerConfiguration, PackageManagerConfiguration, and related types
  • Removed deprecated OrtPackageManagerConfigurations and OrtAnalyzerConfigurations classes
  • Added support for flexible start_lines parsing in LicenseFindingCuration (string, list, or int)
  • Updated test error messages to correctly reference Curations instead of OrtRepositoryConfiguration

Reviewed Changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
uv.lock Version bump from 0.3.1 to 0.4.0
pyproject.toml Version bump from 0.3.1 to 0.4.0
tests/test_package_curation.py Fixed error messages to correctly reference Curations class
tests/test_package_configuration.py New test file for validating package configuration loading
tests/data/example_simple_package_config.yml New test data file with example package configuration
tests/test_ort_configuration.py Removed deprecated test file
src/ort/init.py Removed exports of deprecated configuration classes
src/ort/models/repository_configuration.py Updated imports to use new config module classes
src/ort/models/ort_configuration.py Commented out deprecated package manager fields
src/ort/models/package_managers.py Removed deprecated file
src/ort/models/analyzer_configurations.py Removed deprecated file
src/ort/models/identifier.py New model for package identifiers with string parsing support
src/ort/models/config/vcsmatcher.py New VCS matcher model for repository provenance matching
src/ort/models/config/repository_analyzer_configuration.py New repository-level analyzer configuration model
src/ort/models/config/path_exclude_reason.py Placeholder file with only license headers
src/ort/models/config/path_exclude.py New model for path exclusion patterns
src/ort/models/config/package_manager_configuration.py New package manager configuration model
src/ort/models/config/package_configuration.py New package configuration model
src/ort/models/config/license_finding_curation.py Added flexible start_lines field validator
src/ort/models/config/analyzer_configuration.py New global analyzer configuration model
src/ort/models/package_curation_data.py Added comprehensive docstring
schemas/repository-configuration-schema.json Updated JSON schema to reflect VcsInfoCurationData changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

)
package_managers: dict[str, PackageManagerConfiguration] | None = Field(
default=None,
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map"
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after period in description text. Should be "The difference to accessing the map directly" instead of "The difference to accessing the mapdirectly".

Suggested change
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map"
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map "

Copilot uses AI. Check for mistakes.
)

id: Identifier = Field(
description="The [Identifier] which must match with the identifier of the package in order for this package"
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after period in description text. Should be "The [Identifier] which must match with the identifier of the package in order" instead of "The [Identifier] which must match with the identifier of the package inorder".

Suggested change
description="The [Identifier] which must match with the identifier of the package in order for this package"
description="The [Identifier] which must match with the identifier of the package in order for this package "

Copilot uses AI. Check for mistakes.
Comment on lines +201 to +204
# enabled_package_managers: Annotated[list[PackageManager] | None, Field(alias="enabledPackageManagers")] = None
# # disabled_package_managers: Annotated[list[OrtPackageManagers] | None,
# Field(alias="disabledPackageManagers")] = None
# package_managers: Annotated[OrtPackageManagerConfigurations | None, Field(alias="packageManagers")] = None
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed rather than left in the codebase. If this functionality is no longer needed, delete these lines. If it will be needed in the future, rely on version control history to retrieve it.

Suggested change
# enabled_package_managers: Annotated[list[PackageManager] | None, Field(alias="enabledPackageManagers")] = None
# # disabled_package_managers: Annotated[list[OrtPackageManagers] | None,
# Field(alias="disabledPackageManagers")] = None
# package_managers: Annotated[OrtPackageManagerConfigurations | None, Field(alias="packageManagers")] = None

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +20
must_run_after: list[str] | None = Field(
default=None,
description="The configuration model for a package manager. This class is (de-)serialized in the following"
"places:"
"- Deserialized from config.yml as part of [OrtConfiguration] (via Hoplite)."
"- Deserialized from .ort.yml as part of [RepositoryAnalyzerConfiguration] (via Jackson)"
"- (De-)Serialized as part of [org.ossreviewtoolkit.model.OrtResult] (via Jackson).",
)
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

The description on the must_run_after field appears to be misplaced. This description talks about the overall configuration model for package managers, but should specifically describe what must_run_after does - i.e., that it specifies package managers that must run before this one.

Copilot uses AI. Check for mistakes.
)
package_managers: dict[str, PackageManagerConfiguration] | None = Field(
default=None,
description="Get a [PackageManagerConfiguration] from [packageManagers]. The difference to accessing the map"
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after period in description text. Should be "The difference to accessing the map directly" instead of "The difference to accessing the mapdirectly".

Copilot uses AI. Check for mistakes.
)

namespace: str = Field(
description="The namespace of the component, for examplethe group for 'Maven' or the scope for 'NPM'.",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space in description text. Should be "for example the group" instead of "for examplethe group".

Copilot uses AI. Check for mistakes.
revision: str | None = Field(
default=None,
description="The revision to match for equality against [RepositoryProvenance.resolvedRevision],"
"or null to match anyrevision.",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space in description text. Should be "any revision" instead of "anyrevision".

Copilot uses AI. Check for mistakes.
allow_dynamic_versions: bool | None = Field(
default=None,
description="Enable the analysis of projects that use version ranges to declare their dependencies."
"If set to true, dependencies of exactly the same project might change with another scan done at a later time"
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after "." in description text. Should be "If set to true, dependencies" instead of "If set to true,dependencies".

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33
description="A list of the case-insensitive names of package managers that are enabled."
"Disabling a package manager in [disabledPackageManagers] overrides enabling it here.",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after period in description text. Should be "Disabling a package manager in [disabledPackageManagers] overrides" instead of "Disabling a package manager in [disabledPackageManagers]overrides".

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +62
description="A list of the case-insensitive names of package managers that are enabled."
"Disabling a package manager in [disabledPackageManagers] overrides enabling it here.",
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after period in description text. Should be "Disabling a package manager in [disabledPackageManagers] overrides" instead of "Disabling a package manager in [disabledPackageManagers]overrides".

Copilot uses AI. Check for mistakes.
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