Skip to content

Generate the Deflake workflow list - #4344

Open
henrymercer wants to merge 2 commits into
mainfrom
henrymercer/deflake-workflow-list
Open

henrymercer wants to merge 2 commits into
mainfrom
henrymercer/deflake-workflow-list

Conversation

@henrymercer

Copy link
Copy Markdown
Contributor

The Deflake workflow only reruns failed jobs in workflows listed under on.workflow_run.workflows, and this list has drifted from the PR checks: three checks were missing, one entry didn't match its check's name, and one named a check that no longer exists.

The first commit fixes the list by hand. The second generates it in pr-checks/sync.ts, so that the existing check that the generated workflows are up to date also catches the list drifting from them. Workflows that sync.ts doesn't generate are listed by hand in the new pr-checks/deflake.ts.

GitHub treats these entries as glob patterns, so sync.ts escapes them. It rewrites the whole of deflake.yml with the yaml library, which puts the first three lines of the if condition on one line without changing its value.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Environments:

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • Other - Deflake only runs from the default branch, so I'll check its runs after this is merged.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

henrymercer and others added 2 commits November 23, 2026 17:32
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 23, 2026 17:34
@github-actions github-actions Bot added the size/M Should be of average difficulty to review label Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change that synchronizes Deflake’s trigger list with generated workflows.

No open issues 🎉

What changed in this PR

This PR generates Deflake’s workflow trigger list alongside the PR-check workflows, preventing the list from drifting as checks are added or renamed.

Changes:

  • Combines generated workflow names with an explicit list of non-generated workflows, then sorts and escapes them for literal matching.
  • Repairs missing, mismatched, and obsolete Deflake entries.
  • Adds tests for escaping, YAML rewriting, and invalid input, and documents the generation behavior.
File Description
pr-checks/​sync.ts Collects generated workflow names and updates Deflake during generation.
pr-checks/​readme.md Documents that workflow generation also updates Deflake’s trigger list.
pr-checks/​deflake.ts Defines non-generated workflows and implements trigger-list rewriting.
pr-checks/​deflake.test.ts Tests escaping, sorting, formatting, preservation, and error handling.
.github/​workflows/​deflake.yml Updates the trigger list and reformats the existing condition without changing its value.

Review effort: Balanced (adaptive)

@henrymercer
henrymercer marked this pull request as ready for review November 23, 2026 18:23
@henrymercer
henrymercer requested a review from a team as a code owner November 23, 2026 18:23

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Should be of average difficulty to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants