Require manual reviewer assignment
What changed, and why it matters
This commit changes the project's internal code-review workflow. It stops automatically assigning a human reviewer when a pull request is opened; instead, contributors must manually click a button to request a reviewer after first addressing an AI review. It also limits who can request extra reviewers. There is no change to the actual Lightning node software, cryptography, network protocol, or any user-facing security behavior.
No security action required. This is a process/policy change for reviewer assignment. Reviewers may optionally verify the workflow actor-check logic works as intended, but the change is defensive and does not introduce a vulnerability.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies .forgejo/workflows/assign-reviewer.yml and CONTRIBUTING.md. It removes the pull_request_target trigger that automatically ran on newly opened PRs, leaving only workflow_dispatch (manual trigger). It adds a check so only members of the REVIEWERS pool can request an additional reviewer, while outside contributors can only request the first reviewer. The workflow still only makes API calls and never checks out or executes PR code. CONTRIBUTING.md is updated to tell contributors to wait for AI review and use the ‘Assign random reviewer’ button, and to clarify that one human reviewer is the default.
Changed components
.forgejo/workflows/assign-reviewer.ymlCONTRIBUTING.mdInspect captured patch +21 / −23
diff --git a/.forgejo/workflows/assign-reviewer.yml b/.forgejo/workflows/assign-reviewer.yml
index 2e1ffb7..b8fd938 100644
--- a/.forgejo/workflows/assign-reviewer.yml
+++ b/.forgejo/workflows/assign-reviewer.yml
@@ -1,21 +1,18 @@
name: Assign a random reviewer
# Forgejo has no built-in random/round-robin reviewer assignment (only
-# path-based CODEOWNERS), so pick a random developer for each newly opened
-# pull request and request their review via the API.
+# path-based CODEOWNERS), so this workflow picks a random developer on manual
+# request.
#
-# Runs automatically when a PR is opened, and can also be run manually
-# (workflow_dispatch) against any PR number to pick an additional reviewer.
+# Runs through workflow_dispatch against any PR number to pick the first or an
+# additional reviewer. Forgejo's contributor-facing "Assign random reviewer"
+# button dispatches this workflow for contributors without workflow access.
# * Someone already requested as a reviewer, or who has already submitted a
# review, is never picked.
-# * On automatic runs (including re-runs), nothing is done at all if anyone
-# from the REVIEWERS pool has already reviewed or been requested (reviews
-# from people outside the pool don't count). Manual runs skip this check
-# and always add a reviewer if an eligible candidate remains.
+# * Contributors outside the reviewer pool can request only the first
+# reviewer. Pool members can request additional reviewers.
on:
- pull_request_target:
- types: [opened]
workflow_dispatch:
inputs:
pr:
@@ -39,13 +36,11 @@ jobs:
echo "jwt=$jwt" >> "$FORGEJO_OUTPUT"
- name: Request review from a random developer
# This never checks out or runs any PR code -- it only makes API
- # calls -- so running in the base-repo context (pull_request_target,
- # which is what grants the token write access even for fork PRs) is safe.
+ # calls, so running in the base-repo context is safe.
env:
API: ${{ github.server_url }}/api/v1
REPO: ${{ github.repository }}
- EVENT_NAME: ${{ github.event_name }}
- EVENT_PR: ${{ github.event.pull_request.number }}
+ ACTOR: ${{ github.actor }}
INPUT_PR: ${{ github.event.inputs.pr }}
# Space-separated pool of candidate reviewers.
REVIEWERS: "matt val wpaulino joostjager jkczyz benthecarman tankyleo tnull"
@@ -53,11 +48,7 @@ jobs:
set -eu
AUTH="Authorization: bearer ${{ steps.jwt.outputs.jwt }}"
- if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
- PR="$INPUT_PR"
- else
- PR="$EVENT_PR"
- fi
+ PR="$INPUT_PR"
case "$PR" in
''|*[!0-9]*) echo "Invalid PR number: '$PR'"; exit 1 ;;
esac
@@ -87,12 +78,11 @@ jobs:
INVOLVED="$(printf '%s\n%s\n' "$REQUESTED" "$REVIEWED" |
awk -v author="$AUTHOR" '$0 != "" && $0 != author' | sort -u)"
- # On automatic runs, if a pool member is already on the PR there is
- # nothing to do. Manual runs go ahead and add another reviewer.
- if [ "$EVENT_NAME" != "workflow_dispatch" ]; then
+ # Only pool members may request an additional reviewer.
+ if ! printf '%s\n' $REVIEWERS | grep -qxF "$ACTOR"; then
for d in $REVIEWERS; do
if printf '%s\n' "$INVOLVED" | grep -qxF "$d"; then
- echo "$d has already reviewed or been requested on PR #$PR; nothing to do."
+ echo "$d is already on PR #$PR; only pool members may request another reviewer."
exit 0
fi
done
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ad25fb1..cf7dd6a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -116,6 +116,14 @@ test out the patch set and opine on the technical merits of the patch. PR should
be reviewed first on the conceptual level before focusing on code style or
grammar fixes.
+Before requesting human review, wait for AI to complete its initial review
+and address its feedback. Once the pull request is ready, use the "Assign random
+reviewer" button in Forgejo.
+
+Most pull requests require one human reviewer. The primary reviewer may request
+a second reviewer for complex changes, such as changes to the channel state
+machine, or when there is design uncertainty.
+
Coding Conventions
------------------
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.