Skip to content

fix(ci): format codeql workflow and fix flaky one.gov.sg test - #2404

Merged
seancze merged 2 commits into
stagingfrom
fix/ci-codeql-format-and-flaky-login-test
Oct 9, 2026
Merged

seancze merged 2 commits into
stagingfrom
fix/ci-codeql-format-and-flaky-login-test

Conversation

@seancze

@seancze seancze commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Two CI checks fail on staging, and neither failure comes from #2403.

  • lint fails because .github/workflows/codeql.yml, grafted in graft: migrate to org-wide CodeQL configuration #2310, uses 1-space indentation and has no trailing newline, so prettier --check rejects it.
  • test-frontend fails some of the time in one-gov-sg-navigation.test.tsx (on 30b68d0 and 299b237). react-router 6.3 marks navigate as ready inside a passive useEffect. After the async login redirect, the Campaigns button can appear in the DOM before that effect runs. The test clicks it in that gap, and react-router drops navigate(-1) with the "call navigate() in a React.useEffect()" warning.

Solution

Bug Fixes:

  • Run Prettier on codeql.yml. The change is whitespace and quotes only.
  • In the test, retry the back click inside waitFor until the prior page renders.

Tests

  • npm run lint-no-fix passes at the repo root
  • Frontend suite passes (61/61)
  • With react-router patched locally to delay navigate readiness for every useNavigate after the first, the old test fails with the CI error and the new test passes

seancze and others added 2 commits October 9, 2026 11:46
The CodeQL workflow grafted in #2310 uses 1-space indentation and has
no trailing newline, so `prettier --check` in the lint job fails on
every push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
react-router 6.3 sets the ready flag for useNavigate in a passive
useEffect. After the async login redirect, React can commit the
Campaigns button before that effect runs. findByRole then resolves,
the click calls navigate(-1) while the flag is still false, and
react-router drops it with the "call navigate() in a React.useEffect()"
warning. CI hit this on 30b68d0 and 299b237.

Retry the click inside waitFor until the prior page renders.

Verified by patching the installed react-router to delay the flag by
100 ms for every useNavigate after the first. The old test then fails
with the same error as CI, and the new test passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seancze
seancze marked this pull request as ready for review October 9, 2026 03:52
@seancze
seancze requested review from a team and KishenKumarrrrr October 9, 2026 03:52
@seancze
seancze merged commit 22654d8 into staging Oct 9, 2026
9 checks passed
@seancze
seancze deleted the fix/ci-codeql-format-and-flaky-login-test branch October 9, 2026 04:51
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