Skip to content

feat(license_classification): Add LicenseClassification class#48

Merged
heliocastro merged 6 commits into
mainfrom
feat/license_class
Jun 18, 2026
Merged

feat(license_classification): Add LicenseClassification class#48
heliocastro merged 6 commits into
mainfrom
feat/license_class

Conversation

@heliocastro

Copy link
Copy Markdown
Owner

No description provided.

Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
@heliocastro heliocastro self-assigned this Jun 18, 2026
Copilot AI review requested due to automatic review settings June 18, 2026 10:04
@heliocastro heliocastro force-pushed the feat/license_class branch 2 times, most recently from 05ff0ca to 6bf1780 Compare June 18, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a new license-classification model layer (Pydantic) plus accompanying schemas, fixtures, and examples, aligning the Python port with ORT’s license categorization concepts.

Changes:

  • Add LicenseClassifications, LicenseCategory, and LicenseCategorization models with validation helpers and merge behavior.
  • Add new JSON schemas (and heavily refactor the repository configuration schema) plus new YAML fixtures for tests.
  • Add tests and examples demonstrating parsing and behavior.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/test_repo_config_curations.py Updates expected curation package count to match new fixture entry.
tests/test_license_classifications.py Adds behavioral tests for the new LicenseClassifications model.
tests/data/repo_config/curations.yml Adds a new PyPI package curation entry.
tests/data/license-classifications.yml Adds an example license-classifications YAML fixture.
src/ort/models/licenses/license_classifications.py Implements LicenseClassifications validation, lookups, and merge logic.
src/ort/models/licenses/license_category.py Adds the LicenseCategory model.
src/ort/models/licenses/license_categorization.py Adds the LicenseCategorization model.
src/ort/models/init.py Re-exports LicenseClassifications.
schemas/resolutions-schema.json Adds a standalone resolutions schema.
schemas/repository-configurations/package-manager-configuration-schema.json Adds a package-manager configuration schema used by repository config schemas.
schemas/repository-configurations/analyzer-configuration-schema.json Adds analyzer configuration schema (repository-configurations namespace).
schemas/repository-configuration-schema.json Replaces the large generated schema with a smaller schema referencing ORT upstream schemas.
schemas/package-managers-schema.json Extends supported package manager enum values.
schemas/package-configuration-schema.json Adds a package-configuration schema.
schemas/ort-project-schema.json Adds a schema for ORT project definition files.
schemas/ort-configuration-schema.json Adds a schema for ORT main configuration.
schemas/license-classifications-schema.json Adds a schema for license classifications files.
schemas/curations-schema.json Adds a schema for package curations files.
schemas/analyzer-configuration-schema.json Updates analyzer schema to remove SW360 configuration from this schema.
pyproject.toml Bumps version and updates dependency groups / tool configuration layout.
examples/repo_config.py Improves error logging on validation failure.
examples/ort_result.py Improves error logging on validation failure.
examples/licenses_classification.py Adds an example CLI to parse license classifications.
.agents/skills/python-ort-tests/SKILL.md Adds repository-local guidance for writing tests in this project.

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

Comment thread src/ort/models/licenses/license_classifications.py
Comment thread examples/repo_config.py
Comment thread examples/licenses_classification.py
Comment thread schemas/curations-schema.json
Comment thread src/ort/models/licenses/license_classifications.py
Comment thread src/ort/models/licenses/license_classifications.py
Comment thread schemas/curations-schema.json
Comment thread schemas/repository-configuration-schema.json
Copilot AI review requested due to automatic review settings June 18, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 8 comments.

Comment thread src/ort/models/licenses/license_classifications.py
Comment thread src/ort/models/licenses/license_classifications.py
Comment thread src/ort/models/licenses/license_classifications.py
Comment thread schemas/repository-configuration-schema.json
Comment thread schemas/curations-schema.json
Comment thread tests/data/repo_config/curations.yml
Comment thread examples/repo_config.py
Comment thread examples/licenses_classification.py
Copilot AI review requested due to automatic review settings June 18, 2026 10:27
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>
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>
Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 30 changed files in this pull request and generated 11 comments.

Comment on lines +113 to +116
merged_categories: list[LicenseCategory] = []
for category in [*self.categories, *other.categories]:
if category.name in used_categories and category not in merged_categories:
merged_categories.append(category)
Comment on lines +27 to +33
- name: Sync dependencies
run: |
uv lock
uv sync \
--locked \
--all-extras \
--dev
Comment on lines +182 to 192
"repository_license_choices": {
"type": "array",
"items": {
"given": {
"type": "string"
},
{
"type": "null"
"choice": {
"type": "string"
}
],
"default": null,
"title": "Comment"
}
}
Comment on lines +21 to +25
"items": [
{
"type": "string"
}
]
Comment on lines +10 to +13
"additionalProperties": {
"type": "object",
"$ref": "#/definitions/PackageManagerConfigs"
},
}
},
"linkage": {
"description": "The linkage type used be the dependent to link this package.",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://oss-review-toolkit.org/repository-configurations/analyzer-configuration.yml",
"title": "ORT repository analyzer configurations",
"description": "Configurations for the analyzer of the The OSS-Review-Toolkit (ORT). A full list of all available options can be found at https://github.com/oss-review-toolkit/ort/blob/main/model/src/main/kotlin/config/AnalyzerConfiguration.kt.",
Comment thread examples/repo_config.py
parsed = RepositoryConfiguration(**data)
pprint(parsed)
except ValidationError as e:
logger.error("Validation error while parsing the ORT result:")
parsed = LicenseClassifications(**data)
pprint(parsed)
except ValidationError as e:
logger.error("Validation error while parsing the ORT result:")
from .hash import Hash
from .identifier import Identifier
from .issue import Issue
from .licenses.license_classifications import LicenseClassifications
@heliocastro heliocastro merged commit 64d4d61 into main Jun 18, 2026
16 checks passed
@heliocastro heliocastro deleted the feat/license_class branch June 18, 2026 10:43
heliocastro added a commit that referenced this pull request Jun 18, 2026
* chore(deps): Update project base dependencies
* chore(schemas): Update Ort upstream schemas
* chore(examples): Add better examples error output
* feat(ai): Add skill for replictae Ort upstream tests
* feat(license_classifications): Add LicenseClassifiction model
* chore(ci): Update actions

Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
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