Repository navigation
fix(scripts/dogfood): pass GO_LINT_NEW_CODE_BASE to the image lint run - #30851
Merged
Merged
Conversation
lint/go/new-code (#30622) only reports lines changed since GO_LINT_NEW_CODE_BASE, which defaults to origin/main. ci.yaml sets it to HEAD^1 for PRs and HEAD otherwise, but test_image.sh did not pass it into the container. The dogfood checkout is shallow and has no origin/main, so `make lint` in the dogfood image reported the whole tree (1263 issues) and failed build_image. Under GitHub Actions, default it the same way ci.yaml does and forward it into the container. Local runs keep the Makefile default.
denisra
approved these changes
Oct 15, 2026
droopy4096
approved these changes
Oct 15, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes the
build_image (26.04)failure in thedogfoodworkflow on PRs intomain(seen on #30807). Tracked in ENT-213.Problem
lint/go/new-code(added in #30622) runs.golangci.new-code.yamlwith--new-from-merge-base=$(GO_LINT_NEW_CODE_BASE), which defaults toorigin/main.ci.yamlsetsGO_LINT_NEW_CODE_BASEtoHEAD^1for PRs andHEADotherwise.scripts/dogfood/test_image.shdoesn't pass it into the container, and the dogfood checkout (depth 2) has noorigin/main. Somake lintinside the image reports the whole tree (1263 issues: errcheck 437, forbidigo 42, nolintlint 784) and fails "Test image tooling".Pushes to
mainrun the same validation before pushing the image, so the next dogfood-triggering merge tomainwould also fail and skip the Docker Hub push.Change
scripts/dogfood/test_image.shonly:GO_LINT_NEW_CODE_BASEisn't already set, default it toHEAD^1forpull_requestandHEADotherwise, mirroringci.yaml.--env GO_LINT_NEW_CODE_BASE.origin/main) applies.This PR touches
scripts/dogfood/**, which triggers thedogfoodworkflow, so its ownbuild_image (26.04)run is the end-to-end test.Opened by Superblink on behalf of @droopy4096.