Skip to content

fix: stop the live canary from failing on Google's empty booking responses#23

Merged
saraswatayu merged 3 commits into
mainfrom
fix/canary-resilience
May 26, 2026
Merged

fix: stop the live canary from failing on Google's empty booking responses#23
saraswatayu merged 3 commits into
mainfrom
fix/canary-resilience

Conversation

@saraswatayu

Copy link
Copy Markdown
Owner

Summary

The live-canary workflow has been failing on every scheduled run since ~April 6 (8+ weeks) — but only on schedule. Manual workflow_dispatch runs occasionally pass. Locally the same test passes 100% of the time. That's a flakiness signal in the canary itself, not a regression in swoop.

Failure mode in the most recent run:

tests/test_live_contract.py:329
assert options, "Expected at least one booking option from live booking lookup"
assert []

Shopping search succeeds, an itinerary with booking_token + _build_selected_legs(itin) is found, then rpc.get_booking_results(itin) returns [] — Google's GetBookingResults RPC succeeded but had no bookable options for the first token we tried.

Changes

  • tests/test_live_contract.py_find_bookable_itinerary_bookable_candidates (returns up to 5 candidates). The booking test iterates until one returns options; only fails when all 5 come back empty. Failure message includes how many were tried so triage is faster.
  • swoop/rpc.pyget_booking_results logs WARNING when the RPC succeeds with 0 options. Lets artifact review distinguish upstream variance from a parser regression.
  • .github/workflows/ci.yml — release-create step uses --title v${VERSION} so future v0.x.y releases get the bare title (matches v0.4.0 / v0.4.1; v0.5.0 was published with the wrong title and has been manually corrected).
  • All three workflows — bump actions/checkout@v4 → v5, setup-python@v5 → v6, upload-artifact@v4 → v5. Drops the Node 20 deprecation warning that hits on every run before the September 2026 EOL.

Test plan

  • make check (offline tests + pyright) — passes
  • python -m pytest tests/test_live_contract.py -v -m live locally — all 3 pass
  • Watch next scheduled live-canary run on Tuesday (or trigger via workflow_dispatch after merge)

🤖 Generated with Claude Code

saraswatayu and others added 3 commits May 26, 2026 14:34
The booking canary picked the first itinerary with a booking_token + selected
legs and failed if Google returned zero booking options for that one — even
when the RPC itself succeeded. That made the canary fail ~weekly on schedule
for two months while the actual code worked end-to-end.

- _bookable_candidates returns up to 5 candidates (was: first match only).
- Test iterates candidates and passes if any returns booking options;
  fails only when all came back empty.
- get_booking_results now logs a WARNING when the RPC succeeds with 0
  options so artifact triage can distinguish upstream variance from
  parser regressions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Node 20 is deprecated on GitHub-hosted runners as of June 2026. Move the
canary and mutation workflows to checkout@v5, setup-python@v6, and
upload-artifact@v5 so we stop emitting the deprecation warning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The release-create step inherited GITHUB_REF_NAME as the title, so v0.5.0
ended up published as 'swoop-v0.5.0' while v0.4.x were titled 'v0.4.0' /
'v0.4.1'. Pass --title v${VERSION} explicitly so future releases stay
consistent. Tag still ships as swoop-vX.Y.Z (publish job and PyPI parser
depend on that prefix).

Also bump checkout/setup-python to Node 24-compatible versions to silence
the deprecation warning on every CI run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@saraswatayu saraswatayu merged commit a36bf91 into main May 26, 2026
4 checks passed
@saraswatayu saraswatayu deleted the fix/canary-resilience branch May 26, 2026 18:36
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.

1 participant