Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [INFRA/EYE] Failing to configure paths and paths-ignore when providing multiple licenses #10748

Closed
2 of 3 tasks
arturo-seijas opened this issue May 2, 2023 · 1 comment · Fixed by apache/skywalking-eyes#161
Assignees
Labels
bug Something isn't working and you are sure it's a bug! license eye

Comments

@arturo-seijas
Copy link

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 to the provided set of 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

When executing, all files are analysed by each entry.

What you expected to happen

I expected the first license to be applied only to lib/** and the second one for the rest of the files

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.

Add a lib/samplelib.sh file with the following content

# Copyright 2023 Company Ltd.
# Licensed under the Apache2.0. See LICENSE file in charm source for details.

Run license-eye -c .licenserc.yaml header check

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@arturo-seijas arturo-seijas added the bug Something isn't working and you are sure it's a bug! label May 2, 2023
@kezhenxu94
Copy link
Member

Hi @arturo-seijas , sorry to tell it turns out to be the yaml config is still wrong in terms of indentations, the culprit is that our doc gives the wrong one and I fix it in apache/skywalking-eyes#161 , please try this one:

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

Note that the paths/paths-ignore/comment are in the same level of license

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working and you are sure it's a bug! license eye
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants