diff --git a/.github/workflows/upstream-release-docs.yml b/.github/workflows/upstream-release-docs.yml index 8e21ad4e..0a4b99e9 100644 --- a/.github/workflows/upstream-release-docs.yml +++ b/.github/workflows/upstream-release-docs.yml @@ -367,19 +367,38 @@ jobs: REPO: ${{ steps.detect.outputs.repo }} PREV: ${{ steps.detect.outputs.prev_tag }} NEW: ${{ steps.detect.outputs.new_tag }} + REVIEW_REPO: ${{ github.repository }} run: | - # Capture stderr separately so we can surface a missing-compare - # situation in the PR body rather than silently dropping reviewers. + # Get non-bot commit authors in the release range. if COMPARE=$(gh api "repos/$REPO/compare/$PREV...$NEW" \ --jq '[.commits[].author.login? // empty] | unique | .[]' 2>/dev/null); then - REVIEWERS=$(echo "$COMPARE" | - grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' | - head -5 | paste -sd, -) echo "compare_ok=true" >> "$GITHUB_OUTPUT" else - REVIEWERS="" + COMPARE="" echo "compare_ok=false" >> "$GITHUB_OUTPUT" fi + + # Filter out bot accounts, then further filter to only this + # repo's collaborators. GitHub rejects reviewer requests for + # non-collaborators with 422, which would fail the whole + # `gh pr edit --add-reviewer` call and drop the valid + # reviewers along with the invalid ones. Community + # contributors from the upstream repo often aren't + # collaborators here; silently skip them. + CANDIDATES=$(echo "$COMPARE" | + grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' || true) + + REVIEWERS="" + while IFS= read -r login; do + [ -z "$login" ] && continue + if gh api "repos/$REVIEW_REPO/collaborators/$login" --silent 2>/dev/null; then + REVIEWERS="${REVIEWERS:+$REVIEWERS,}$login" + fi + done <<< "$CANDIDATES" + + # Cap at 5 to avoid review fatigue. + REVIEWERS=$(echo "$REVIEWERS" | tr ',' '\n' | head -5 | paste -sd, -) + echo "list=$REVIEWERS" >> "$GITHUB_OUTPUT" echo "Reviewers: ${REVIEWERS:-}" @@ -603,7 +622,7 @@ jobs: echo "$GAPS_BLOCK" echo "" fi - echo "Reviewers below are non-bot commit authors in the release range." + echo "Reviewers below are non-bot commit authors in the release range who are also collaborators on this repo." echo "" echo "$END" } > /tmp/section.md diff --git a/renovate.json b/renovate.json index 5ea18e23..6f8fcb4d 100644 --- a/renovate.json +++ b/renovate.json @@ -88,14 +88,14 @@ "matchManagers": ["custom.regex"], "matchFileNames": ["**/.github/upstream-projects.yaml"], "schedule": ["at any time"], - "minimumReleaseAge": "24 hours", + "minimumReleaseAge": "1 hour", "minimumReleaseAgeBehaviour": "timestamp-optional", "ignoreUnstable": true, "rebaseWhen": "never", "recreateWhen": "never", "commitMessageTopic": "{{depName}}", "prBodyNotes": [ - "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)." + "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." ] } ]