mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-18 14:14:37 +01:00
Open pull requests with three plain lines and land each one as a single commit (GST-2737) (#4438)
* WIP plain PR bodies and squash messages Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Fold PR bodies to three plain lines and land every PR as one plainly titled commit Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Expect the plain commit body in the train land tests Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Count the new policy keys in the floor tests and record the ship size change Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Let older, generated and Dependabot PRs pass the body check, and keep comments posting The opening check now follows the same date and branch exemption as the rest of the body check, Dependabot branches are exempt, the exemption only counts for branches in this repository, a merge that cannot read the PR waits instead of refusing, and a broken policy file no longer stops comments. Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1/specialist-batched#2 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#4 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Stop re-posted PR bodies from duplicating sections, and let file names through the word check Posting an already-folded body now replaces each section once instead of keeping the old copy beside it, and listed words inside file paths or file names, such as a test file in the Tests section, no longer count as prose. Review-Finding: v2/outside-voice#3 reader=outside-voice Review-Finding: v2/adversarial-native#2 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Describe the folded three-line PR body in the skills guide and the prose lint help Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
aeb74eb00b
commit
c53b15c48d
47 files changed
+1182
-208
No files matched your search
@@ -3,7 +3,8 @@ name: Plain title
|
||||
# Checks that a PR's title reads in everyday words (R76, docs/ship-policy.md#plain-titles).
|
||||
# The title is refused in the front: tracker codes, project-only words and a
|
||||
# type(scope): prefix. One trailing group of references like (ABC-123) or (#4122)
|
||||
# is fine. The branch name, the PR opening and the commit subjects only warn.
|
||||
# is fine. The body is refused when it breaks the plain shape (docs/writing-prs.md);
|
||||
# the branch name and the commit subjects only warn.
|
||||
# PRs created before the policy's since date are exempt.
|
||||
#
|
||||
# WHY pull_request_target: it runs the base repository's copy of this workflow,
|
||||
@@ -77,7 +78,26 @@ jobs:
|
||||
bun --no-env-file --config=/dev/null bin/gstack-plain-title check \
|
||||
--title-file "$RUNNER_TEMP/pr-title.txt" --created-at "$PR_CREATED_AT" --mode refuse
|
||||
|
||||
- name: Check the branch name, opening and commit subjects (warnings only)
|
||||
# The body: its opening, at most three lines before the first fold, and no
|
||||
# listed word above the Agent notes fold (docs/writing-prs.md). A PR created
|
||||
# before the policy's body_since date, or from a generated branch the policy
|
||||
# exempts (release notes repeat CHANGELOG text), only gets warnings. Only a
|
||||
# branch in this repository counts as exempt: a fork names its own branches.
|
||||
- name: Check the body
|
||||
if: ${{ !cancelled() }}
|
||||
env:
|
||||
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
|
||||
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
PR_CREATED_AT: ${{ github.event.pull_request.created_at }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
exempt_branch=""
|
||||
if [ "$PR_HEAD_REPO" = "$GITHUB_REPOSITORY" ]; then exempt_branch="$PR_BRANCH"; fi
|
||||
bun --no-env-file --config=/dev/null bin/gstack-plain-title check \
|
||||
--body-file "$RUNNER_TEMP/pr-body.txt" --head-branch "$exempt_branch" \
|
||||
--created-at "$PR_CREATED_AT" --mode refuse
|
||||
|
||||
- name: Check the branch name and commit subjects (warnings only)
|
||||
if: ${{ !cancelled() }}
|
||||
env:
|
||||
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
|
||||
@@ -85,5 +105,5 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bun --no-env-file --config=/dev/null bin/gstack-plain-title check \
|
||||
--branch "$PR_BRANCH" --body-file "$RUNNER_TEMP/pr-body.txt" \
|
||||
--branch "$PR_BRANCH" \
|
||||
--commits-file "$RUNNER_TEMP/pr-commits.txt" --created-at "$PR_CREATED_AT" --mode warn
|
||||
Reference in new issue
Block a user