Skip to content

fix(ci): robust SHA sync in bump-self-sha + final fixes#171

Merged
YiWang24 merged 1 commit into
mainfrom
fix/robust-bump-script
May 26, 2026
Merged

fix(ci): robust SHA sync in bump-self-sha + final fixes#171
YiWang24 merged 1 commit into
mainfrom
fix/robust-bump-script

Conversation

@YiWang24

@YiWang24 YiWang24 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Final fixes for auto-bump workflow

1. Robust SHA replacement (bump-self-sha.sh)

Replaced exact-string SHA matching with regex that finds ALL YiAgent/OpenCI@<40-char-hex> references in workflow files. This fixes the case where workflow files have a different SHA than manifest.yml (due to the revert-workflow-files period).

2. RELEASE_PAT for git push

github.token cannot push .github/workflows/ files. Using RELEASE_PAT via remote URL override for the git push step.

3. Guard condition fix

Added steps.guard.outputs.skip check to Manage PRs step condition to prevent execution when guard detects bump commits.

4. Direct merge instead of --auto

gh pr merge --auto requires branch protection rules on main. Using direct --squash --delete-branch merge.

5. SHA sync

All 12 workflow files synced to current manifest.yml SHA (119c3ea).

no-issue


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Greptile Summary

This PR makes bump-self-sha.sh robust to SHA drift between manifest.yml and workflow files by replacing exact-SHA grep with a regex that matches all YiAgent/OpenCI/<subpath>@<40-hex> references. It also syncs all 12 workflow files and manifest.yml to the current main HEAD SHA (119c3eab).

  • scripts/bump-self-sha.sh: Step 5 now uses a Perl regex to replace any pinned OpenCI reference regardless of which SHA was previously recorded; a before/after shasum checksum comparison detects which files were actually modified.
  • 12 workflow files + manifest.yml: Mechanical SHA bump from 34a93579 to 119c3eab across all uses: lines and the deps map entry.

Confidence Score: 4/5

Safe to merge — all workflow-file changes are mechanical SHA bumps, and the script logic change is a straightforward improvement with no functional regression risk.

The regex replacement correctly covers all YiAgent/OpenCI subpath reference patterns present in the repo. The only findings are a deprecated \1 back-reference (works today but not idiomatic) and the find -o without explicit -print0 (portable enough for CI but less rigorous). Neither affects correctness in the current environment.

Only scripts/bump-self-sha.sh warrants a second look on the find invocation and Perl replacement style, but these are non-blocking quality notes.

Important Files Changed

Filename Overview
scripts/bump-self-sha.sh Core change: replaces exact-SHA grep with a regex matching any YiAgent/OpenCI subpath reference; adds before/after checksum comparison. Two style issues flagged.
manifest.yml SHA bumped for YiAgent/OpenCI to 119c3ea to align with current main HEAD.
.github/workflows/reusable-ci.yml Eight resolve-openci action SHA references bumped; no logic changes.
.github/workflows/reusable-pr.yml Three resolve-openci action SHA references bumped; no logic changes.
.github/workflows/reusable-self-test.yml Four resolve-openci action SHA references bumped; no logic changes.
.github/workflows/issue-ops.yml Three job-level reusable workflow SHA references bumped; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to main] --> B[on-main-bump-sha triggers]
    B --> C{Guard: is this a bot bump commit?}
    C -- yes --> D[Skip all steps]
    C -- no --> E[Check if manifest SHA matches HEAD]
    E -- already in sync --> F[Skip nothing to do]
    E -- stale --> G[Run bump-self-sha.sh]
    G --> G1[Step 4: update manifest.yml via exact old_sha]
    G --> G2[Step 5: regex-replace ALL YiAgent/OpenCI@40hex refs]
    G1 & G2 --> H[shasum before/after to count changed files]
    H --> I[git checkout new bump branch]
    I --> J[git push via RELEASE_PAT remote URL]
    J --> K[gh pr create]
    K --> L[gh pr merge squash delete-branch]
    L --> M[Squash commit lands on main]
    M --> B
    M --> N{Guard catches chore-manifest message}
    N -- yes --> D
Loading

