@thegpvc/gp-foundry 0.2.16 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ # pr-scope
2
+
3
+ The guard a PR lane runs first. It answers, for one pull request:
4
+
5
+ - **in scope?** — does the pipeline look at this PR at all (the rollout dial);
6
+ - **agent-written?** — may a lane that *writes* act on it.
7
+
8
+ Both come from `src/shared/scope.ts`, the same implementation the merge gate
9
+ uses, so a lane and the gate cannot disagree about a PR.
10
+
11
+ ## Scope, in order
12
+
13
+ 1. A draft is never in scope.
14
+ 2. A PR carrying the rollout's skip label is never in scope.
15
+ 3. A PR opened by `bot-login` is always in scope.
16
+ 4. Another bot's PR is out, unless that bot is named in the rollout's `authors`.
17
+ 5. With no rollout — or one naming neither authors nor an opt-in label — every
18
+ remaining PR is in scope.
19
+ 6. Otherwise: a listed author, or the opt-in label.
20
+
21
+ ## Agent-written
22
+
23
+ Opened by `bot-login`, and every commit on the head attributed to it. One commit
24
+ by anyone else, or one GitHub cannot attribute to an account, makes the PR
25
+ human-written. Asked only with `require-agent-written: true` (lanes that push or
26
+ merge).
27
+
28
+ ## Failing closed
29
+
30
+ A PR that cannot be read gives `run: false` with a warning, not a red job. A
31
+ malformed `rollout` input fails the step.
32
+
33
+ ## Inputs / outputs
34
+
35
+ See `action.yml`. `run` is the one output a workflow needs: `true` when the lane
36
+ should run.
@@ -0,0 +1,76 @@
1
+ name: "pr-scope"
2
+ description: >-
3
+ Decide whether the pipeline looks at a pull request, and whether it wrote it.
4
+ One implementation of the scope rule (the rollout dial) and the agent-written
5
+ test, shared by every lane's guard so a lane and the gate cannot disagree.
6
+
7
+ inputs:
8
+ number:
9
+ description: "The pull request number. Required unless `list` is true."
10
+ required: false
11
+ default: ""
12
+ list:
13
+ description: >-
14
+ "true": instead of judging one PR, list every open PR on `base-branch`
15
+ that is in scope, oldest first, as the `prs` output. For a sweep's select
16
+ job. One retry on a failed listing; if it still fails, `listed` is "false"
17
+ and `prs` is "[]" — the step does not fail, since nothing is wrong with
18
+ the repo.
19
+ required: false
20
+ default: "false"
21
+ base-branch:
22
+ description: "With `list`: only PRs targeting this branch."
23
+ required: false
24
+ default: ""
25
+ token:
26
+ description: "Token used to read the pull request and its commits (pull-requests: read)."
27
+ required: true
28
+ rollout:
29
+ description: >-
30
+ The rollout dial as JSON ({"authors":[...],"optInLabel":"...","skipLabel":"..."}),
31
+ written by the compiler from foundry.config.yaml. Empty means every PR is
32
+ in scope. Drafts and other bots' PRs never are; PRs opened by bot-login
33
+ always are.
34
+ required: false
35
+ default: ""
36
+ bot-login:
37
+ description: "The harness bot's login: the author of the PRs the pipeline writes."
38
+ required: false
39
+ default: ""
40
+ branch-prefix:
41
+ description: >-
42
+ The harness's agent-branch prefix. Used only for a hint: a PR on such a
43
+ branch that is turned away because bot-login did not open it usually means
44
+ bot-login is not the account the pipeline actually posts as.
45
+ required: false
46
+ default: ""
47
+ require-agent-written:
48
+ description: >-
49
+ "true" for a lane that WRITES to the pull request (pushes commits, merges):
50
+ `run` is then true only for a PR the pipeline wrote — opened by bot-login,
51
+ every commit its own.
52
+ required: false
53
+ default: "false"
54
+
55
+ outputs:
56
+ in-scope:
57
+ description: '"true" when the pipeline looks at this PR.'
58
+ agent-written:
59
+ description: '"true" when the pipeline wrote this PR. Only computed with require-agent-written.'
60
+ run:
61
+ description: >-
62
+ "true" when the lane should run: in scope, and agent-written if that was
63
+ required. "false" on anything else, including a PR that could not be read.
64
+ reason:
65
+ description: "One line saying why."
66
+ prs:
67
+ description: >-
68
+ With `list`: a JSON array, oldest PR first, of {number, sha, base,
69
+ requested, quiet} — head SHA, base ref, the number of pending review
70
+ requests, and seconds since the PR last changed.
71
+ listed:
72
+ description: 'With `list`: "true" when the open PRs could be listed, "false" when the API was unavailable.'
73
+
74
+ runs:
75
+ using: "node24"
76
+ main: "dist/index.cjs"