Skip to content

Fix update container image script#196

Merged
moroten merged 1 commit into
mainfrom
fix-container-image-script
Jun 15, 2026
Merged

Fix update container image script#196
moroten merged 1 commit into
mainfrom
fix-container-image-script

Conversation

@oscar-meroton

Copy link
Copy Markdown
Collaborator

The script for updating the Buildbarn container image versions relied on dummy dependencies, which were removed in #195. This commit makes the script read from MODULE.bazel to determine the image versions instead.

The script for updating the Buildbarn container image
versions relied on dummy dependencies, which were removed
in #195. This commit makes the script read from MODULE.bazel
to determine the image versions instead.
@oscar-meroton oscar-meroton force-pushed the fix-container-image-script branch from 9029736 to c53c0a7 Compare June 15, 2026 13:30
@moroten moroten merged commit 086e16d into main Jun 15, 2026
3 checks passed
@moroten moroten deleted the fix-container-image-script branch June 15, 2026 14:37
"https://api.github.com/repos/buildbarn/$repo/commits/$hash_full")
exit_code=$?
if [[ "$exit_code" != 0 ]]; then
echo >&2 "Failed to fetch https://api.github.com/repos/buildbarn/$repo/commits/$hash_full"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want to duplicate the url in the error message?
Could you extract it to a variable instead?

Is this because Curl does not print an error message with --silent? Generally this adds code that I'd prefer to not need. A simple set -e -o pipefail and have the subcommands print their errors.
Then we enrich with extra information, but this does not seem very extra.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A variable would make sense, yes.

During testing I could not get the program to exit on curl error for whatever reason, hence the manual exit code check. set -e -o pipefail is already present. I'm probably missing something, would you mind taking a quick look?

# The date separates the day and the time segment with a "T"
# and appends "Z".
# The image versions are constructed using `MODULE.bazel` and Github.
# The first seven characters from the commit hash in `MODULE.bazel`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we only use the first seven? If the module file has the full hash?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. This refers specifically to the construction of the image version, which consists of the first seven commit hash characters + the timestamp, the latter being retrieved from Github using the full hash.

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.

3 participants