Skip to content

fix(scripts/dogfood): pass GO_LINT_NEW_CODE_BASE to the image lint run - #30851

Merged
droopy4096 merged 2 commits into
mainfrom
fix/dogfood-test-image-new-code-base
Oct 15, 2026
Merged

droopy4096 merged 2 commits into
mainfrom
fix/dogfood-test-image-new-code-base

Conversation

@coder

@coder coder Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Fixes the build_image (26.04) failure in the dogfood workflow on PRs into main (seen on #30807). Tracked in ENT-213.

Problem

lint/go/new-code (added in #30622) runs .golangci.new-code.yaml with --new-from-merge-base=$(GO_LINT_NEW_CODE_BASE), which defaults to origin/main. ci.yaml sets GO_LINT_NEW_CODE_BASE to HEAD^1 for PRs and HEAD otherwise. scripts/dogfood/test_image.sh doesn't pass it into the container, and the dogfood checkout (depth 2) has no origin/main. So make lint inside the image reports the whole tree (1263 issues: errcheck 437, forbidigo 42, nolintlint 784) and fails "Test image tooling".

Pushes to main run the same validation before pushing the image, so the next dogfood-triggering merge to main would also fail and skip the Docker Hub push.

Change

scripts/dogfood/test_image.sh only:

  • Under GitHub Actions, and when GO_LINT_NEW_CODE_BASE isn't already set, default it to HEAD^1 for pull_request and HEAD otherwise, mirroring ci.yaml.
  • Forward it into the container with --env GO_LINT_NEW_CODE_BASE.
  • Local runs are unchanged: the variable stays unset unless you set it, so the Makefile default (origin/main) applies.

This PR touches scripts/dogfood/**, which triggers the dogfood workflow, so its own build_image (26.04) run is the end-to-end test.

Opened by Superblink on behalf of @droopy4096.

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.
@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Oct 15, 2026
@linear-code

linear-code Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

ENT-213

ENT-215

@coder
coder Bot requested a review from denisra October 15, 2026 15:46
@droopy4096
droopy4096 merged commit 17ec945 into main Oct 15, 2026
30 checks passed
@droopy4096
droopy4096 deleted the fix/dogfood-test-image-new-code-base branch October 15, 2026 18:11
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community Pull Requests and issues created by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants