Skip to content

Commit aad6bb0

Browse files
rdimitrovclaude
andauthored
Address Dan's review feedback: shorter minimumReleaseAge + precise wording (#757)
* Address Dan's review feedback on #748 Two small follow-ups: 1. minimumReleaseAge: 24 hours -> 1 hour. Dan flagged that 24h is overcautious for first-party Stacklok releases. Renovate itself only runs every 4h so 1h is effectively close to 0 while still protecting against same-day yanks/reverts. 2. prBodyNotes: drop "regenerates" where we're actually just syncing. Now precisely: "syncs reference assets (CLI help, Swagger) and regenerates the CRD MDX pages" for toolhive. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Filter reviewers to repo collaborators only Previous behavior pulled every non-bot commit author from the upstream release range and passed them to `gh pr edit --add-reviewer` as a single comma-separated list. GitHub rejects reviewer requests for non-collaborators with 422, and because the API treats the list atomically, one community contributor in the range would fail the entire call and drop all valid reviewers with it. Fix: - Probe each candidate with `gh api repos/<repo>/collaborators/<user>` before adding. 204 -> keep; 404 -> skip. - Emit a separate `skipped` output listing non-collaborator contributors so the PR body can acknowledge them by name ("Other release contributors ... Thanks for the contribution!") without actually requesting review from them. Pre-existing bot-regex filter runs first so we don't waste API calls on [bot] users. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Drop non-collaborator acknowledgment from PR body Filtering out non-collaborator reviewers stays (prevents the 422 whole-call-failure). But mentioning them by name in the augmented PR body adds notification surface we don't want. Silently skip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 99fd4f8 commit aad6bb0

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/upstream-release-docs.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,19 +367,38 @@ jobs:
367367
REPO: ${{ steps.detect.outputs.repo }}
368368
PREV: ${{ steps.detect.outputs.prev_tag }}
369369
NEW: ${{ steps.detect.outputs.new_tag }}
370+
REVIEW_REPO: ${{ github.repository }}
370371
run: |
371-
# Capture stderr separately so we can surface a missing-compare
372-
# situation in the PR body rather than silently dropping reviewers.
372+
# Get non-bot commit authors in the release range.
373373
if COMPARE=$(gh api "repos/$REPO/compare/$PREV...$NEW" \
374374
--jq '[.commits[].author.login? // empty] | unique | .[]' 2>/dev/null); then
375-
REVIEWERS=$(echo "$COMPARE" |
376-
grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' |
377-
head -5 | paste -sd, -)
378375
echo "compare_ok=true" >> "$GITHUB_OUTPUT"
379376
else
380-
REVIEWERS=""
377+
COMPARE=""
381378
echo "compare_ok=false" >> "$GITHUB_OUTPUT"
382379
fi
380+
381+
# Filter out bot accounts, then further filter to only this
382+
# repo's collaborators. GitHub rejects reviewer requests for
383+
# non-collaborators with 422, which would fail the whole
384+
# `gh pr edit --add-reviewer` call and drop the valid
385+
# reviewers along with the invalid ones. Community
386+
# contributors from the upstream repo often aren't
387+
# collaborators here; silently skip them.
388+
CANDIDATES=$(echo "$COMPARE" |
389+
grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' || true)
390+
391+
REVIEWERS=""
392+
while IFS= read -r login; do
393+
[ -z "$login" ] && continue
394+
if gh api "repos/$REVIEW_REPO/collaborators/$login" --silent 2>/dev/null; then
395+
REVIEWERS="${REVIEWERS:+$REVIEWERS,}$login"
396+
fi
397+
done <<< "$CANDIDATES"
398+
399+
# Cap at 5 to avoid review fatigue.
400+
REVIEWERS=$(echo "$REVIEWERS" | tr ',' '\n' | head -5 | paste -sd, -)
401+
383402
echo "list=$REVIEWERS" >> "$GITHUB_OUTPUT"
384403
echo "Reviewers: ${REVIEWERS:-<none>}"
385404
@@ -603,7 +622,7 @@ jobs:
603622
echo "$GAPS_BLOCK"
604623
echo ""
605624
fi
606-
echo "Reviewers below are non-bot commit authors in the release range."
625+
echo "Reviewers below are non-bot commit authors in the release range who are also collaborators on this repo."
607626
echo ""
608627
echo "$END"
609628
} > /tmp/section.md

renovate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@
8888
"matchManagers": ["custom.regex"],
8989
"matchFileNames": ["**/.github/upstream-projects.yaml"],
9090
"schedule": ["at any time"],
91-
"minimumReleaseAge": "24 hours",
91+
"minimumReleaseAge": "1 hour",
9292
"minimumReleaseAgeBehaviour": "timestamp-optional",
9393
"ignoreUnstable": true,
9494
"rebaseWhen": "never",
9595
"recreateWhen": "never",
9696
"commitMessageTopic": "{{depName}}",
9797
"prBodyNotes": [
98-
"After this PR opens, `.github/workflows/upstream-release-docs.yml` adds source-verified content edits for the new release. For `stacklok/toolhive`, the same workflow also regenerates reference docs (CLI help, Swagger, CRD schemas)."
98+
"After this PR opens, `.github/workflows/upstream-release-docs.yml` adds source-verified content edits for the new release. For `stacklok/toolhive`, the same workflow also syncs reference assets (CLI help, Swagger) and regenerates the CRD MDX pages."
9999
]
100100
}
101101
]

0 commit comments

Comments
 (0)