Repository navigation
feat: add buildtags analyzer - #1052
Conversation
aba1854 to
00c6f30
Compare
| logme.Debugln("Could not read build info for", binaryPath, err) | ||
| return false | ||
| } | ||
| for _, setting := range info.Settings { |
There was a problem hiding this comment.
Interesting, we can read the binary and extract info from it.
academo
left a comment
There was a problem hiding this comment.
similar to the previous marketplace PR. there's no strong reason to make this a marketplace-specific validator.
This can be a generic validator that checks for specific symbols and have some rules disabled by default
We might want to introduce these checks in non-marketplace plugins in the future and it'll force us to either rewrite this validator or duplicate the logic.
@academo refactored to be a |
| Rules: []*analysis.Rule{marketplaceDevBuild}, | ||
| ReadmeInfo: analysis.ReadmeInfo{ | ||
| Name: "Build Tags", | ||
| Description: "Checks Go backend executables for disallowed build tags. The `marketplace-dev-build` rule rejects `marketplace_dev` and is disabled by default.", |
There was a problem hiding this comment.
there is no need to mention specific rules in the readme.
| } | ||
| } | ||
|
|
||
| for _, check := range buildTagChecks { |
There was a problem hiding this comment.
we should do one report per finding instead of combining them into a single one. that's how often we report things in the validator.
Adds
buildtagsanalyzer. Searches for build tags in Go backend executable. Added a rule that flags plugins with themarketplace_devbuild tag, which strips license checks from the executable. This mode is used for developing marketplace plugins locally without a Grafana Enterprise license, see grafana/grafana-plugin-sdk-go#1748