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] Unhelpful error for misconfigured .licenserc.yaml file #11648

Open
3 tasks done
jsoref opened this issue Dec 13, 2023 · 3 comments
Open
3 tasks done

[Bug] Unhelpful error for misconfigured .licenserc.yaml file #11648

jsoref opened this issue Dec 13, 2023 · 3 comments
Assignees

Comments

@jsoref
Copy link

jsoref commented Dec 13, 2023

Search before asking

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

Apache SkyWalking Component

License Tools (apache/skywalking-eyes)

What happened

WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 

What you expected to happen

  1. If there's a very finite list of available licenses, the list of available licenses should be mentioned
    • if the list is variable/dynamic, then a link to the available licenses should be provided (especially if there's a specific branch that's relevant...)
  2. the specific license id being checked should be clearly identified -- if the id is '' then use 's around the empty string to clarify that it's an empty string
    • to the extent possible, the source of an empty string should be identified

How to reproduce

  1. create a repository (with actions enabled...) with a workflow with steps similar to:

    steps:
      - name: Checkout
        uses: actions/checkout@v4
    
      - name: Fix License Header
        uses: apache/skywalking-eyes/header@v0.4.0
        with:
          mode: fix
  2. create .licenserc.yaml file with:

    header:
      spdx-id: BSD-3-Clause
      copyright-owner: Unknown
      software-name: unknown
      content: |
        Copyright (c) Unknown
        Distributed under the terms of the Modified BSD License.
    
      paths-ignore:
        - '**/.*'
  3. Add a file that skywalking will try to "fix".

  4. Push the repository to GitHub

Anything else

INFO Loading configuration from file: .licenserc.yaml 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
WARNING failed to find a license template for spdx id , open header-templates/.txt: file does not exist 
INFO Totally checked 96 files, valid: 0, invalid: 4, ignored: 92, fixed: 4

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@jsoref jsoref added the bug Something isn't working and you are sure it's a bug! label Dec 13, 2023
@wu-sheng wu-sheng added this to the license-eye 0.6.0 milestone Dec 13, 2023
@kezhenxu94
Copy link
Member

BSD-3-Clause is supported, you wrote the configuration file wrong, it's header/license/spdx-id, not header/spdx-id, please read the doc carefully

https://github.com/apache/skywalking-eyes/blob/ee81ff786927ea6ffa48b1e29c48e5289f4753aa/README.md?plain=1#L596-L600

@kezhenxu94 kezhenxu94 removed the bug Something isn't working and you are sure it's a bug! label Dec 13, 2023
@jsoref jsoref changed the title [Bug] Unhelpful error for unrecognized spdx-id [Bug] Unhelpful error for misconfigured .licenserc.yaml file Dec 13, 2023
@jsoref
Copy link
Author

jsoref commented Dec 13, 2023

Ah. I see. Sorry. I was trying to reduce a larger file to feed into something fairly unrelated -- I'm not trying to set up skywalking for use...

That said, the thrust of this ticket is not about whether or not bsd-3-clause is supported, but that the error reporting isn't great when the tool can't find what the user has (poorly) asked it to find.

When I went looking trying to find things, I found this directory which didn't have bsd-3-clause:
https://github.com/apache/skywalking-eyes/tree/main/assets/header-templates

OTOH, apparently it is present in this directory:
https://github.com/apache/skywalking-eyes/tree/main/assets/lcs-templates

But as the error message said header-templates/, it didn't occur to me to look in a directory named lcs-templates/, hence the request that the tool explain where it was looking and what/why it was looking for it.

@kezhenxu94
Copy link
Member

Ah. I see. Sorry. I was trying to reduce a larger file to feed into something fairly unrelated -- I'm not trying to set up skywalking for use...

That said, the thrust of this ticket is not about whether or not bsd-3-clause is supported, but that the error reporting isn't great when the tool can't find what the user has (poorly) asked it to find.

When I went looking trying to find things, I found this directory which didn't have bsd-3-clause:
https://github.com/apache/skywalking-eyes/tree/main/assets/header-templates

OTOH, apparently it is present in this directory:
https://github.com/apache/skywalking-eyes/tree/main/assets/lcs-templates

But as the error message said header-templates/, it didn't occur to me to look in a directory named lcs-templates/, hence the request that the tool explain where it was looking and what/why it was looking for it.

OK sounds reasonable to me. Let me reopen the issue and polish the error logs later.

@kezhenxu94 kezhenxu94 reopened this Dec 13, 2023
@kezhenxu94 kezhenxu94 removed this from the license-eye 0.6.0 milestone Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants