Skip to content

Commit bf3fe81

Browse files
rdimitrovclaude
andcommitted
@-mention non-collaborator release contributors; widen toolhive docs paths
Two independent but related improvements to the upstream-release-docs pipeline: 1. Reviewer routing: @-mention contributors we can't auto-assign The existing reviewer-extract step batched all non-bot release commit authors and filtered to docs-website collaborators. On PR #759 that filter silently dropped four of five candidates (`reyortiz3`, `ChrisJBurns`, `jhroz`, `tgrunnag` are all upstream toolhive contributors but not collaborators on docs-website). The filter is mandatory because `gh pr edit --add-reviewer` returns 422 for any non-collaborator in the list, dropping the valid reviewers alongside the invalid ones. Now split the candidates: - ASSIGN_LIST (collaborators): batch-assigned as reviewers via `--add-reviewer`. Unchanged behavior. - MENTION_LIST (everyone else): @-mentioned in a new "Release contributors" section of the PR body so they see the PR documenting their work even though we can't request their review via the API. Detecting Stacklok employees directly (e.g. via the `stackers` team) requires a PAT with read:org scope -- `GITHUB_TOKEN` doesn't have it, and public-org-membership checks only see members with public membership. Deferred; noted in a comment. 2. Expand toolhive docs_paths hints The `toolhive` upstream is a monorepo shipping the CLI, the Kubernetes operator, and the vMCP gateway, plus cross-cutting features that land in concepts/, integrations/, tutorials/, and hand-written reference pages. The previous hints listed only the three guides-* folders. In practice the skill's Phase 3 impact map expanded beyond the hints (PR #759 touched concepts/, integrations/, tutorials/), so this is a focus improvement rather than a bug fix -- more accurate hints let Phase 2's source reading home in on the right areas without re-scanning unrelated docs. Other projects' hints are already accurate for their scope. toolhive-cloud-ui intentionally keeps docs_paths: [] -- no associated docs in this repo yet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a661dc0 commit bf3fe81

2 files changed

Lines changed: 67 additions & 15 deletions

File tree

.github/upstream-projects.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,21 @@ projects:
3636
- id: toolhive
3737
repo: stacklok/toolhive
3838
version: v0.23.1
39+
# toolhive is a monorepo covering the CLI, the Kubernetes
40+
# operator, and the vMCP gateway. It also introduces cross-
41+
# cutting features that land in concepts/, integrations/,
42+
# tutorials/, and hand-written reference pages. These entries
43+
# are hints, not constraints -- the skill's Phase 3 impact map
44+
# decides what actually changes. Hints focus Phase 2's source
45+
# reading so the skill doesn't re-scan unrelated areas.
3946
docs_paths:
4047
- docs/toolhive/guides-cli
4148
- docs/toolhive/guides-k8s
4249
- docs/toolhive/guides-vmcp
50+
- docs/toolhive/concepts
51+
- docs/toolhive/integrations
52+
- docs/toolhive/tutorials
53+
- docs/toolhive/reference/authz-policy-reference.mdx
4354
assets:
4455
- release_asset: swagger.yaml
4556
destination: static/api-specs/toolhive-api.yaml

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

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ jobs:
391391
id: pre_skill
392392
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
393393

394-
- name: Extract reviewers from release compare
394+
- name: Extract reviewers and contributors from release compare
395395
id: reviewers
396396
env:
397397
REPO: ${{ steps.detect.outputs.repo }}
@@ -408,29 +408,54 @@ jobs:
408408
echo "compare_ok=false" >> "$GITHUB_OUTPUT"
409409
fi
410410
411-
# Filter out bot accounts, then further filter to only this
412-
# repo's collaborators. GitHub rejects reviewer requests for
413-
# non-collaborators with 422, which would fail the whole
414-
# `gh pr edit --add-reviewer` call and drop the valid
415-
# reviewers along with the invalid ones. Community
416-
# contributors from the upstream repo often aren't
417-
# collaborators here; silently skip them.
411+
# Filter out bot accounts.
418412
CANDIDATES=$(echo "$COMPARE" |
419413
grep -Ev '(\[bot\]$|^github-actions|^stacklokbot$|^dependabot|^renovate|^copilot)' || true)
420414
421-
REVIEWERS=""
415+
# Split candidates into two groups:
416+
# - ASSIGN_LIST: collaborators on this repo -- safe to pass
417+
# to `gh pr edit --add-reviewer`. GitHub rejects the
418+
# entire call with 422 if any name in the list isn't a
419+
# collaborator, so the filter is mandatory to avoid
420+
# dropping valid reviewers alongside invalid ones.
421+
# - MENTION_LIST: everyone else. Upstream contributors
422+
# (often Stacklok employees with private org membership
423+
# we can't detect via GITHUB_TOKEN, which lacks
424+
# read:org) still deserve a ping so they see the PR
425+
# documenting their work. @-mentioning in the PR body
426+
# handles that without needing reviewer-assignment
427+
# rights.
428+
# Future: a PAT with read:org could let us also check
429+
# membership in the `stackers` team and promote those to
430+
# ASSIGN_LIST. Deferred -- not wiring a secret in now.
431+
ASSIGN_LIST=""
432+
MENTION_LIST=""
422433
while IFS= read -r login; do
423434
[ -z "$login" ] && continue
424435
if gh api "repos/$REVIEW_REPO/collaborators/$login" --silent 2>/dev/null; then
425-
REVIEWERS="${REVIEWERS:+$REVIEWERS,}$login"
436+
ASSIGN_LIST="${ASSIGN_LIST:+$ASSIGN_LIST,}$login"
437+
else
438+
MENTION_LIST="${MENTION_LIST:+$MENTION_LIST }@$login"
426439
fi
427440
done <<< "$CANDIDATES"
428441
429-
# Cap at 5 to avoid review fatigue.
430-
REVIEWERS=$(echo "$REVIEWERS" | tr ',' '\n' | head -5 | paste -sd, -)
442+
# Cap auto-assignments at 5 to avoid review fatigue. Mentions
443+
# aren't capped -- they're cheap and the block is a single
444+
# PR-body notification.
445+
ASSIGN_LIST=$(echo "$ASSIGN_LIST" | tr ',' '\n' | head -5 | paste -sd, -)
431446
432-
echo "list=$REVIEWERS" >> "$GITHUB_OUTPUT"
433-
echo "Reviewers: ${REVIEWERS:-<none>}"
447+
echo "list=$ASSIGN_LIST" >> "$GITHUB_OUTPUT"
448+
{
449+
echo "mention_block<<MENTION_EOF"
450+
if [ -n "$MENTION_LIST" ]; then
451+
echo "Release contributors who aren't collaborators on this repo and so couldn't be auto-assigned as reviewers. Mentioning them so they see the PR documenting their work:"
452+
echo ""
453+
echo "$MENTION_LIST"
454+
fi
455+
echo "MENTION_EOF"
456+
} >> "$GITHUB_OUTPUT"
457+
echo "Auto-assigned: ${ASSIGN_LIST:-<none>}"
458+
echo "Mentioned: ${MENTION_LIST:-<none>}"
434459
435460
- name: Read docs_paths hint
436461
id: hints
@@ -797,6 +822,8 @@ jobs:
797822
GAPS_BLOCK: ${{ steps.signals.outputs.gaps_block }}
798823
AUTOGEN_NOTE: ${{ steps.autogen.outputs.note }}
799824
COMPARE_OK: ${{ steps.reviewers.outputs.compare_ok }}
825+
MENTION_BLOCK: ${{ steps.reviewers.outputs.mention_block }}
826+
ASSIGN_LIST: ${{ steps.reviewers.outputs.list }}
800827
run: |
801828
START='<!-- upstream-release-docs:start -->'
802829
END='<!-- upstream-release-docs:end -->'
@@ -830,8 +857,22 @@ jobs:
830857
echo "$GAPS_BLOCK"
831858
echo ""
832859
fi
833-
echo "Reviewers below are non-bot commit authors in the release range who are also collaborators on this repo."
860+
echo "### Release contributors"
834861
echo ""
862+
if [ -n "$ASSIGN_LIST" ]; then
863+
# Comma list -> @-mention list for rendering.
864+
ASSIGNED_MENTIONS=$(echo "$ASSIGN_LIST" | tr ',' '\n' | sed 's/^/@/' | paste -sd' ' -)
865+
echo "Auto-assigned as reviewers (collaborators on this repo): $ASSIGNED_MENTIONS"
866+
echo ""
867+
fi
868+
if [ -n "$MENTION_BLOCK" ]; then
869+
echo "$MENTION_BLOCK"
870+
echo ""
871+
fi
872+
if [ -z "$ASSIGN_LIST" ] && [ -z "$MENTION_BLOCK" ]; then
873+
echo "No non-bot contributors were found in the release range."
874+
echo ""
875+
fi
835876
echo "$END"
836877
} > /tmp/section.md
837878

0 commit comments

Comments
 (0)