Repository navigation
docs(dev-lead): concurrency ownership, @main pin, and the permission contract #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
33099f2
cc0ac22
a5b1b6a
41085fa
0f6a843
d7a81f8
1b7fe42
1cdc8d9
2faafe7
46099ee
17e08a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,12 @@ reusable, not a local edit. | |
| > (most are `@v1`; `pr-review-mention` is `@v2`). A tag is bumped deliberately | ||
| > when a backward-compatible release is ready; breaking changes publish a new | ||
| > tag that downstream repos opt into explicitly. | ||
| > | ||
| > **Exception β `dev-lead`.** The dev-lead reusable lives in the private | ||
| > `petry-projects/.github-private` repo (it checks out private prompts/scripts) | ||
| > and is pinned `@main`, not a tag β so permission and security fixes | ||
| > propagate immediately instead of waiting for a tag bump or the monthly | ||
| > standards-sync. See [Dev-Lead Agent](#dev-lead-agent). | ||
|
|
||
| ### Available templates | ||
|
|
||
|
|
@@ -937,16 +943,19 @@ incorrect pinned one. | |
|
|
||
| ### Exception: Internal Reusable Workflow References | ||
|
|
||
| Calls to `petry-projects/.github` reusable workflows use tag references | ||
| (`@v1`, `@v2`, or `@main`) β **not SHA pins** β and are exempt from this policy. | ||
| Calls to `petry-projects/.github` and `petry-projects/.github-private` reusable | ||
| workflows use tag or branch references (`@v1`, `@v2`, or `@main`) β **not SHA | ||
| pins** β and are exempt from this policy. | ||
|
|
||
| ```yaml | ||
| # CORRECT β tag ref for internal reusable workflow | ||
| uses: petry-projects/.github/.github/workflows/dev-lead-reusable.yml@v1 | ||
| # CORRECT β tag ref for a public internal reusable workflow | ||
| uses: petry-projects/.github/.github/workflows/pr-review-mention-reusable.yml@v2 | ||
|
|
||
| # CORRECT β dev-lead lives in the private repo and tracks @main (see Dev-Lead Agent) | ||
| uses: petry-projects/.github-private/.github/workflows/dev-lead-reusable.yml@main | ||
|
|
||
| # WRONG β do not SHA-pin internal reusable workflow refs | ||
| uses: petry-projects/.github/.github/workflows/dev-lead-reusable.yml@ee22b427cbce9ecadcf2b436acb57c3adf0cb63d | ||
| uses: petry-projects/.github-private/.github/workflows/dev-lead-reusable.yml@ee22b427cbce9ecadcf2b436acb57c3adf0cb63d | ||
| ``` | ||
|
|
||
| **Why:** Pinning the `uses:` line in a Tier 1 caller stub creates a diff from | ||
|
|
@@ -1185,6 +1194,49 @@ All repos MUST align to the latest version of each action: | |
| The dev-lead agent is a reactive, write-enabled automation that keeps pull requests in a clean, approvable, and mergeable state. | ||
| It responds to CI failures, bot reviews, human `@mentions`, and labeled issues. | ||
|
|
||
| ### Concurrency, pinning, and the permission contract | ||
|
|
||
| Three things are deliberately **not** tuned in the caller stub β they are owned | ||
| centrally so they cannot drift per repo: | ||
|
|
||
| - **Concurrency.** The stub carries **no `concurrency:` block**. Concurrency is | ||
| centralized in `dev-lead-reusable.yml` with per-issue / per-PR / ci-relay | ||
|
don-petry marked this conversation as resolved.
|
||
| lanes (`dev-lead-issue-<n>`, `dev-lead-pr-<n>`, `dev-lead-ci-relay-<sha>`, | ||
| `cancel-in-progress: false`). This keeps a labeled-issue pickup from being | ||
| cancelled by unrelated PR follow-up traffic β per-stub concurrency previously | ||
| drifted into three incompatible variants and starved issue pickups | ||
| (petry-projects/.github#402). Running lanes in parallel is safe because the | ||
| agent checks out PR branches in an isolated worktree (petry-projects/.github-private#448). | ||
| - **Pin.** The stub pins | ||
| `petry-projects/.github-private/.github/workflows/dev-lead-reusable.yml@main` | ||
| β `@main`, not a tag β so a permission or security fix reaches every | ||
| repo immediately rather than waiting for a tag bump or the monthly | ||
| standards-sync. | ||
| - **Permissions.** The stub's `jobs.dev-lead.permissions` must grant the **full | ||
| set that the reusable requests**: | ||
|
|
||
| ```yaml | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| actions: read | ||
| checks: read | ||
| statuses: read | ||
|
don-petry marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| A reusable workflow can only use permissions its caller grants; if the | ||
| reusable requests a scope the stub lacks, **every consumer fails at startup** | ||
| (`startup_failure`, with no runtime error). When the reusable needs a new | ||
| scope, add it to the template **and** every shim *before* the reusable | ||
| requests it β the `caller-permissions` CI guard in `.github-private` enforces | ||
| that ordering. | ||
|
|
||
| To exclude a specific PR or issue from the agent β e.g. a PR that edits the | ||
| dev-lead workflow itself, so the agent doesn't pile commits onto its own infra | ||
| change β add the **`dev-lead:hands-off`** label; the classifier then skips every | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This new escape-hatch relies on a Useful? React with πΒ / π. |
||
| event on it. | ||
|
|
||
| ### Adopting the Dev-Lead Agent | ||
|
|
||
| 1. Copy `standards/workflows/dev-lead.yml` verbatim to `.github/workflows/dev-lead.yml` in your repo. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new exception says dev-lead lives in
.github-privateand tracks@main, but the Tier 1 table just above still includesdev-lead.ymlin a generic rule that says stubs delegate topetry-projects/.github/...@<version>and that the matching reusable lives in this repo. Readers and compliance agents following the table before this carve-out can still generate or validate the old public@v1shape, so please update the Tier 1 row to either exclude dev-lead or explicitly mention the private@mainexception there as well.Useful? React with πΒ / π.