Skip to content

Add proactive version-bump PR sweep (Workflow C) - #14

Merged
fdevans merged 1 commit into
mainfrom
add-version-bump-pr-skill
Aug 18, 2026
Merged

Add proactive version-bump PR sweep (Workflow C)#14
fdevans merged 1 commit into
mainfrom
add-version-bump-pr-skill

Conversation

@fdevans

@fdevans fdevans commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

Adds scripts/bump-versions-pr.sh and a new "Workflow C" to the
rundeck-plugin-versions skill. Unlike check-versions.sh (read-only
report), 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.sh and the new script originally read
gradle.properties from the working tree. That's wrong whenever a repo
is checked out on a stale feature branch (common - these are active
repos). Concretely: rundeck was on an in-progress ticket branch when I
ran this, and its main already had 5 of what looked like 7 needed
bumps 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 via git show instead of
reading 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.

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.
@fdevans
fdevans requested review from a team and a lite review from Copilot August 18, 2026 17:42
@fdevans
fdevans merged commit 5cf9d88 into main Aug 18, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.properties from the working tree” gotcha in the skill docs.
  • Update check-versions.sh to snapshot origin/main:gradle.properties into temp files for drift checks.
  • Add bump-versions-pr.sh to 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_branch is empty (after switching to symbolic-ref) and the current restore block would attempt git 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

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.

2 participants