Skip to content

chore(devex): lint pull request event fanout - #72668

Merged
trunk-io[bot] merged 13 commits into
masterfrom
chore/ci-dispatch-fanout-lint
Aug 5, 2026
Merged

chore(devex): lint pull request event fanout#72668
trunk-io[bot] merged 13 commits into
masterfrom
chore/ci-dispatch-fanout-lint

Conversation

@rnegron

@rnegron rnegron commented Jul 21, 2026

Copy link
Copy Markdown
Member

Problem

  • Any workflow subscribed to pull_request without path filters dispatches a run on every PR event, silently growing per-event fanout toward GitHub's 500 runs / 10 s dispatch cap.

Changes

Check WF008-pr-event-fanout in hogli lint:workflows
Mode Blocking, like every other check
Counts Each unfiltered pull_request / pull_request_target subscription (one dispatch each)
Excludes A trigger-level paths: allowlist. paths-ignore still counts, since it usually excludes a narrow slice
Budget Pinned to today's exact per-action fanout, so any new unscoped subscription trips it
  • Remediation in the lint output and the authoring-ci-workflows skill: fold small jobs into an existing dispatcher, add a paths: filter, or raise the budget explicitly in review.
  • labeled / unlabeled are not counted. A label arrives one PR at a time, so it cannot produce the burst this guards, and all 7 remaining subscribers want the trigger.
  • Renumbered WF007 to WF008 to avoid colliding with lint required-check gate hygiene.

Note

The budget is a repo-wide sum, not a per-workflow rule. It caps total fanout; it does not stop one workflow from re-acquiring an action another just gave up. The merge-gate label ban stays with AGENTS.md and the inline on: comments from stop label events re-running CI, which a fungible sum cannot express.

How did you test this code?

  • Workflow-lint pytest suite: 106 passed. A new CLI test locks in exit 1 on a budget breach.
  • Five parameterized cases cover the count, the paths: exclusion, that paths-ignore still counts, and that labels are not counted.
  • hogli lint:workflows over 124 workflows: clean, so master and untouched PRs are unaffected.
  • hogli ci:preflight --strict: 0 failures.

Automatic notifications

  • Publish to changelog?

Docs update

  • authoring-ci-workflows skill covers the new check.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Skills: /writing-tests, /writing-pr-descriptions, /code-review, /authoring-ci-workflows, /writing-skills.

  • Codex authored the check via /wt, initially as an advisory (non-failing) check.
  • I called the advisory mode out: the budget already pins current fanout, so nothing existing fails and a non-failing warning would just be ignored. Flipped to blocking and deleted the advisory machinery, shrinking the diff.
  • Claude Code merged master and ran a review pass. The budget still matches live counts exactly after the merge, zero slack on all 8 budgeted actions.
  • That pass also caught the module docstring claiming all path-filtered workflows were excluded when only paths: is.
  • A final pass dropped the label budget. Counting labels forced a fix hint that told you never to raise two of its own ceilings, and every current label subscriber is a deliberate opt-in trigger, not a merge gate.

@rnegron rnegron self-assigned this Jul 21, 2026
@rnegron
rnegron force-pushed the chore/ci-dispatch-fanout-lint branch from 8258b50 to 21ef9cb Compare July 28, 2026 14:24
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

rnegron added 2 commits August 4, 2026 11:08
…anout-lint

# Conflicts:
#	.agents/skills/authoring-ci-workflows/SKILL.md
#	tools/hogli-commands/hogli_commands/tests/test_workflow_lint.py
#	tools/hogli-commands/hogli_commands/workflow_lint/checks/__init__.py
@trunk-io

trunk-io Bot commented Aug 4, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@rnegron
rnegron marked this pull request as ready for review August 5, 2026 15:28
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team August 5, 2026 15:29
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "chore(ci): exempt label triggers from th..." | Re-trigger Greptile

Comment thread tools/hogli-commands/hogli_commands/workflow_lint/checks/pr_event_fanout.py Outdated
@rnegron rnegron added the stamphog Request AI approval (no full review) label Aug 5, 2026
@stamphog

stamphog Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

🤖 stamphog review failed before producing a verdict

Check the workflow run and re-apply the label to retry.

Updated in place from an earlier stamphog review.

@rnegron rnegron removed the stamphog Request AI approval (no full review) label Aug 5, 2026
@rnegron
rnegron removed the request for review from a team August 5, 2026 16:28
@rnegron rnegron added the stamphog Request AI approval (no full review) label Aug 5, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a well-tested addition to the internal workflow linter (author owns the area with STRONG familiarity), and the diff shows the Graphite-flagged empty-types logic bug was correctly fixed before merge, with no other unresolved concerns.

  • Author wrote 100% of the modified lines and has 38 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 110L, 2F substantive, 234L/4F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (234L, 4F, two-areas, chore)
stamphog 2.0.0b4 .stamphog/policy.yml @ 5d75423 · reviewed head 7980c95

@trunk-io
trunk-io Bot merged commit 4c48b0d into master Aug 5, 2026
230 of 235 checks passed
@trunk-io
trunk-io Bot deleted the chore/ci-dispatch-fanout-lint branch August 5, 2026 19:24
@deployment-status-posthog

deployment-status-posthog Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-08-05 19:49 UTC Run
prod-us ✅ Deployed 2026-08-05 20:05 UTC Run
prod-eu ✅ Deployed 2026-08-05 20:06 UTC Run

Asheesh7298 pushed a commit to Asheesh7298/posthog that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant