Skip to content

Conversation

@eightbitraptor
Copy link
Contributor

Previously we expected "docker run image" to return the ruby sha but it does not.

When we build the tags for the manifest we try and fetch the commit hash from the environment, falling back to getting the latest commit from master if it's empty (which it will be in this case).

So this means there is a window between when the image builds happen and when the deploy_multiarch job happens where if HEAD advances then a tagged image will be built containing the incorrect Ruby version.

This is made more likely if there's a build failure (eg. for ephemeral apt reasons), because the time delta between the images are built and when deploy_multiarch gets the sha and creates the manifest gets larger.

The effect of this bug can be seen by examining the output of the 20251202 image builds where:

  • The dated image is built with a particular sha
  • The commit tagged image doesn't exist
  • A tagged image from a later commit exists, and contains the actually built sha.
❯ docker run -it rubylang/ruby:master-20251202 ruby -e 'puts RUBY_REVISION'
0e22108d60fbd0e338fb6e110ddd81a93b45b592

~/git/docker-images master*
❯ docker run --rm rubylang/ruby:master-0e22108d60fbd0e338fb6e110ddd81a93b45b592 ruby -e 'puts RUBY_REVISION'
Unable to find image 'rubylang/ruby:master-0e22108d60fbd0e338fb6e110ddd81a93b45b592' locally

~/git/docker-images master*
❯ docker run --rm rubylang/ruby:master-456ba321a84d34e76c8837ac96f47a11457480cb ruby -e 'puts RUBY_REVISION'
0e22108d60fbd0e338fb6e110ddd81a93b45b592

Previously we expected "docker run image" to return the ruby sha but it
does not.

When we build the tags for the manifest we try and fetch the commit hash
from the environment, falling back to getting the latest commit from
master if it's empty (which it will be in this case).

So this means there is a window between when the image builds happen and
when the deploy_multiarch job happens where if HEAD advances then a
tagged image will be built containing the incorrect Ruby version.

This is made more likely if there's a build failure (eg. for ephemeral
apt reasons), because the time delta between the images are built and
when deploy_multiarch gets the sha and creates the manifest gets larger.

The effect of this bug can be seen by examining the output of the
20251202 image builds where:

- The dated image is built with a particular sha
- The commit tagged image doesn't exist
- A tagged image from a later commit exists, and contains the actually
  built sha.

```
❯ docker run -it rubylang/ruby:master-20251202 ruby -e 'puts RUBY_REVISION'
0e22108d60fbd0e338fb6e110ddd81a93b45b592

~/git/docker-images master*
❯ docker run --rm rubylang/ruby:master-0e22108d60fbd0e338fb6e110ddd81a93b45b592 ruby -e 'puts RUBY_REVISION'
Unable to find image 'rubylang/ruby:master-0e22108d60fbd0e338fb6e110ddd81a93b45b592' locally

~/git/docker-images master*
❯ docker run --rm rubylang/ruby:master-456ba321a84d34e76c8837ac96f47a11457480cb ruby -e 'puts RUBY_REVISION'
0e22108d60fbd0e338fb6e110ddd81a93b45b592
```
@eightbitraptor eightbitraptor requested a review from hsbt December 3, 2025 16:30
@tekknolagi
Copy link

I think this happened again: rubybench/rubybench-data@aef07d5

@hsbt hsbt merged commit 5421a99 into master Dec 4, 2025
40 checks passed
@hsbt hsbt deleted the mvh-fix-commit-tags branch December 4, 2025 06:49
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.

4 participants