Skip to content

Add license validation#52

Merged
academo merged 9 commits intomainfrom
academo/validate-license
Jan 9, 2023
Merged

Add license validation#52
academo merged 9 commits intomainfrom
academo/validate-license

Conversation

@academo
Copy link
Copy Markdown
Collaborator

@academo academo commented Jan 9, 2023

Closes https://github.com/grafana/community-pipeline/issues/26

Add license detection and validation for plugins

@academo academo requested review from tolzhabayev and xnyo January 9, 2023 11:40
@academo academo self-assigned this Jan 9, 2023
@academo academo added the enhancement New feature or request label Jan 9, 2023

var Analyzer = &analysis.Analyzer{
Name: "archivename",
Name: "binarypermissions",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I missed this in my previous PR. It is not strictly part of these changes but fixes error reporting.


licenses, err := licensedb.Detect(filer)
if err != nil {
pass.ReportResult(pass.AnalyzerName, licenseNotProvided, "License not found", "Could not find or parse the license file inside the plugin archive. Please make sure to include a LICENCE file in your archive.")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am reporting this and the following as errors instead of returning the error. Returning the error will stop the whole plugincheck process to stop checking.

Copy link
Copy Markdown
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

LGTM! 👏👏👏

@academo academo merged commit 1c4118c into main Jan 9, 2023
@academo academo deleted the academo/validate-license branch January 9, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants