Skip to content

migrator: decouple image unit test from release-rewritten values - #1011

Merged
michaellzc merged 1 commit into
mainfrom
fix-migrator-image-test
Nov 11, 2026
Merged

michaellzc merged 1 commit into
mainfrom
fix-migrator-image-test

Conversation

@michaellzc

Copy link
Copy Markdown
Member

Every internal release build fails the sourcegraph-migrator chart unit test. The release tooling rewrites sourcegraph.image.repository (and the migrator defaultTag) in values.yaml to the internal registry, but the test asserted the chart default index.docker.io/sourcegraph/migrator. The test came from #966, and 8.2.0 is the first release branch that has it, so the 8.2.0 DeployRepoReleaseCreate helm workflow failed on build #3210.

This PR removes that assertion from the defaults test and adds a test that pins the repository and tag with set:, the same way charts/sourcegraph/tests/imageRepository_test.yaml does. It still checks how the image is built, but no longer depends on the values the release tooling rewrites.

Test plan

helm unittest (helm v4.3.0, helm-unittest v1.0.2) on the 4 charts that scripts/ci/helm-unittest.sh runs:

  • internal/release-v8.2.0 before the fix: migrator FAIL, Expected to match: ^index.docker.io/sourcegraph/migrator: Actual: us-docker.pkg.dev/sourcegraph-images/internal/migrator:8.2.0@sha256:28ab…, the same as build #3210.
  • internal/release-v8.2.0 with the fix: Charts: 4 passed, Tests: 254 passed.
  • main with the fix: Charts: 4 passed, Tests: 259 passed.
  • Hardcoding the registry in the sourcegraph.image helper makes the new test fail: Expected my.registry.example/sg/migrator:test, Actual index.docker.io/sourcegraph/migrator:test.

Releases rewrite sourcegraph.image.repository and migrator.image.defaultTag
in values.yaml to the internal registry for internal builds, so asserting the
chart default index.docker.io image failed every internal release build
(first hit by 8.2.0). Pin the repository and tag in the test instead, matching
charts/sourcegraph/tests/imageRepository_test.yaml.

Amp-Thread-ID: https://ampcode.com/threads/T-ca0eafc9-7175-4232-bd12-abd4f121842f
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

@michaellzc
michaellzc merged commit 017341c into main Nov 11, 2026
6 checks passed
@michaellzc
michaellzc deleted the fix-migrator-image-test branch November 11, 2026 19:13
michaellzc added a commit that referenced this pull request Nov 11, 2026
…itten values (#1012)

Backport of #1011 to `8.2.x`. The 8.2.0 helm release needs it:
`DeployRepoReleaseCreate` failed on this test ([build
#3210](https://buildkite.com/sourcegraph/deploy-sourcegraph-helm/builds/3210)),
and helm promotion is on hold until it's fixed. It was cherry-picked
cleanly with `-x`. See #1011 for the root cause.

## Test plan

`helm unittest` on this branch, for the 4 CI charts: `Charts: 4 passed`,
`Tests: 254 passed`. The same fix applied to `internal/release-v8.2.0`
also passes (254 tests); without it, `migrator` fails the same way as
#3210.

Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants