Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

[Bug] [INFRA/EYE] Failing to validate custom content when providing multiple licenses #10746

@arturo-seijas

Description

@arturo-seijas

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

License Tools (apache/skywalking-eyes)

What happened

Hi!

I've provided the following configuration expecting two different header patterns to be recognized, given that I have two different header contents in my source files (note that both configurations work separately):

header:
  - license:
    copyright-owner: Company Ltd.
    content: |
      Copyright [year] [owner]
      Licensed under the Apache2.0. See LICENSE file in charm source for details.
    paths:
      - 'lib/**'
    comment: on-failure
  - license:
    spdx-id: Apache-2.0
    copyright-owner: Company Ltd.
    content: |
      Copyright [year] [owner]
      See LICENSE file for licensing details.
    paths:
      - '**'
    paths-ignore:
      - 'lib/**'
    comment: on-failure

The resulting scan is ignoring the specified content. the tools is also throwing a warning failed to find a license template for spdx id , open header-templates/.txt: file does not exist.

What you expected to happen

The tool should have compared the headers against the content, analogous to what happens when a single license item is set.

How to reproduce

  • Create a new repository with the following files
  1. .licenserc.yaml
header:
  - license:
    copyright-owner: Company Ltd.
    content: |
      Copyright [year] [owner]
      Licensed under the Apache2.0. See LICENSE file in charm source for details.
    paths:
      - 'lib/**'
    comment: on-failure
  - license:
    spdx-id: Apache-2.0
    copyright-owner: Company Ltd.
    content: |
      Copyright [year] [owner]
      See LICENSE file for licensing details.
    paths:
      - '**'
    paths-ignore:
      - 'lib/**'
    comment: on-failure
  1. Add a sample.sh file with the following content
# Copyright 2023 Company Ltd.
# See LICENSE file for licensing details.
  1. Add a lib/samplelib.shfile with the following content
# Copyright 2023 Company Ltd.
# Licensed under the Apache2.0. See LICENSE file in charm source for details.
  • Run the GitHub action with the following configuration
- name: Check license headers
        uses: apache/skywalking-eyes/header@main
        with:
          config: .licenserc.yaml       

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working and you are sure it's a bug!license eye

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions