Conversation
|
HOLD — current head |
|
Current-head CI approval readback (2026-09-10) Head:
Failures at this snapshot: |
Ruleset 21899500 blocks refs/tags/v* creation with no bypass actors, making the release runbook step "cut a new patch tag" unexecutable. The v0.1.1 tag was created after both rulesets, but GitHub exposes no ruleset modification timestamps, so the route is unprovable. - Create GOVERNANCE.md with inspection findings and recommended fix (add bypass actor to ruleset 21899500). - Update releasing.md to reference the sanctioned tag-cut path and require bypass actor verification before publication. Closes bytefolk#163
ed13384 to
a29e916
Compare
|
Not a review, not an approval, carries no vote, does not ask to merge or close. No write action: no review submitted, no Posting one thing that is not on this thread yet, and it is the reason this PR cannot be judged on its own merits: The overlap, measuredBoth branches create the same path.
So this is not a duplicate PR: #125 is a charter that records existing rules and explicitly disclaims changing them, #172 documents a procedure and edits the releasing doc to point at it. The question for the two authors is a shape question, and only you two can answer it: one file with two authors' sections merged into it, or two files with different names and roles. I am asking, not proposing, because I am one of the two authors — I have no standing to pick the outcome, and per "别平行重复改,也先不要关 PR" I have touched neither branch. 负责人
CI: this head has never run
|
This PR cannot merge, and it is not a review problemRecording this so nobody waits on an approval that would not help.
Mechanism
codeql:
name: CodeQL (${{ matrix.language }})
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}This PR's head is When a matrix job is skipped by a job-level That context name matches none of the three required ones. The required contexts are therefore never satisfied — not "failing", but absent, which branch protection treats as pending forever. Confirmation by contrastSame-repo PRs in this repository report all four contexts normally. mem #165 and #188, both merged 2026-09-10: This PR's rollup contains one CodeQL entry, the literal What will not fix it
What will fix itThe guard is a defensible security choice: the Available resolutions, in rough order of how much they preserve the current security posture:
Option 1 is a mechanical fix the author or any maintainer can do. Options 2–4 are owner decisions that affect all twelve repositories, because Scope of the same trap, org-wideEvery open fork PR in a repository that requires a CodeQL context is permanently unmergeable:
Worth naming the consequence for external contributors specifically: I have not changed any branch protection, ruleset or workflow file, and I am not opening a PR against the template unilaterally — the same reasoning that made me leave |
|
Closing: this PR's premise is refuted by the per-ruleset reads now recorded in GOVERNANCE.md (merged via #204). Ruleset 21899500 does have a bypass actor (repository role |
## What this changes
One line deleted from `.github/workflows/bytefolk-security.yml` — the
`if:` guard on the `codeql` job. Nothing else in the file or the
repository changes.
```diff
codeql:
name: CodeQL (${{ matrix.language }})
- if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-24.04
```
Blob size goes 1988 -> 1867 bytes. The deleted line is exactly 121 bytes
including its newline, so the arithmetic accounts for the whole delta:
no whitespace, reordering or annotation change rode along.
## Why
The guard's second clause compares the head repository to the base
repository. It is false for every fork pull request, so the `codeql` job
is skipped.
GitHub does not evaluate a job's `name:` expression when the job is
skipped by its `if:` guard. The skipped job publishes the raw template
string as its check name, so fork PRs in this repository report a check
literally named `CodeQL (${{ matrix.language }})`, which matches none of
the three required contexts `CodeQL (go)`, `CodeQL
(javascript-typescript)` and `CodeQL (python)`.
This is not hypothetical. Two fork PRs by `@sun-970` were measured
through `GET /repos/bytefolk/mem/commits/{sha}/check-runs` after their
first-time workflow runs were approved:
| PR | head | total | success | failed | skipped |
| --- | --- | --- | --- | --- | --- |
| #172 | `a29e9163` | 17 | 16 | 0 | 1 |
| #181 | `4a25bd25` | 17 | 16 | 0 | 1 |
The single skip in each is `CodeQL (${{ matrix.language }})`. Both are
otherwise fully green and both report `mergeable: true`, yet neither can
ever merge: the three CodeQL contexts are required and nothing the
contributor does produces them. The un-interpolated name is a symptom of
the skip, not a separate defect — on `bytefolk/digital-employee#250` the
same expression interpolated to `CodeQL (javascript-typescript)` as soon
as the job actually ran.
## Why deleting the guard rather than adding a `codeql-fork` job
`bytefolk/digital-employee#250` solved this by adding a second job with
the inverted guard. That job is identical to the baseline `codeql` job
apart from the guard and the language matrix, so a second lane
duplicates roughly 37 lines to express what deleting one line already
says.
The guard is also provably redundant for every trigger other than a fork
PR:
- `push`, `schedule`, `workflow_dispatch` — the first clause
`github.event_name != 'pull_request'` is already true.
- Same-repository `pull_request` — the second clause is already true.
- Fork `pull_request` — the job was skipped; it now runs. **This is the
only behavioural change.**
## Evidence that CodeQL actually works on a fork `pull_request` run
`bytefolk/digital-employee#250` is a fork PR (head
`PeterGuy326/digital-employee:feat/issue-245-memory-config`, sha
`abb2d58b29710927742c828a510c419c7c53efb8`). Its `codeql-fork` job
concluded `success` — check runs `102757987331` (84s) and `102757703884`
(86s).
That job declares `permissions: security-events: write` and contains
**no** `continue-on-error` on the job or on any step. A `success` job
conclusion therefore means every step succeeded, including `Analyze` —
and `github/codeql-action/analyze` fails with HTTP 403 when
`security-events: write` is absent. So SARIF upload from a fork
`pull_request` run is confirmed, not assumed.
Fork `pull_request` runs still receive no secrets and read-only
`contents`. All ByteFolk repositories are public.
## Tradeoff, stated plainly
After this change, fork PRs build untrusted code in a job holding
`security-events: write`. The run still has no secrets and read-only
`contents`, and every other required check in this repository (`Go`,
`Worker`, `Web`, `PostgreSQL integration`, `Web memory and transfer
acceptance`, `HTTP, CLI and MCP lifecycle`, `Workflow, scripts and
Compose`) already builds that same untrusted code, so this adds no new
class of exposure. It is the posture GitHub's own default CodeQL setup
takes for public repositories.
The alternatives were considered and rejected:
- `pull_request_target` would hand a write-scoped token to a workflow
run over attacker-influenced code.
- Self-reporting the three contexts through the Statuses API would
fabricate a required check that never ran.
- Granting contributors organization membership does not help at all:
the guard compares repositories, not author identity.
## What this does not touch
- No `permissions:` block changes. The job keeps exactly `contents:
read`, `actions: read`, `packages: read`, `security-events: write`.
- No required status context, branch protection rule or ruleset is
weakened or removed.
- No action SHA, trigger, matrix entry, step or job other than the
deleted line.
- The pinned `# v4.37.4` annotations are deliberately left alone. They
are the subject of bytefolk/.github#32 and #203, and this PR must stay
disjoint from them.
## Interaction with #203
#203 edits this same file, but only the three `github/codeql-action/*`
annotation lines at 58, 65 and 68, plus `bytefolk-scorecard.yml`. This
PR deletes line 36. The hunks do not overlap, so the two 3-way-merge
cleanly in either order. Neither needs rebasing because of the other.
## Checks
`Workflow, scripts and Compose` runs `actionlint` over every workflow.
Deleting a job-level conditional cannot introduce an actionlint finding;
the resulting YAML keeps `name`, `runs-on`, `timeout-minutes`,
`permissions`, `strategy` and `steps` on the `codeql` job. The release
pin validators in that job (`validate_release_action_pins.sh`,
`test_release_guards.sh`, `test_release_helpers_compat.sh`) all hardcode
`release.yml` and never read this file.
This branch is same-repository rather than a fork, so the PR's own three
CodeQL contexts can go green here — otherwise the fix could not
demonstrate itself.
## Follow-up
The identical guard sits in
`bytefolk/.github/workflow-templates/bytefolk-security.yml`, which is
where every consumer copied it from. A separate template PR is filed so
the fix propagates instead of regressing on the next template sync. Any
consumer that added its own `codeql-fork` lane (`digital-employee`, via
#250) must delete it once the template changes, otherwise two jobs
publish the same check name.
After this merges, #172 and #181 need a branch update rather than a
plain re-run: for `pull_request` events GitHub takes the workflow YAML
from the merge ref, while a re-run replays the workflow version captured
when the run was created. Both are already `state: behind` under
`strict: true`, so they need the update regardless.
Refs bytefolk/.github#35
Co-authored-by: 勒布朗-詹姆斯 <2986253039@qq.com>
Summary
refs/tags/v*creation with no bypass actors. The v0.1.1 tag was created at 06:32:10Z, after both rulesets (00:34:47Z and 04:47:11Z), but GitHub exposes no ruleset modification timestamps — the route is unprovable.GOVERNANCE.mdwith the recommended fix (add a narrowly-scoped bypass actor to ruleset 21899500) and the tag-cut procedure once the bypass is configured. Updatedreleasing.mdto reference the sanctioned path.Changes
GOVERNANCE.mddocs/maintainers/releasing.mdAcceptance criteria
GOVERNANCE.mdwith inspection evidence (ruleset timestamps vs tag timestamp).GOVERNANCE.md.Admin action required (not in this PR)
A repository admin must configure a bypass actor on ruleset 21899500. Recommended options (in order of preference):
release-managerrepository role limited to the release maintainer set.adminrole, restricted to the two named release maintainers.The rule stays enforced for all other actors. Ad-hoc disabling remains forbidden.
Test plan
GOVERNANCE.mdfor accuracy of inspection findings.GOVERNANCE.mdand record result on release issue.releasing.mdreferences are correct.Closes #163