hack: add linting for multiple combinations of build tags#4070
Merged
jedevc merged 1 commit intomoby:masterfrom Jul 27, 2023
Merged
hack: add linting for multiple combinations of build tags#4070jedevc merged 1 commit intomoby:masterfrom
jedevc merged 1 commit intomoby:masterfrom
Conversation
We can't just add new build-tags, since this tests only the combination of all of the provided tags. For the instance of nydus, we need to test with *and* without the build tag. Signed-off-by: Justin Chadwell <me@jedevc.com>
crazy-max
reviewed
Jul 27, 2023
Comment on lines
+23
to
+25
| FROM scratch | ||
| COPY --link --from=golangci-lint /golangci-lint.done / | ||
| COPY --link --from=yamllint /yamllint.done / |
Member
There was a problem hiding this comment.
I guess this is to keep backward compat with previous behavior that had a single stage?
Member
Author
There was a problem hiding this comment.
Exactly yeah, we can remove this at some point later if we want though.
crazy-max
approved these changes
Jul 27, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #4067 and #4066.
Previously, we weren't linting the nydus tag either locally or in CI, so it was possible for things to slip. This PR adds linting for the nydus tag, and allows to easily extend this in the future.
We can't just add new build-tags to the golangci-lint config, since this tests only the combination of all of the provided tags. For the instance of nydus, we need to test with and without the build tag.
To do this, we lift the build tag logic into bake, and use the new matrix feature (though, note we can't actually run the golangci lint stages in parallel since 1. they all try and use all the CPU cores available, and 2. they play fun games when running at the same time that gives slightly bizarre and difficult to reproduce lint errors).