Skip to content

ci: add license scanning workflow with nuget-license tool#194

Merged
bingenito merged 2 commits intofinos:mainfrom
bingenito:license-scanning
Apr 24, 2025
Merged

ci: add license scanning workflow with nuget-license tool#194
bingenito merged 2 commits intofinos:mainfrom
bingenito:license-scanning

Conversation

@bingenito
Copy link
Copy Markdown
Member

@bingenito bingenito commented Mar 27, 2025

License Scanning Workflow Improvements

Fixes #180

This PR updates our license scanning infrastructure to improve accuracy and maintainability:

Changes:

  • Replace dotnet-project-licenses (v2.7.1) with nuget-license (v3.1.3) for compatibility with .NET 8+
  • Update the license scanning workflow to use the new tool with appropriate parameters
  • Clean up the allowed-licenses.json file by removing redundant entries
  • Add new configuration files:
    • excluded-projects.json: Excludes test projects and WpfFdc3 from license scanning
    • license-mapping.json: Maps license URLs to standard license types

Benefits:

  • More accurate license detection with fewer false positives
  • Better handling of edge cases through custom mapping
  • Cleaner output with JSON pretty formatting and error-only reporting
  • Improved maintainability through explicit project exclusions

These changes ensure our license compliance checks remain effective while reducing noise in the scanning process.


THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE FINOS CORPORATE CONTRIBUTOR LICENSE AGREEMENT.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

@bingenito bingenito requested a review from a team as a code owner March 27, 2025 13:10
@bingenito bingenito requested a review from Copilot March 27, 2025 13:10
Copy link
Copy Markdown

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 enhances the license scanning workflow by replacing the outdated dotnet-project-licenses tool with nuget-license and cleaning up associated configuration files.

  • Replaces dotnet-project-licenses (v2.7.1) with nuget-license (v3.1.3) in the CI workflow.
  • Updates command parameters to utilize JSON pretty formatting and error-only reporting.
  • Cleans up allowed-licenses.json and introduces excluded-projects.json and license-mapping.json for improved configuration.
Files not reviewed (3)
  • .license/allowed-licenses.json: Language not supported
  • .license/excluded-projects.json: Language not supported
  • .license/license-mapping.json: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/license-scanning.yml:30

  • The nuget-license command uses mixed flag prefixes (e.g. '-exclude-projects' and '-mapping' versus '--allowed-license-types'). If the tool expects consistent flag formats, consider using double dashes (e.g. '--exclude-projects' and '--mapping').
run: nuget-license -i fdc3-dotnet.sln --allowed-license-types ../.license/allowed-licenses.json --output JsonPretty --error-only -exclude-projects ../.license/excluded-projects.json -mapping ../.license/license-mapping.json

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.95%. Comparing base (efb171e) to head (584a3cc).
Report is 186 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   75.93%   77.95%   +2.02%     
==========================================
  Files          55       63       +8     
  Lines         453      549      +96     
  Branches       49       49              
==========================================
+ Hits          344      428      +84     
- Misses         87       98      +11     
- Partials       22       23       +1     

☔ 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.

Copy link
Copy Markdown
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

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

LGTM based on the last run on your fork. I might suggest dropping in a branch with a license you don't want (Prism?) to check that it'll flag it.

@bingenito bingenito merged commit bd0d903 into finos:main Apr 24, 2025
4 checks passed
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.

Migrate from unsupported dotnet-project-licenses to a new license checking process

4 participants