Skip to content

Simplify version retrieval in Docker workflow#863

Merged
nevil-mathew merged 1 commit into
masterfrom
docker-workflow
Oct 31, 2025
Merged

Simplify version retrieval in Docker workflow#863
nevil-mathew merged 1 commit into
masterfrom
docker-workflow

Conversation

@nevil-mathew

@nevil-mathew nevil-mathew commented Oct 31, 2025

Copy link
Copy Markdown
Collaborator

Refactor version assignment to directly use input.

Summary by CodeRabbit

  • Chores
    • Improved build pipeline version validation and extraction logic for Docker image tagging.

Refactor version assignment to directly use input.
@coderabbitai

coderabbitai Bot commented Oct 31, 2025

Copy link
Copy Markdown

Walkthrough

The GitHub Actions Docker image workflow's version extraction step is refactored to read the version directly from GitHub input, validate it against semantic versioning (X.Y.Z format after stripping leading "v"), and exit on validation failure. File-based intermediate storage is removed.

Changes

Cohort / File(s) Summary
Docker workflow version validation
\\.github/workflows/docker-image.yml
Reworked "Get Docker tag version" step: simplifies version extraction by directly assigning from input, adds semantic versioning validation (strips leading "v", enforces digits.digits.digits pattern), removes safe_output.txt file operations, writes normalized version directly to GITHUB_OUTPUT.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus on the validation logic to ensure the regex/pattern matching correctly enforces semantic versioning format
  • Verify error handling exits cleanly when version validation fails
  • Confirm GITHUB_OUTPUT assignment works correctly after normalization

Possibly related PRs

Poem

🐇 A version once nested in files, now flows free,
Validated with digits in perfect harmony—
No "v" sneaks ahead, the pattern rings true,
From input to output, streamlined and new! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Simplify version retrieval in Docker workflow" directly aligns with the main changes described in the raw summary. The core intent is to refactor the Docker workflow's version extraction by assigning VERSION directly from GitHub input and removing the intermediate safe_output.txt file approach—which is fundamentally about simplification. The title is concise, clear, and specific enough that a teammate would understand the primary change relates to streamlining version handling in the Docker build process. The PR objectives further confirm this intent with the description "Refactor version assignment to directly use input," matching the simplification theme.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docker-workflow

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7d7bf3 and bc9ff33.

📒 Files selected for processing (1)
  • .github/workflows/docker-image.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/docker-image.yml (1)

39-55: Clean refactoring with proper validation.

The version extraction step is well-refactored:

  • Explicit shell: bash ensures consistent parameter expansion and regex matching across runners.
  • Direct assignment from input removes unnecessary intermediate file operations.
  • Empty-input validation (lines 44–47) catches missing inputs early.
  • The ${VERSION#v} parameter expansion correctly strips leading "v" (e.g., "v3.3.11" → "3.3.11"), a common user convenience.
  • Semantic versioning validation enforces the strict X.Y.Z format; the regex ^[0-9]+(\.[0-9]+){2}$ requires exactly 3 numeric components—intentional based on the error message.
  • Output is correctly written to $GITHUB_OUTPUT using printf (more reliable than echo for consistency).

The implementation achieves the PR objectives cleanly and adds helpful validation without introducing runtime risks.


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.

@nevil-mathew
nevil-mathew merged commit f78daa7 into master Oct 31, 2025
1 of 2 checks passed
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.

1 participant