Skip to content

fix(cla): keep the CLA check running past the pull_request_target block, and sweep only deploy-branch runs (ENG-2046) - #78

Merged
lucas-koontz merged 2 commits into
mainfrom
fix/eng-2046-cla-policy-and-sweep-events
Nov 12, 2026
Merged

lucas-koontz merged 2 commits into
mainfrom
fix/eng-2046-cla-policy-and-sweep-events

Conversation

@lucas-koontz

Copy link
Copy Markdown
Contributor

User story

As an outside contributor opening a pull request on a MindsDB public repository
I want the CLA check to start and ask me to sign after GitHub blocks pull_request_target by default
So that my contribution can be accepted

Why this matters

On 9 Nov, from 16:00 to 18:00 UTC, GitHub's first brownout of its pull_request_target block refused every CLA run in our public repositories before it started. GitHub runs another brownout on 16 Nov and blocks the event for good on 2 Dec, unless an Actions event policy allows it.

The same refusal set off the startup-failure sweep. The refused CLA run belonged to a release pull request whose head is staging, and GitHub lists a pull request run under its head branch. So the sweep alerted three times that staging "is not deployed", while staging had deployed from the same commit eight seconds earlier.

What happens today

  • Every caller's cla.yml triggers on pull_request_target and issue_comment, and the org has no Actions event policy.
  • Both deploy-branch sweeps keep every run a branch listing returns, so a pull request or comment run counts as a deploy-branch run.
  • The startup-failure alert says "The branch is not deployed", labels the actor "Pushed by", and names only the permissions: and YAML causes.

What should happen

  • config/cla-actions-policy.json is an org Actions event policy. It allows pull_request_target and issue_comment for .github/workflows/cla.yml in every repository, and names no other workflow. An org admin creates it with the gh api calls in the README, since the Terraform GitHub provider has no resource for it yet.
  • Both sweeps keep only runs a deploy branch starts for itself: push, schedule, workflow_dispatch, workflow_run and repository_dispatch. They filter before picking each workflow's newest run, so a later pull request run can't hide a red push.
  • The alert says the run never started, labels the actor "Started by", and names both causes: the permissions: or YAML on that ref, or an Actions policy.
  • The README's sweep and release-train sections name no repository outside this one.

Test plan

  • The policy allows both CLA events for cla.yml alone: tests/test_cla_actions_policy.py pins its target and events. The live policy is checked once it's created.
  • anton's refused CLA run 42654716938 on staging: the startup sweep reports nothing, and a push that never started is still reported. The tests fail on main and pass here.
  • The red-branch sweep ignores a red pull request run headed staging, still reports a red push, and a later pull request run doesn't hide it. The tests fail on main and pass here.
  • The alert names both causes, links the run, and doesn't say "not deployed": TestMessage renders the real payload.
  • Negative, another pull_request_target workflow stays under GitHub's default block: checked with a scratch repository after the policy is created. Not checked yet.
  • During the 16 Nov brownout, a CLA run starts and finishes. Not checked yet.
  • Negative, no caller's cla.yml changes: none does.

@lucas-koontz
lucas-koontz requested review from a team and hamishfagg November 11, 2026 08:30
@lucas-koontz
lucas-koontz merged commit a5974b6 into main Nov 12, 2026
6 checks passed
@lucas-koontz
lucas-koontz deleted the fix/eng-2046-cla-policy-and-sweep-events branch November 12, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants