Add proactive version-bump PR sweep (Workflow C) - #14
Merged
Conversation
New scripts/bump-versions-pr.sh: instead of just reporting plugin version drift across rundeck/rundeckpro/ua-runner, bundles every bump a repo needs into one branch/commit and opens a single PR for human review - closes the gap between check-versions.sh's read-only report and someone manually applying the fix. Also fixes a real correctness bug found while validating this against live data: both check-versions.sh and the new script were reading gradle.properties from the working tree, which is wrong whenever a repo is checked out on a stale feature branch (as rundeck was). Both now snapshot origin/main's actual content via git show instead. This caused rundeck PR #10470 to initially claim 7 bumps when only 2 were real; corrected that PR's description after the fix landed here. Ran for real: opened rundeck/rundeck#10470, rundeckpro/rundeckpro#4960, and rundeckpro/ua-runner#203, restoring each repo to whatever branch it was on beforehand.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the rundeck-plugin-versions skill with a new proactive “Workflow C” that can automatically bundle all required plugin version bumps per consuming repo into a single branch/commit and open a PR for human review. It also hardens version-drift detection by reading origin/main’s gradle.properties rather than whatever branch happens to be checked out locally.
Changes:
- Document “Workflow C” and the “don’t read
gradle.propertiesfrom the working tree” gotcha in the skill docs. - Update
check-versions.shto snapshotorigin/main:gradle.propertiesinto temp files for drift checks. - Add
bump-versions-pr.shto create one PR per consuming repo containing all needed version bumps.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| skills/rundeck-plugin-versions/SKILL.md | Adds Workflow C documentation and clarifies safe operating constraints (no pushing to main, use origin/main snapshots). |
| skills/rundeck-plugin-versions/scripts/check-versions.sh | Uses git show origin/main:gradle.properties snapshots instead of working-tree reads to avoid false drift on stale branches. |
| skills/rundeck-plugin-versions/scripts/bump-versions-pr.sh | New script to compute drift vs origin/main, apply bundled bumps, push a branch, and open a PR per repo. |
Suppressed comments (1)
skills/rundeck-plugin-versions/scripts/bump-versions-pr.sh:178
- If the repo started in a detached state,
$orig_branchis empty (after switching to symbolic-ref) and the current restore block would attemptgit checkout "". Restore should handle both branch and detached-ref cases explicitly.
if [ "$orig_branch" != "$branch" ]; then
git -C "$repo_dir" checkout "$orig_branch" --quiet
echo " (restored $repo_label to original branch: $orig_branch)"
fi
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+62
to
+70
| snapshot_main_props() { | ||
| local dir="$1" | ||
| [ -d "$dir" ] || { echo ""; return; } | ||
| git -C "$dir" fetch origin --quiet 2>/dev/null || true | ||
| local tmp | ||
| tmp="$(mktemp)" | ||
| git -C "$dir" show origin/main:gradle.properties > "$tmp" 2>/dev/null || true | ||
| echo "$tmp" | ||
| } |
Comment on lines
+62
to
+69
| # Always diff against origin/main's actual content, never whatever | ||
| # happens to be checked out (which is often an in-progress feature | ||
| # branch that can be stale relative to main in either direction). | ||
| git -C "$repo_dir" fetch origin --quiet | ||
| local remote_props | ||
| remote_props="$(mktemp)" | ||
| git -C "$repo_dir" show origin/main:gradle.properties > "$remote_props" 2>/dev/null || true | ||
|
|
Comment on lines
+118
to
+123
| # Remember whatever branch was checked out (often an in-progress feature | ||
| # branch, not main) so we can restore it once the PR is open, instead of | ||
| # silently leaving the repo on the new bump branch. | ||
| local orig_branch | ||
| orig_branch="$(git -C "$repo_dir" rev-parse --abbrev-ref HEAD)" | ||
|
|
Comment on lines
+128
to
+130
| local branch="bump-plugin-versions-$(date +%Y%m%d)" | ||
| git -C "$repo_dir" checkout -b "$branch" --quiet 2>/dev/null || git -C "$repo_dir" checkout "$branch" --quiet | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
scripts/bump-versions-pr.shand a new "Workflow C" to therundeck-plugin-versionsskill. Unlikecheck-versions.sh(read-onlyreport), this bundles every plugin-version bump a consuming repo needs
into one branch/commit and opens a single PR per repo for human review.
Why
Renovate already tracks some of this on its own, but not reliably/for
everything, and the existing skill stopped at "here's a diff, go open a
PR yourself." This closes that gap and makes it proactive.
A real bug found and fixed along the way
Both
check-versions.shand the new script originally readgradle.propertiesfrom the working tree. That's wrong whenever a repois checked out on a stale feature branch (common - these are active
repos). Concretely:
rundeckwas on an in-progress ticket branch when Iran this, and its
mainalready had 5 of what looked like 7 neededbumps merged independently. Reading the working tree made the script
(and check-versions.sh) report false drift for those 5. Both scripts now
snapshot
origin/main's actual content viagit showinstead ofreading the working tree, and always restore whatever branch a repo was
on before touching anything.
Already run for real
All three repos were restored to their original branch afterward; none
were left on the bump branch.