Skip to content

fix: Update license header pattern to match existing files - #159

Closed
cbartz wants to merge 4 commits into
mainfrom
fix-license-check-pattern
Closed

fix: Update license header pattern to match existing files#159
cbartz wants to merge 4 commits into
mainfrom
fix-license-check-pattern

Conversation

@cbartz

@cbartz cbartz commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Applicable spec: N/A

Overview

Update .licenserc.yaml to use pattern instead of content to correctly recognize existing license headers in the codebase.

Rationale

The license header check was failing with 19 invalid files (valid: 0, invalid: 19) even though all files have proper license headers in the format:

Copyright YYYY Canonical Ltd.
See LICENSE file for licensing details.

The issue was that the configuration used content which expects literal placeholders like [year] and [owner], but the actual files use specific years and "Canonical Ltd.". Using pattern with a regex allows matching the actual format.

Before:

content: |
  Copyright [year] [owner]
  See LICENSE file for licensing details.

After:

pattern: |
  Copyright \d{4} Canonical Ltd.
  See LICENSE file for licensing details.

Testing:

docker run apache/skywalking-eyes header check
  • Before: valid: 0, invalid: 19, ignored: 57
  • After: valid: 19, invalid: 0, ignored: 57

Juju Events Changes

None

Module Changes

None

Library Changes

None

Checklist

  • The charm style guide was applied
  • The contributing guide was applied
  • The changes are compliant with ISD054 - Managing Charm Complexity
  • The documentation for charmhub is updated - N/A (CI configuration only)
  • The PR is tagged with appropriate label (urgent, trivial, complex)
  • The CHANGELOG.md is updated with user-relevant changes. - N/A (CI configuration fix, not user-facing)

This is a trivial CI configuration fix that resolves failing license header checks.

Change from 'content' to 'pattern' in .licenserc.yaml to properly
recognize existing license headers in the codebase. This resolves
the failing license header checks that were reporting 19 invalid files.

The pattern now correctly matches:
  Copyright YYYY Canonical Ltd.
  See LICENSE file for licensing details.
@cbartz
cbartz requested a review from a team as a code owner January 28, 2026 11:34
@cbartz
cbartz requested review from amandahla and florentianayuwono and removed request for a team January 28, 2026 11:34
@cbartz
cbartz enabled auto-merge (squash) January 28, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor

Unused entries in .trivyignore

Image: ghcr.io/canonical/content-cache:40d0c23bc44d72b8c11a7c8f4356c8c43e11d4ac-_latest_amd64

The following CVEs are in .trivyignore but not ignored by Trivy anymore:

@cbartz

cbartz commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

No longer necessary

@cbartz cbartz closed this Jan 29, 2026
auto-merge was automatically disabled January 29, 2026 06:20

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants