• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / next-departures-api / 25461678005 / 1
28%
main: 28%

Build:
DEFAULT BRANCH: main
Ran 06 May 2026 09:18PM UTC
Files 19
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 May 2026 09:17PM UTC coverage: 28.278% (+0.2%) from 28.031%
25461678005.1

push

github

web-flow
feat: add Traveline fallback for SIRI rate limits (#14)

Implement a fallback mechanism to fetch bus departures from Traveline
when the primary SIRI API exceeds its usage limits. This ensures service
availability even after the daily TransportAPI quota is exhausted.

-   Introduces `FallbackManager` to track rate-limit state.
- Adds `TravelineClient` to scrape live departures from the Traveline
website.
- Includes a daily **CRON** job to reset the fallback state at midnight.
-   Updates `NextDepartures` route to automatically switch providers.

Fixes #12 

```mermaid
sequenceDiagram
    participant User
    participant API as API Server
    participant SIRI as SIRI API
    participant FM as Fallback Manager
    participant TVL as Traveline

    User->>API: GET /v1/next-departures/:id
    API->>FM: IsSiriRateLimited?
    alt No
        API->>SIRI: Request departures
        alt Success
            SIRI-->>API: Departure data
        else Rate Limited (429/403)
            SIRI-->>API: Limit Exceeded
            API->>FM: SetSiriRateLimited(true)
            API->>TVL: Scrape departures
            TVL-->>API: Fallback data
        end
    else Yes
        API->>TVL: Scrape departures
        TVL-->>API: Fallback data
    end
    API-->>User: JSON Response
```

317 of 1121 relevant lines covered (28.28%)

0.31 hits per line

Source Files on job 25461678005.1
  • Tree
  • List 19
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25461678005
  • 30706c63 on github
  • Prev Job for on main (#25457852195.1)
  • Next Job for on main (#25597951935.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc