Skip to content

feat: Add license and SPDX identifier#446

Merged
nodeg merged 2 commits into
uyuni-project:masterfrom
nodeg:license_spdx
Jan 18, 2026
Merged

feat: Add license and SPDX identifier#446
nodeg merged 2 commits into
uyuni-project:masterfrom
nodeg:license_spdx

Conversation

@nodeg

@nodeg nodeg commented Jan 17, 2026

Copy link
Copy Markdown
Member

@nodeg nodeg self-assigned this Jan 17, 2026
@nodeg nodeg added tests feature New feature request labels Jan 17, 2026
@nodeg
nodeg force-pushed the license_spdx branch 4 times, most recently from cd85c8b to d22bcd6 Compare January 17, 2026 21:14
@nodeg
nodeg requested a review from Copilot January 17, 2026 21:15

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 adds functionality to map Maven license names to SPDX identifiers and automatically detect license files in source packages, addressing issues #12 and #6.

Changes:

  • Adds a new LicenseMapper class with a comprehensive YAML mapping of Maven license names to SPDX identifiers
  • Modifies the Package class to detect LICENSE, COPYING, and COPYRIGHT files and include them in generated spec files
  • Updates test infrastructure to configure git identity more reliably for unit tests
  • Adds comprehensive test coverage for the new license mapping and detection functionality

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/tetra/license_mapper.rb New mapper class to convert Maven license names to SPDX identifiers
lib/tetra/data/license_map.yml Comprehensive mapping of ~100 license name variants to SPDX identifiers
lib/tetra/constants.rb Adds constant for license map file path
lib/tetra/packages/package.rb Adds license mapping method and license file detection
lib/template/package.spec Updates spec template to include detected license files
lib/tetra.rb Adds YAML require and license_mapper require
spec/spec_helper.rb Refactors git configuration for tests to use local repo config
spec/lib/fine/package_spec.rb Adds tests for license mapping and file detection
spec/lib/fine/license_mapper_spec.rb New test file for license mapper functionality
spec/lib/coarse/license_detection_spec.rb New integration tests for end-to-end license handling

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

Comment thread spec/spec_helper.rb Outdated
Comment thread spec/spec_helper.rb Outdated
Comment thread spec/lib/coarse/license_detection_spec.rb Outdated
Comment thread lib/tetra/data/license_map.yml Outdated
Comment thread lib/tetra/data/license_map.yml Outdated
Comment thread spec/spec_helper.rb Outdated
Comment thread lib/tetra/license_mapper.rb Outdated
@codecov

codecov Bot commented Jan 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (feb4a6f) to head (4680935).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #446   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        22    +2     
  Lines          849       942   +93     
=========================================
+ Hits           849       942   +93     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodeg
nodeg requested a review from Copilot January 17, 2026 21:48
@nodeg
nodeg force-pushed the license_spdx branch 2 times, most recently from 4a89f06 to 8bfd277 Compare January 17, 2026 21:52

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 10 out of 10 changed files in this pull request and generated 4 comments.


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

Comment thread spec/lib/fine/license_mapper_spec.rb
Comment thread spec/spec_helper.rb
Comment thread lib/tetra/license_mapper.rb Outdated
Comment thread spec/spec_helper.rb Outdated
@nodeg
nodeg force-pushed the license_spdx branch 2 times, most recently from 6823728 to 88c6704 Compare January 18, 2026 10:38
@nodeg
nodeg requested a review from Copilot January 18, 2026 10:48

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 11 out of 12 changed files in this pull request and generated 4 comments.


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

Comment thread spec/lib/fine/license_mapper_spec.rb
Comment thread spec/lib/fine/package_spec.rb
Comment thread spec/lib/fine/package_spec.rb
Comment thread lib/tetra/packages/package.rb Outdated

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 11 out of 12 changed files in this pull request and generated 2 comments.


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

Comment thread spec/lib/coarse/license_detection_spec.rb Outdated
Comment thread spec/spec_helper.rb Outdated
@nodeg
nodeg requested a review from Copilot January 18, 2026 12:03

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 11 out of 12 changed files in this pull request and generated 2 comments.


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

Comment thread lib/tetra/constants.rb Outdated
Comment thread spec/lib/fine/license_mapper_spec.rb

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 11 out of 12 changed files in this pull request and generated no new comments.


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

@nodeg

nodeg commented Jan 18, 2026

Copy link
Copy Markdown
Member Author

Tests have passed. I am now squashing the last commit into the first one and merge then without waiting for the tests to pass again. They will nevertheless run once merged to master.

nodeg added 2 commits January 18, 2026 13:26
Fixes
- uyuni-project#12
- uyuni-project#6

Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
@nodeg nodeg added this to the 2.0.8 milestone Jan 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@nodeg
nodeg merged commit 86b6940 into uyuni-project:master Jan 18, 2026
9 checks passed
@nodeg
nodeg deleted the license_spdx branch January 18, 2026 12:28
@nodeg nodeg linked an issue Jan 18, 2026 that may be closed by this pull request
@nodeg nodeg linked an issue Jan 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature request gems tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tetra should add the License files to the rpm Tetra could try to convert licenses to SPDX identifiers

2 participants