Reviews (1): Last reviewed commit: "fix(ci): robust SHA update in bump-self-..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Two changes:

1. bump-self-sha.sh step 5: Replace ALL YiAgent/OpenCI@<40-char-hex>
   references in workflow files (not just the manifest.yml SHA). Uses
   regex instead of exact string matching so it works even when
   workflow files have a different SHA than manifest.yml — fixing the
   divergence caused by the earlier revert-workflow-files approach.

2. Sync all 12 workflow files to current manifest.yml SHA (119c3ea).
   All YiAgent/OpenCI references are now consistent.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@YiWang24, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 45 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 655b8c96-be62-4372-8c87-244bfc6c60d1

📥 Commits

Reviewing files that changed from the base of the PR and between 119c3ea and f8601dc.

📒 Files selected for processing (14)
  • .github/workflows/agent.yml
  • .github/workflows/ci-self-test.yml
  • .github/workflows/ci.yml
  • .github/workflows/dependencies.yml
  • .github/workflows/docs.yml
  • .github/workflows/issue-ops.yml
  • .github/workflows/on-maintenance.yml
  • .github/workflows/pull-request.yml
  • .github/workflows/release.yml
  • .github/workflows/reusable-ci.yml
  • .github/workflows/reusable-pr.yml
  • .github/workflows/reusable-self-test.yml
  • manifest.yml
  • scripts/bump-self-sha.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/robust-bump-script

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.

@YiWang24 YiWang24 merged commit b3b2bf0 into main May 26, 2026
10 of 16 checks passed
@YiWang24 YiWang24 deleted the fix/robust-bump-script branch May 26, 2026 03:09
@sonarqubecloud

Copy link
Copy Markdown

@openbot-dev openbot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bump all YiAgent/OpenCI SHA references from 34a9357 to 119c3ea across workflows and manifest; includes improved robustness in bump-self-sha.sh.

Comment thread scripts/bump-self-sha.sh
perl -pi -e "s|\Q${old_sha}\E|${new_sha}|g" "$f"
# Compare checksums to detect if perl actually changed the file.
before=$(shasum -a 256 "$f" 2>/dev/null || true)
perl -pi -e "s|(YiAgent/OpenCI/[^\s@]+)\@[a-f0-9]{40}|\1\@${new_sha}|g" "$f"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Deprecated Perl back-reference in replacement string

\1 in the replacement side of s/// is deprecated in Perl — it is documented as equivalent to $1 today, but perlop explicitly warns that the behaviour may change in future versions. The idiomatic form is $1, which carries no deprecation risk and makes the intent unambiguous to readers unfamiliar with the edge-case rule that \N in a replacement string is treated as a back-reference rather than an octal escape.

Comment thread scripts/bump-self-sha.sh
Comment on lines 117 to 118
done < <(find "$REPO_ROOT/.github/workflows" "$REPO_ROOT/actions" \
-name "*.yml" -o -name "*.yaml" 2>/dev/null | tr '\n' '\0')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 find -o without explicit -print0 and tr conversion

Two compounding robustness concerns: (1) find … -name "*.yml" -o -name "*.yaml" without an explicit action relies on implicit -print being appended to the whole expression — standard in GNU/BSD find but not guaranteed by POSIX; (2) piping through tr '\n' '\0' means any filename with an embedded newline would be split incorrectly. Using \( -name "*.yml" -o -name "*.yaml" \) -print0 eliminates both concerns.

Suggested change
done < <(find "$REPO_ROOT/.github/workflows" "$REPO_ROOT/actions" \
-name "*.yml" -o -name "*.yaml" 2>/dev/null | tr '\n' '\0')
perl -pi -e 's|(YiAgent/OpenCI/[^\s@]+)\@[a-f0-9]{40}|$1\@'"${new_sha}"'|g' "$f"
after=$(shasum -a 256 "$f" 2>/dev/null || true)
if [ "$before" != "$after" ]; then
info "Updated $f"
updated=$((updated + 1))
fi
done < <(find "$REPO_ROOT/.github/workflows" "$REPO_ROOT/actions" \
\( -name "*.yml" -o -name "*.yaml" \) -print0 2>/dev/null)

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