Tag container images with a short commit hash#1230
Tag container images with a short commit hash#1230tisnik merged 1 commit intolightspeed-core:mainfrom
Conversation
Images deployed by app-interface default to a seven character commit hash. Add this tag to build jobs so that images can be used in app-interface deployments.
WalkthroughThe pull request adds short commit hash tagging to container images in two CI/CD pipeline systems: GitHub Actions now includes SHORT_COMMIT as an image tag, and Tekton pipeline gains an ADDITIONAL_TAGS parameter populated from the short commit hash. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build_and_push_dev.yaml (1)
29-33: LGTM! Consider aligning the short hash length for consistency.The implementation correctly adds a 7-character commit hash tag using
--short=7. Note that line 31 uses--short(default length) while line 32 explicitly uses--short=7. While git's default is typically 7 characters, explicitly specifying the length on both lines would ensure consistency.♻️ Optional: Make short hash length explicit on line 31
- name: Create dev image tag run: | - echo "DEV_TAG=dev-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "DEV_TAG=dev-$(date +%Y%m%d)-$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV echo "SHORT_COMMIT=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV echo "dev image tag: ${{ env.DEV_TAG }}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build_and_push_dev.yaml around lines 29 - 33, The Create dev image tag step sets DEV_TAG and SHORT_COMMIT using git rev-parse; make the short-hash length explicit and consistent by changing the first command that sets DEV_TAG to use git rev-parse --short=7 (same as the SHORT_COMMIT assignment) so both DEV_TAG and SHORT_COMMIT use a 7-character commit hash; update the DEV_TAG command that currently uses git rev-parse --short to git rev-parse --short=7 and keep the environment variable names DEV_TAG and SHORT_COMMIT unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build_and_push_dev.yaml:
- Around line 29-33: The Create dev image tag step sets DEV_TAG and SHORT_COMMIT
using git rev-parse; make the short-hash length explicit and consistent by
changing the first command that sets DEV_TAG to use git rev-parse --short=7
(same as the SHORT_COMMIT assignment) so both DEV_TAG and SHORT_COMMIT use a
7-character commit hash; update the DEV_TAG command that currently uses git
rev-parse --short to git rev-parse --short=7 and keep the environment variable
names DEV_TAG and SHORT_COMMIT unchanged.
|
Thanks for putting this in, @samdoran! We should be able to deploy new builds a little faster in OpenShift. |
|
We could explicitly set the length for both commit hashes for consistency, but I opted to only change the one where I know the length must be exactly seven characters in order to keep the change minimal. Locally I get eight characters with |
|
/ok-to-test |
Description
Images deployed by app-interface default to a seven character commit hash. Add this tag to build jobs so that images can be used in app-interface deployments.
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
None
Related Tickets & Documents
None
Checklist before requesting a review
Testing
quay.io/lightspeed-core/lightspeed-stackandquay.io/repository/redhat-user-workloads/lightspeed-core-tenant/lightspeed-stackSummary by CodeRabbit