Skip to content

Conversation

miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented Oct 10, 2025

Release Notes:

  • Add new workflow for automated update of v1 tag. Update will be done after release.

Summary by CodeRabbit

  • Chores
    • Added automation to update the v1 release tag whenever a release is published, keeping the v1 pointer aligned with the released commit.
    • Ensures download links, install scripts, and integrations that reference v1 consistently point to the intended release.
    • Infrastructure-only change; no application behavior, API, or UI changes. No action required from end users.

Fixes #194

- Add new workflow for automated update of v1 tag. Update will be done after release.
@miroslavpojer miroslavpojer self-assigned this Oct 10, 2025
Copy link

coderabbitai bot commented Oct 10, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a GitHub Actions workflow that runs on release published events, resolves the release tag’s commit SHA, creates or force-updates a lightweight v1 tag to that commit, and pushes the updated tag to origin. Fails if the release tag is missing or unreachable.

Changes

Cohort / File(s) Summary
CI/CD workflow: v1 tag updater
.github/workflows/update_v1_tag.yml
Adds a workflow triggered on release published events that checks out the repo with full history, sets git user to github-actions, fetches tags, resolves the release tag to its commit SHA, validates the commit exists, updates v1 (lightweight) to that SHA, and pushes refs/tags/v1 to origin using --force-with-lease. Includes error handling for missing/unreachable release tag.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor GitHub as GitHub Release
    participant GA as GitHub Actions
    participant Git as Git CLI
    participant Origin as remote: origin

    GitHub->>GA: release published (tag)
    GA->>GA: actions/checkout (full history)
    GA->>Git: git config user.name/email (github-actions)
    GA->>Git: git fetch --tags --force
    GA->>Git: resolve release tag -> commit SHA
    alt commit found
        GA->>Git: git tag -f v1 <SHA>
        GA->>Origin: git push --force-with-lease origin refs/tags/v1
        Note right of GA: v1 now points to release commit
    else tag not found or unreachable
        GA->>GitHub: fail job with error
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my nose and nudge the tag,
A tiny hop to point v1’s flag.
From latest release I take my cue,
Push gently forward — good as new.
🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not follow the repository’s template: it only provides release notes and the issue link but omits the required summary header, the checklist section, and the Additional Context section specified in the template. Please update the description to match the template by adding a concise PR summary, completing the checklist items, and including the “Additional Context” section as outlined in the repository’s description template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly describes the addition of support for the short v1 tag, which is the main focus of this changeset, although it includes the issue reference as a prefix.
Linked Issues Check ✅ Passed The new GitHub Actions workflow automatically updates the short v1 tag on every release, directly satisfying the feature objective of ensuring users always fetch the latest version via the v1 tag as described in issue #194.
Out of Scope Changes Check ✅ Passed All changes are confined to a new GitHub Actions workflow file that implements the v1 tag update, which aligns with the linked issue’s scope; there are no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 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 d6cffdd and 828a925.

📒 Files selected for processing (1)
  • .github/workflows/update_v1_tag.yml (1 hunks)

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

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/update_v1_tag.yml (1)

13-15: Ensure full history for tag/commit resolution.

Fetch the full history to reliably resolve the release tag’s commit.

-      - name: Checkout repo
-        uses: actions/checkout@v4
+      - name: Checkout repo
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a2ea4f and f45dbb5.

📒 Files selected for processing (1)
  • .github/workflows/update_v1_tag.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/update_v1_tag.yml

5-5: expected "inputs" key for "workflow_dispatch" section but got "types"

(syntax-check)

Copy link

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f45dbb5 and e7d7076.

📒 Files selected for processing (1)
  • .github/workflows/update_v1_tag.yml (1 hunks)

Copy link

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/update_v1_tag.yml (1)

34-35: Use --force-with-lease when pushing the tag.

git push origin -f refs/tags/v1 can overwrite a newer remote tag if someone updates it between fetch and push. Add a lease so the push only proceeds when the remote still matches what we fetched.

-          git push origin -f refs/tags/v1
+          git push origin --force-with-lease=refs/tags/v1 refs/tags/v1
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f45dbb5 and 3005419.

📒 Files selected for processing (1)
  • .github/workflows/update_v1_tag.yml (1 hunks)

Copy link

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3005419 and d6cffdd.

📒 Files selected for processing (1)
  • .github/workflows/update_v1_tag.yml (1 hunks)

Comment on lines 34 to 35
git tag -f v1 "$COMMIT_SHA"
git push origin --force-with-lease=refs/tags/v1 refs/tags/v1
Copy link

@coderabbitai coderabbitai bot Oct 10, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix tag push: --force-with-lease fails for tags without explicit expectation.

After retagging, git push origin --force-with-lease=refs/tags/v1 refs/tags/v1 has no remote-tracking ref for refs/tags/v1, so the push aborts once the tag already exists—meaning the workflow can never update v1. Capture the current remote tag SHA before retagging and pass it as the expected value (or fall back to --force when the tag is new).

-          git tag -f v1 "$COMMIT_SHA"
-          git push origin --force-with-lease=refs/tags/v1 refs/tags/v1
+          PREV_SHA="$(git show-ref --tags -s v1 || true)"
+          git tag -f v1 "$COMMIT_SHA"
+          if [ -n "$PREV_SHA" ]; then
+            git push origin --force-with-lease=refs/tags/v1:$PREV_SHA refs/tags/v1
+          else
+            git push origin --force refs/tags/v1
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
git tag -f v1 "$COMMIT_SHA"
git push origin --force-with-lease=refs/tags/v1 refs/tags/v1
PREV_SHA="$(git show-ref --tags -s v1 || true)"
git tag -f v1 "$COMMIT_SHA"
if [ -n "$PREV_SHA" ]; then
git push origin --force-with-lease=refs/tags/v1:$PREV_SHA refs/tags/v1
else
git push origin --force refs/tags/v1
fi
🤖 Prompt for AI Agents
In .github/workflows/update_v1_tag.yml around lines 34-35, the push uses
--force-with-lease without an expected value which fails when there's no
remote-tracking ref; first query the current remote tag SHA (e.g. git ls-remote
--tags origin refs/tags/v1) and store it as expected_sha, then after retagging
use git push origin --force-with-lease=refs/tags/v1:<expected_sha> refs/tags/v1;
if no remote SHA was found (tag is new) fall back to git push origin --force
refs/tags/v1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will return to tested origin.

Copy link

Choose a reason for hiding this comment

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

@miroslavpojer, understood! Feel free to reach out if you need any assistance with the implementation or would like me to review the updated approach. 🐰

@miroslavpojer miroslavpojer merged commit b902235 into master Oct 10, 2025
5 of 6 checks passed
@miroslavpojer miroslavpojer deleted the feature/194-Add-support-for-short-v1-tag branch October 10, 2025 14:45
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.

Add support for short v1 tag

1 participant