CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(api): ?branch= silently hid nearly every workflow run #5600

MergedXSccantynz wants to mergefix/run-branch-filtermainopened 1d ago
ccantynzcommented 1d ago

GET .../actions/runs?branch=main returned one run from four days earlier while the same endpoint unfiltered showed six from the last hour.

Two writers, two formats, one column

workflow_runs.ref holds both forms:

writer stores
push-workflow-sync.ts, pr-workflow-sync.ts main
pr-slash-commands.ts, scheduled-workflows.ts refs/heads/main

Both list endpoints normalised the query to one form and compared against it. That's the obvious implementation, and it excluded every push-triggered run — nearly all of them. The pre-existing per-workflow list had the bug too; the repo-wide one I shipped an hour ago inherited it by copying the approach.

Both now match either stored form. That works on the data that exists rather than the data we wish existed — historical rows carry both formats, and no migration can be retroactive about intent.

The part worth naming

The failure was a filter returning a plausible-looking short list, not an error. Nobody checks a short list.

It was found only by comparing filtered and unfiltered output side by side while chasing something else — and it had shipped and merged an hour earlier with tests that asserted the normalisation was correct. Those tests tested the implementation's idea of the column instead of the column.

The write side is deliberately not fixed here

Both bare-writing call sites now carry a note pointing at the readers that must match both forms, and saying not to tidy one format away without converting existing rows and auditing every reader — run.ref is fed back into enqueue and checkout paths.

A half-migration here would be worse than the divergence. The divergence is survivable and now handled; a half-migration would be neither.

ccantynzAI Reviewcommented 1d ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 1d ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts