Skip to content

Tag container images with a short commit hash#1230

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
samdoran:tagit
Feb 26, 2026
Merged

Tag container images with a short commit hash#1230
tisnik merged 1 commit intolightspeed-core:mainfrom
samdoran:tagit

Conversation

@samdoran
Copy link
Contributor

@samdoran samdoran commented Feb 26, 2026

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

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

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

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Let Konflux and GitHub Actions run the build job
  • Verify the seven character commit hash is added as a container image tag in quay.io/lightspeed-core/lightspeed-stack and quay.io/repository/redhat-user-workloads/lightspeed-core-tenant/lightspeed-stack

Summary by CodeRabbit

  • Chores
    • Enhanced image tagging in build pipelines to include short commit identifiers for improved build traceability and identification.

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.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Walkthrough

The 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

Cohort / File(s) Summary
CI/CD Short Commit Tagging
.github/workflows/build_and_push_dev.yaml, .tekton/lightspeed-stack-push.yaml
Introduces SHORT_COMMIT environment variable in GitHub Actions and ADDITIONAL_TAGS parameter in Tekton pipeline, both sourced from commit hash for Docker image tagging.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a short commit hash as a container image tag across CI/CD configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca21850 and 3e8b07f.

📒 Files selected for processing (2)
  • .github/workflows/build_and_push_dev.yaml
  • .tekton/lightspeed-stack-push.yaml

@major
Copy link
Contributor

major commented Feb 26, 2026

Thanks for putting this in, @samdoran! We should be able to deploy new builds a little faster in OpenShift.

Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM

@samdoran
Copy link
Contributor Author

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 git rev-parse --short HEAD. The value comes from core.abbrev which is calculated if undefined.

@tisnik
Copy link
Contributor

tisnik commented Feb 26, 2026

/ok-to-test

@tisnik tisnik merged commit f4d2d24 into lightspeed-core:main Feb 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants