@plainconceptsplatform/workflows 1.5.0 → 1.6.0
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.
- package/dist/index.js +0 -0
- package/dist/route-processing.js +9 -2
- package/dist/workflow-catalog.js +1 -1
- package/loops/actions/apply-agent-output/action.yml +5 -0
- package/loops/actions/classify-route/classify-route.sh +34 -13
- package/loops/actions/identify-gate-subject/action.yml +50 -7
- package/loops/actions/merge-train/action.yml +66 -0
- package/loops/actions/merge-train/merge-train.sh +424 -0
- package/loops/actions/push-agent-branch/action.yml +60 -45
- package/loops/actions/verify-route-matrix/verify-route-matrix.sh +124 -80
- package/loops/docs/diagrams.md +55 -13
- package/loops/templates/ci/app-ci-dotnet-next.yml +13 -14
- package/loops/templates/ci/app-ci-node-monorepo.yml +13 -14
- package/loops/workflows/agent-merge-gate.md +75 -57
- package/loops/workflows/work-router.yml +231 -464
- package/package.json +8 -9
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Managed by @plainconceptsplatform/workflows. Source: loops/workflows/agent-merge-gate.md. Update with `workflows update --force`; consumer edits may be overwritten.
|
|
3
3
|
env:
|
|
4
4
|
VERIFY_COMMANDS: ""
|
|
5
|
-
REPO_RULES: "Review the selected
|
|
5
|
+
REPO_RULES: "Review the selected pull request for defects and report what you verified. Do not decide the outcome: the workflow computes it from your report and from facts it measured before you ran."
|
|
6
6
|
# Where to look first, not what to escalate on. This list used to be the check that decided
|
|
7
7
|
# whether a machine merged without a human, and it decided by category: the prompt told the
|
|
8
8
|
# agent that a match "is not a defect, it is a reason this pull request needs a person". In a
|
|
@@ -13,34 +13,35 @@ env:
|
|
|
13
13
|
# One line: gh-aw joins a multi-line env value onto a single line when it compiles the lock.
|
|
14
14
|
RISK_INDICATORS: "Any diff touching authentication, authorization or session handling. Any change to a calculation or pricing engine, or to code handling money. Any database migration, or a change to an entity or schema. Any change to an audit or event log, or anything that could break its continuity. Any change to a public API contract or a shared library other repositories consume."
|
|
15
15
|
# Paths a bot may change but never merge on its own: an extended regular expression matched
|
|
16
|
-
# against every changed path in the pull request.
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
|
|
16
|
+
# against every changed path in the pull request. A match holds the merge for a human; it does
|
|
17
|
+
# not stop the agent repairing failed CI on the same files.
|
|
18
|
+
#
|
|
19
|
+
# Only the automation itself. This list used to hold every dependency manifest, lockfile and
|
|
20
|
+
# dotted directory as well, and with a size threshold and an owner list as wide it parked most
|
|
21
|
+
# of a night's pull requests for a person who then merged them by hand, unread, on Monday:
|
|
22
|
+
# in Pliny-Bot 32 of 40 bot pull requests in two days. What stops a merge now is what is
|
|
23
|
+
# genuinely dangerous to merge unseen: the workflows, the secrets, and a change too big to
|
|
24
|
+
# review in one pass.
|
|
25
|
+
PROTECTED_PATHS: '^\.github/'
|
|
22
26
|
# Paths whose change needs the person who owns them. A match forces OWNER REVIEW REQUIRED and
|
|
23
27
|
# sets blast radius high on its own, whatever the diff's size. CODEOWNERS names who is asked
|
|
24
|
-
# when the repository has that file; it is never a prerequisite
|
|
25
|
-
# one must still be able to protect its auth and its infrastructure.
|
|
28
|
+
# when the repository has that file; it is never a prerequisite.
|
|
26
29
|
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
|
|
31
|
-
# this one catches exactly three and they are the three that deserved an owner (a database
|
|
32
|
-
# migration, a change to the platform role definitions, and a downstream token service).
|
|
33
|
-
OWNER_PATHS: '(^|/)([Aa]uth|[Aa]uthn|[Aa]uthz|[Aa]uthentication|[Aa]uthorization|[Ii]dentity|[Ss]ecurity|[Ss]ecrets?|[Mm]igrations|[Ii]nfra|terraform|helm|k8s|deploy)(/|[A-Z][A-Za-z]*\.[a-z]+$)'
|
|
30
|
+
# Secrets: a `secrets` directory or file, an environment file, a key or a certificate. Code
|
|
31
|
+
# that handles secrets (a SecretMasker.cs) is not a secret; the review pass reads it like any
|
|
32
|
+
# other change.
|
|
33
|
+
OWNER_PATHS: '(^|/)([Ss]ecrets?(/|\.[A-Za-z0-9]+$)|\.env(\.[A-Za-z0-9_-]+)?$|[^/]+\.(pem|pfx|p12|key)$)'
|
|
34
34
|
# Paths worth a second look that do not, alone, need a person. A match raises the floor to
|
|
35
35
|
# medium, and medium with acceptable recoverability still auto-merges. This is the line that
|
|
36
|
-
# separates "look here" from "stop here",
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
# separates "look here" from "stop here". Auth, identity, security, migrations and
|
|
37
|
+
# infrastructure used to stop a merge from here; they are the review pass's to look at now, and
|
|
38
|
+
# a migration that rewrites data still parks through a `low` recoverability the agent evidences.
|
|
39
|
+
SENSITIVE_PATHS: '(^|/)([Dd]omain|entities|[Cc]ontracts)/|(^|/)([Aa]uth|[Aa]uthn|[Aa]uthz|[Aa]uthentication|[Aa]uthorization|[Ii]dentity|[Ss]ecurity|[Mm]igrations|[Ii]nfra|terraform|helm|k8s|deploy)(/|[A-Z][A-Za-z]*\.[a-z]+$)'
|
|
40
|
+
# Diff shape. Lines decide high: a change over a thousand counted lines (tests, docs,
|
|
41
|
+
# translations and generated code excluded) is too big to merge unseen. A file count alone
|
|
42
|
+
# never does, so the high file threshold is set out of reach; spread still raises medium.
|
|
43
|
+
BLAST_HIGH_FILES: "100000"
|
|
44
|
+
BLAST_HIGH_LINES: "1000"
|
|
44
45
|
BLAST_MEDIUM_FILES: "5"
|
|
45
46
|
BLAST_MEDIUM_LINES: "200"
|
|
46
47
|
# Paths that change no runtime behaviour: tests, docs, specs, translations and generated
|
|
@@ -80,14 +81,18 @@ env:
|
|
|
80
81
|
PARK_AT_UNUSABLE_OUTPUT: "2"
|
|
81
82
|
ISSUE_CONTEXT_PATH: /tmp/gh-aw/agent/issue-context.json
|
|
82
83
|
GH_AW_ALLOWED_BOTS: "platform-devbox[bot],github-actions[bot]"
|
|
84
|
+
# The bots whose pull requests the gate takes, in every spelling GitHub uses for one account.
|
|
85
|
+
# Any other author needs write access to the repository, as they would to push the branch.
|
|
86
|
+
TRUSTED_BOTS: "github-actions[bot] app/github-actions platform-devbox[bot]"
|
|
83
87
|
GIT_AUTHOR_NAME: "github-actions[bot]"
|
|
84
88
|
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
85
89
|
GIT_COMMITTER_NAME: "github-actions[bot]"
|
|
86
90
|
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
87
91
|
description: |
|
|
88
|
-
Decides what happens to a
|
|
89
|
-
risk assessment is clean, hand to a human when it is
|
|
90
|
-
|
|
92
|
+
Decides what happens to a pull request once CI has reported, whether the bot or a person with
|
|
93
|
+
write access opened it: merge when the risk assessment is clean, hand to a human when it is
|
|
94
|
+
genuinely dangerous, fix CI or a conflict when there is one. Called by the Work Router, one
|
|
95
|
+
pull request at a time by its merge train; does not trigger on public events.
|
|
91
96
|
|
|
92
97
|
In a stack, a child pull request (its base is the feature branch) merges into that feature
|
|
93
98
|
branch and its child issue closes with it; the root pull request is held for a person. The
|
|
@@ -154,6 +159,10 @@ jobs:
|
|
|
154
159
|
found: ${{ steps.subject.outputs.found }}
|
|
155
160
|
pr: ${{ steps.subject.outputs.pr }}
|
|
156
161
|
issue: ${{ steps.subject.outputs.issue }}
|
|
162
|
+
# Where verdicts, attempts and labels go: the issue, or the pull request when it closes none.
|
|
163
|
+
record: ${{ steps.subject.outputs.record }}
|
|
164
|
+
head_ref: ${{ steps.subject.outputs.head-ref }}
|
|
165
|
+
closes: ${{ steps.subject.outputs.closes }}
|
|
157
166
|
conclusion: ${{ steps.subject.outputs.conclusion }}
|
|
158
167
|
run-id: ${{ steps.subject.outputs.run-id }}
|
|
159
168
|
review_blocked: ${{ steps.review.outputs.review_blocked }}
|
|
@@ -174,6 +183,7 @@ jobs:
|
|
|
174
183
|
ci-run-id: ${{ inputs.ci-run-id }}
|
|
175
184
|
linked-issue: ${{ inputs.linked-issue }}
|
|
176
185
|
require-label: ${{ env.IMPLEMENT_LABEL }}
|
|
186
|
+
trusted-bots: ${{ env.TRUSTED_BOTS }}
|
|
177
187
|
- name: Block a pull request with requested changes
|
|
178
188
|
id: review
|
|
179
189
|
env:
|
|
@@ -354,14 +364,14 @@ jobs:
|
|
|
354
364
|
uses: ./.github/actions/remove-issue-labels
|
|
355
365
|
with:
|
|
356
366
|
token: ${{ steps.app-token.outputs.token }}
|
|
357
|
-
issue-number: ${{ needs.subject.outputs.
|
|
367
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
358
368
|
labels: ${{ env.WORKING_LABEL }}
|
|
359
369
|
- name: Flag owner review
|
|
360
370
|
if: needs.protected_changes.outputs.holds_review == 'true'
|
|
361
371
|
uses: ./.github/actions/add-issue-labels
|
|
362
372
|
with:
|
|
363
373
|
token: ${{ steps.app-token.outputs.token }}
|
|
364
|
-
issue-number: ${{ needs.subject.outputs.
|
|
374
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
365
375
|
labels: |-
|
|
366
376
|
${{ env.REVIEW_LABEL }}
|
|
367
377
|
${{ env.OWNER_REVIEW_LABEL }}
|
|
@@ -370,7 +380,7 @@ jobs:
|
|
|
370
380
|
uses: ./.github/actions/create-issue-comment
|
|
371
381
|
with:
|
|
372
382
|
token: ${{ steps.app-token.outputs.token }}
|
|
373
|
-
issue-number: ${{ needs.subject.outputs.
|
|
383
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
374
384
|
body: |
|
|
375
385
|
${{ env.GATE_MARKER }}
|
|
376
386
|
PR #${{ needs.subject.outputs.pr }} changes protected files and cannot be auto-merged.
|
|
@@ -439,7 +449,7 @@ jobs:
|
|
|
439
449
|
uses: ./.github/actions/create-issue-comment
|
|
440
450
|
with:
|
|
441
451
|
token: ${{ steps.app-token.outputs.token }}
|
|
442
|
-
issue-number: ${{ needs.subject.outputs.
|
|
452
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
443
453
|
body: |
|
|
444
454
|
Problems found in PR #${{ needs.subject.outputs.pr }}. ${{ steps.conflicts.outputs.has_conflicts == 'true' && 'Merge conflicts detected.' || 'CI failed.' }}
|
|
445
455
|
Bot is working on fixing it.
|
|
@@ -473,7 +483,7 @@ jobs:
|
|
|
473
483
|
uses: ./.github/actions/validate-merge-gate-output
|
|
474
484
|
with:
|
|
475
485
|
output-file: ${{ steps.output.outputs.output-file }}
|
|
476
|
-
issue-number: ${{ needs.subject.outputs.
|
|
486
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
477
487
|
ci-conclusion: ${{ needs.subject.outputs.conclusion }}
|
|
478
488
|
blast-level: ${{ needs.protected_changes.outputs.level }}
|
|
479
489
|
protected-hit: ${{ needs.protected_changes.outputs.requires_review }}
|
|
@@ -511,18 +521,23 @@ jobs:
|
|
|
511
521
|
token: ${{ steps.app-token.outputs.token }}
|
|
512
522
|
fetch-depth: 0
|
|
513
523
|
- name: Verify pull request closes the source issue
|
|
524
|
+
if: needs.subject.outputs.issue != ''
|
|
514
525
|
continue-on-error: true
|
|
515
526
|
uses: ./.github/actions/link-pr-to-issue
|
|
516
527
|
with:
|
|
517
528
|
token: ${{ steps.app-token.outputs.token }}
|
|
518
529
|
pr-number: ${{ needs.subject.outputs.pr }}
|
|
519
530
|
issue-number: ${{ needs.subject.outputs.issue }}
|
|
531
|
+
# The push goes to this pull request's branch or nowhere. A `[bot] ` title prefix used to be
|
|
532
|
+
# the guard, which a person's pull request does not carry; the branch the subject job read
|
|
533
|
+
# is the exact one, whoever opened it.
|
|
520
534
|
- name: Apply agent output
|
|
521
535
|
uses: ./.github/actions/apply-agent-output
|
|
522
536
|
with:
|
|
523
537
|
artifact-name: ${{ needs.activation.outputs.artifact_prefix }}agent
|
|
524
538
|
token: ${{ steps.app-token.outputs.token }}
|
|
525
539
|
push-to-branch: 'true'
|
|
540
|
+
expected-branch: ${{ needs.subject.outputs.head_ref }}
|
|
526
541
|
apply-labels: 'false'
|
|
527
542
|
# GITHUB_TOKEN on purpose: an App-token comment on a pull request is an issue_comment
|
|
528
543
|
# event, and GITHUB_TOKEN raises none. The full assessment lives on the issue, where the
|
|
@@ -558,7 +573,7 @@ jobs:
|
|
|
558
573
|
${{ needs.protected_changes.outputs.signals }}
|
|
559
574
|
```
|
|
560
575
|
|
|
561
|
-
Findings and verification on the linked issue:
|
|
576
|
+
${{ needs.subject.outputs.issue != '' && format('Findings and verification on the linked issue: #{0}.', needs.subject.outputs.issue) || 'Findings and verification are in the review comment above.' }} [View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
562
577
|
${{ env.EVIDENCE_BEFORE_REVIEW == 'true' && contains(fromJson('["human-review","owner-review"]'), needs.validate_output.outputs.outcome) && 'Screenshots of this head follow in their own comment if it carries a verification plan. Approving the pull request merges it.' || '' }}
|
|
563
578
|
- name: Merge approved pull request
|
|
564
579
|
if: needs.validate_output.outputs.outcome == 'auto-merge' && needs.subject.outputs.stack_root != 'true'
|
|
@@ -579,7 +594,7 @@ jobs:
|
|
|
579
594
|
uses: ./.github/actions/create-issue-comment
|
|
580
595
|
with:
|
|
581
596
|
token: ${{ steps.app-token.outputs.token }}
|
|
582
|
-
issue-number: ${{ needs.subject.outputs.
|
|
597
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
583
598
|
body: |
|
|
584
599
|
**Stack root held.** This pull request is the root of a stack: its children merge
|
|
585
600
|
into the feature branch, and it merges into ${{ github.event.repository.default_branch }} only when a person
|
|
@@ -589,7 +604,7 @@ jobs:
|
|
|
589
604
|
uses: ./.github/actions/remove-issue-labels
|
|
590
605
|
with:
|
|
591
606
|
token: ${{ steps.app-token.outputs.token }}
|
|
592
|
-
issue-number: ${{ needs.subject.outputs.
|
|
607
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
593
608
|
labels: ${{ env.WORKING_LABEL }}
|
|
594
609
|
# `review` goes on for all three parked dispositions, so every board query and every
|
|
595
610
|
# authorize-bot-work handoff that already reads it keeps working. The second label is what
|
|
@@ -599,7 +614,7 @@ jobs:
|
|
|
599
614
|
uses: ./.github/actions/add-issue-labels
|
|
600
615
|
with:
|
|
601
616
|
token: ${{ steps.app-token.outputs.token }}
|
|
602
|
-
issue-number: ${{ needs.subject.outputs.
|
|
617
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
603
618
|
labels: |-
|
|
604
619
|
${{ env.REVIEW_LABEL }}
|
|
605
620
|
${{ needs.validate_output.outputs.outcome == 'owner-review' && env.OWNER_REVIEW_LABEL || '' }}
|
|
@@ -631,7 +646,7 @@ jobs:
|
|
|
631
646
|
uses: ./.github/actions/remove-issue-labels
|
|
632
647
|
with:
|
|
633
648
|
token: ${{ steps.app-token.outputs.token }}
|
|
634
|
-
issue-number: ${{ needs.subject.outputs.
|
|
649
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
635
650
|
labels: ${{ env.WORKING_LABEL }}
|
|
636
651
|
# GitHub's closing keywords never fire when a PR merges into a branch other than the
|
|
637
652
|
# default, so a child PR landing on the feature branch leaves its issue open — and
|
|
@@ -641,7 +656,7 @@ jobs:
|
|
|
641
656
|
# and `gh issue close` on an already-closed issue is a harmless no-op, making the
|
|
642
657
|
# step safe to re-run.
|
|
643
658
|
- name: Close the child issue when the pull request landed on a feature branch
|
|
644
|
-
if: needs.validate_output.outputs.outcome == 'auto-merge' && needs.subject.outputs.pr_base != '' && needs.subject.outputs.pr_base != github.event.repository.default_branch
|
|
659
|
+
if: needs.validate_output.outputs.outcome == 'auto-merge' && needs.subject.outputs.issue != '' && needs.subject.outputs.pr_base != '' && needs.subject.outputs.pr_base != github.event.repository.default_branch
|
|
645
660
|
env:
|
|
646
661
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
647
662
|
REPO: ${{ github.repository }}
|
|
@@ -668,7 +683,7 @@ jobs:
|
|
|
668
683
|
uses: ./.github/actions/remove-issue-labels
|
|
669
684
|
with:
|
|
670
685
|
token: ${{ steps.app-token.outputs.token }}
|
|
671
|
-
issue-number: ${{ needs.subject.outputs.
|
|
686
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
672
687
|
labels: |
|
|
673
688
|
${{ env.IMPLEMENT_LABEL }}
|
|
674
689
|
${{ env.WORKING_LABEL }}
|
|
@@ -745,18 +760,18 @@ jobs:
|
|
|
745
760
|
uses: ./.github/actions/create-issue-comment
|
|
746
761
|
with:
|
|
747
762
|
token: ${{ steps.app-token.outputs.token }}
|
|
748
|
-
issue-number: ${{ needs.subject.outputs.
|
|
763
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
749
764
|
body: |
|
|
750
765
|
${{ env.ATTEMPT_MARKER }}
|
|
751
766
|
Attempt ${{ inputs.attempts_so_far || '0' }} of ${{ env.MAX_ATTEMPTS }} on PR #${{ needs.subject.outputs.pr }} ended without an outcome.
|
|
752
|
-
This failure parks at ${{ steps.budget.outputs.threshold }}. The
|
|
767
|
+
This failure parks at ${{ steps.budget.outputs.threshold }}. The merge train will retry.
|
|
753
768
|
[View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
754
769
|
- name: Report the exhausted attempt budget
|
|
755
770
|
if: steps.budget.outputs.park == 'true' && steps.budget.outputs.kind == 'machine'
|
|
756
771
|
uses: ./.github/actions/create-issue-comment
|
|
757
772
|
with:
|
|
758
773
|
token: ${{ steps.app-token.outputs.token }}
|
|
759
|
-
issue-number: ${{ needs.subject.outputs.
|
|
774
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
760
775
|
body: |
|
|
761
776
|
${{ env.ATTEMPT_MARKER }}
|
|
762
777
|
Attempt ${{ inputs.attempts_so_far || '0' }} of ${{ steps.budget.outputs.threshold }} on PR #${{ needs.subject.outputs.pr }} ended without an outcome.
|
|
@@ -774,7 +789,7 @@ jobs:
|
|
|
774
789
|
uses: ./.github/actions/create-issue-comment
|
|
775
790
|
with:
|
|
776
791
|
token: ${{ steps.app-token.outputs.token }}
|
|
777
|
-
issue-number: ${{ needs.subject.outputs.
|
|
792
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
778
793
|
body: |
|
|
779
794
|
${{ env.GATE_MARKER }}
|
|
780
795
|
The agent finished on PR #${{ needs.subject.outputs.pr }} but its report could not be
|
|
@@ -794,7 +809,7 @@ jobs:
|
|
|
794
809
|
token: ${{ steps.app-token.outputs.token }}
|
|
795
810
|
issue-number: ${{ needs.subject.outputs.pr }}
|
|
796
811
|
body: |
|
|
797
|
-
The merge gate stopped on this pull request and handed it to a person (
|
|
812
|
+
The merge gate stopped on this pull request and handed it to a person${{ needs.subject.outputs.issue != '' && format(' (#{0})', needs.subject.outputs.issue) || '' }}.
|
|
798
813
|
${{ needs.validate_output.outputs.pushed == 'true' && 'The agent pushed a repair that was not applied because its report could not be read. The patch and bundle are in the `agent` artifact of the run below.' || '' }}
|
|
799
814
|
[View this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
800
815
|
- name: Label the pull request for review
|
|
@@ -812,7 +827,7 @@ jobs:
|
|
|
812
827
|
uses: ./.github/actions/add-issue-labels
|
|
813
828
|
with:
|
|
814
829
|
token: ${{ steps.app-token.outputs.token }}
|
|
815
|
-
issue-number: ${{ needs.subject.outputs.
|
|
830
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
816
831
|
labels: |-
|
|
817
832
|
${{ env.REVIEW_LABEL }}
|
|
818
833
|
${{ steps.budget.outputs.kind == 'machine' && env.STALLED_LABEL || '' }}
|
|
@@ -822,7 +837,7 @@ jobs:
|
|
|
822
837
|
uses: ./.github/actions/remove-issue-labels
|
|
823
838
|
with:
|
|
824
839
|
token: ${{ steps.app-token.outputs.token }}
|
|
825
|
-
issue-number: ${{ needs.subject.outputs.
|
|
840
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
826
841
|
labels: ${{ env.WORKING_LABEL }}
|
|
827
842
|
|
|
828
843
|
agent:
|
|
@@ -892,7 +907,7 @@ steps:
|
|
|
892
907
|
uses: ./.github/actions/load-issue-context
|
|
893
908
|
with:
|
|
894
909
|
token: ${{ github.token }}
|
|
895
|
-
issue-number: ${{ needs.subject.outputs.
|
|
910
|
+
issue-number: ${{ needs.subject.outputs.record }}
|
|
896
911
|
output-path: ${{ env.ISSUE_CONTEXT_PATH }}
|
|
897
912
|
- name: Fetch the diff and any failing job logs
|
|
898
913
|
env:
|
|
@@ -934,9 +949,10 @@ safe-outputs:
|
|
|
934
949
|
# target "*" because these workers are dispatched, not triggered by the pull request:
|
|
935
950
|
# the default "triggering" target has no pull request in context and rejects the push
|
|
936
951
|
# with "requires pull request context", so the agent's fix is computed and discarded.
|
|
952
|
+
# No title prefix: the gate repairs pull requests people opened as well, and conclude pushes
|
|
953
|
+
# only to the branch of the pull request the subject job validated.
|
|
937
954
|
push-to-pull-request-branch:
|
|
938
955
|
target: "*"
|
|
939
|
-
required-title-prefix: "[bot] "
|
|
940
956
|
max-patch-size: 10240
|
|
941
957
|
# A failed bot PR may already contain protected files. Permit a verified repair push,
|
|
942
958
|
# but protected_changes still prevents the later green-CI cycle from auto-merging it.
|
|
@@ -955,13 +971,13 @@ safe-outputs:
|
|
|
955
971
|
timeout-minutes: 120
|
|
956
972
|
---
|
|
957
973
|
|
|
958
|
-
1. You are gating pull request **#${{ needs.subject.outputs.pr }}**, which closes
|
|
959
|
-
|
|
960
|
-
**${{ needs.subject.outputs.conclusion }}**.
|
|
974
|
+
1. You are gating pull request **#${{ needs.subject.outputs.pr }}**, which ${{ needs.subject.outputs.closes }}.
|
|
975
|
+
CI concluded **${{ needs.subject.outputs.conclusion }}**.
|
|
961
976
|
|
|
962
|
-
It has already been confirmed that this is an open pull request
|
|
963
|
-
|
|
964
|
-
|
|
977
|
+
It has already been confirmed that this is an open pull request from this repository, opened
|
|
978
|
+
by the bot or by someone with write access. Do not re-check any of that, and do not poll for
|
|
979
|
+
checks: the conclusion above is the answer. Who opened it changes nothing below: a person's
|
|
980
|
+
pull request is repaired, reviewed and merged by the same rules as the bot's.
|
|
965
981
|
|
|
966
982
|
You are on the pull request branch. Never rebase, reset, amend or otherwise rewrite
|
|
967
983
|
history: the workflow applies your commits as a bundle with a fast-forward-only push and
|
|
@@ -969,9 +985,11 @@ timeout-minutes: 120
|
|
|
969
985
|
`push_to_pull_request_branch` tool's own description recommends rebasing; in this
|
|
970
986
|
repository that advice is wrong. Merge, commit, and let the workflow push.
|
|
971
987
|
|
|
972
|
-
2. Read `${{ env.ISSUE_CONTEXT_PATH }}`. It contains the issue body and its discussion
|
|
988
|
+
2. Read `${{ env.ISSUE_CONTEXT_PATH }}`. It contains the issue body and its discussion, or, for
|
|
989
|
+
a pull request that closes no issue, the pull request's own description and discussion. The
|
|
973
990
|
acceptance criteria there define what this implementation had to satisfy, and step 5c asks
|
|
974
|
-
you to check the diff against them.
|
|
991
|
+
you to check the diff against them. A description with no stated criteria is checked against
|
|
992
|
+
what it says the change does.
|
|
975
993
|
|
|
976
994
|
3. Branch on the conclusion.
|
|
977
995
|
|
|
@@ -1225,7 +1243,7 @@ timeout-minutes: 120
|
|
|
1225
1243
|
your report and from the facts it measured, and a word it does not recognise parks the pull
|
|
1226
1244
|
request. Never merge with administrator privileges and never bypass a required check.
|
|
1227
1245
|
|
|
1228
|
-
8. Emit exactly one `add_comment` targeting
|
|
1246
|
+
8. Emit exactly one `add_comment` targeting item `${{ needs.subject.outputs.record }}`,
|
|
1229
1247
|
containing, in this order:
|
|
1230
1248
|
|
|
1231
1249
|
1. `${{ env.GATE_MARKER }}`
|