Skip to content

fix: resolve docker image tags from git and auto-detect CLI version#9411

Merged
chaptersix merged 5 commits intotemporalio:mainfrom
chaptersix:fix/docker-build-manual-ref-mismatch
Mar 10, 2026
Merged

fix: resolve docker image tags from git and auto-detect CLI version#9411
chaptersix merged 5 commits intotemporalio:mainfrom
chaptersix:fix/docker-build-manual-ref-mismatch

Conversation

@chaptersix
Copy link
Copy Markdown
Contributor

@chaptersix chaptersix commented Feb 26, 2026

Summary

  • Resolve git ref and SHA from the checked-out tree (git rev-parse, git symbolic-ref) instead of GITHUB_REF/GITHUB_SHA, which point to the dispatch branch for workflow_dispatch events
  • Auto-detect CLI version from the downloaded binary via temporal --version fixing the admin-tools OCI label showing "unknown"
  • Remove ref input from the manual docker build workflow -- users should dispatch from the branch they want to build from

For workflow_dispatch events, GITHUB_REF and GITHUB_SHA point to the
branch the workflow was dispatched from, not the ref specified in
inputs.ref. This caused Docker images to be tagged with the wrong
branch name and SHA.

The build-docker-images composite action now resolves the ref and SHA
directly from the checked-out git tree, which is correct regardless of
trigger type.
@chaptersix chaptersix force-pushed the fix/docker-build-manual-ref-mismatch branch from 4c3ec5c to 3572f22 Compare February 26, 2026 22:38
@chaptersix chaptersix marked this pull request as ready for review February 26, 2026 23:30
@chaptersix chaptersix requested review from a team as code owners February 26, 2026 23:30
@chaptersix chaptersix marked this pull request as draft February 26, 2026 23:32
Extract CLI version from the downloaded binary using --version instead
of relying on a manually specified input. This fixes the admin-tools
OCI label showing "unknown" for the CLI version.

Also removes the ref and cli-version inputs from the manual docker
build workflow - users should dispatch from the target branch instead.
@chaptersix chaptersix changed the title fix: resolve git ref/SHA from checkout instead of GITHUB_REF fix: resolve docker image tags from git and auto-detect CLI version Mar 10, 2026
Replace the shell-based git-info step with resolveGitInfo() in the Go
helper, called as part of set-image-tags. This consolidates all ref
and SHA resolution logic in one testable place.
@chaptersix chaptersix marked this pull request as ready for review March 10, 2026 22:22
Copy link
Copy Markdown
Contributor

@spkane31 spkane31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but few comments to consider

@chaptersix chaptersix force-pushed the fix/docker-build-manual-ref-mismatch branch from 8514ef6 to fb0bd41 Compare March 10, 2026 23:02
- Rename shadowed err to tagErr in resolveGitInfo tag fallback
- Consolidate extract-version and extract-cli-version into a single
  extract-binary-version command that takes binary name and output name
- Use t.Fatalf instead of t.Errorf + return in tests
- Add pre-release version test case (e.g. 1.31.0-151.5)
@chaptersix chaptersix force-pushed the fix/docker-build-manual-ref-mismatch branch from fb0bd41 to 97cd6cc Compare March 10, 2026 23:05
@chaptersix chaptersix enabled auto-merge (squash) March 10, 2026 23:05
@chaptersix chaptersix merged commit c3db52a into temporalio:main Mar 10, 2026
46 checks passed
stephanos pushed a commit that referenced this pull request Mar 11, 2026
…9411)

## Summary

- Resolve git ref and SHA from the checked-out tree (`git rev-parse`,
`git symbolic-ref`) instead of `GITHUB_REF`/`GITHUB_SHA`, which point to
the dispatch branch for `workflow_dispatch` events
- Auto-detect CLI version from the downloaded binary via `temporal
--version` fixing the admin-tools OCI label showing "unknown"
- Remove `ref` input from the manual docker build workflow -- users
should dispatch from the branch they want to build from
chaptersix added a commit to chaptersix/temporal that referenced this pull request Mar 12, 2026
…emporalio#9411)

## Summary

- Resolve git ref and SHA from the checked-out tree (`git rev-parse`,
`git symbolic-ref`) instead of `GITHUB_REF`/`GITHUB_SHA`, which point to
the dispatch branch for `workflow_dispatch` events
- Auto-detect CLI version from the downloaded binary via `temporal
--version` fixing the admin-tools OCI label showing "unknown"
- Remove `ref` input from the manual docker build workflow -- users
should dispatch from the branch they want to build from
chaptersix added a commit that referenced this pull request Mar 12, 2026
…backport to v1.30.x) (#9499)

## Summary
- Cherry-pick of #9411 (c3db52a) into
`release/v1.30.x`
- Resolves docker image tags from git and auto-detects CLI version
birme pushed a commit to eyevinn-osaas/temporal that referenced this pull request Mar 23, 2026
…emporalio#9411)

## Summary

- Resolve git ref and SHA from the checked-out tree (`git rev-parse`,
`git symbolic-ref`) instead of `GITHUB_REF`/`GITHUB_SHA`, which point to
the dispatch branch for `workflow_dispatch` events
- Auto-detect CLI version from the downloaded binary via `temporal
--version` fixing the admin-tools OCI label showing "unknown"
- Remove `ref` input from the manual docker build workflow -- users
should dispatch from the branch they want to build from
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