Skip to content

feat: list validation errors on the Compliant criterion - #238

Merged
cka-y merged 4 commits into
mainfrom
feat/improve-compliant
Sep 16, 2026
Merged

cka-y merged 4 commits into
mainfrom
feat/improve-compliant

Conversation

@cka-y

@cka-y cka-y commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

The Compliant criterion showed an error count and a link out to the HTML report. It now lists the error codes behind the verdict, using the new GET /v1/gtfs_feeds/{id}/validation_reports endpoint.

  • Regenerated types.ts, added getGtfsFeedValidationReports, and fetched it alongside the three existing seal endpoints.
  • Errors only. Each row carries the code, the GTFS file it applies to, a one-line description and how many times it was raised. The wording comes from the validator's own rules index (gtfs-validator.mobilitydata.org/rules.json), cached 24h server side, falling back to the humanised code when a rule is missing.
  • Errors carried over from earlier datasets are summarised in one line; new ones are marked, so it is clear whether a failure is current.
  • Links to download the dataset (URL built like buildRoutesUrl) and to open the validation report. Both stay when the criterion passes.
  • "The latest validation report has X errors" now counts distinct codes rather than occurrences, so the sentence and the list agree.

Notes:

  • The panel is a Server Component, so none of this ships client JS.
  • One extra API call, issued in parallel with the other seal endpoints and cached 6 hours. The rules index is fetched server side only.
  • The endpoint is tagged beta and lives on the API's main branch, not a tagged release: running yarn generate:api-types today would revert types.ts.
  • Some feeds come back with latest: null and is_latest false on every entry (e.g. mdb-3215). The model falls back to the most recently validated report, but this looks worth fixing API side.

Testing tips:

  • /feeds/gtfs/{id}/seal-of-reliability on a failing GTFS feed: error list, carried/new line, both links.

  • A feed whose latest dataset is clean: no list, links still present.

  • yarn test covers the model, the rules parser and the compliance summary.

  • Run the unit tests with yarn test to make sure you didn't break anything

  • Add or update any needed documentation to the repo

  • Format the title like "feat: [new feature short description]"

  • Linked all relevant issues

  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

In grace period:
image
Failure
image

Pass
image

@welcome

welcome Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:

  • fix: Bug with ssl network connections + Java module permissions.
  • feat: Initial support for multiple @PrimaryKey annotations.
  • docs: update RELEASE.md with new process
    To get this PR to the finish line, please do the following:
  • Include tests when adding/changing behavior
  • Include screenshots

@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mobilitydatabase-web Ready Ready Preview Sep 16, 2026 2:50pm UTC

Request Review

@cka-y cka-y changed the title added more information to compliant feat: list validation errors on the Compliant criterion Sep 15, 2026
@cka-y
cka-y marked this pull request as ready for review September 15, 2026 21:16
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

*Lighthouse ran on https://mobilitydatabase-8ab1d811s-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 98 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-8ab1d811s-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 86 🟠 87 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-8ab1d811s-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 47 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-8ab1d811s-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 98 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-8ab1d811s-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 86 🟢 94 🟢 96 🟢 100

@emmambd

emmambd commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@cka-y I'm having trouble finding examples of the cases you've screenshot but the screenshots themselves look great, and I found one instance of not_evaluated where there were no previous validation reports to reference and the result looks great. LGTM!

@Alessandro100

Copy link
Copy Markdown
Contributor
image source: /tdg-84170
  1. "3 errors are carried from earlier datasets." I'm not sure what that means, isn't this purely based on the latest dataset?
  2. Add a , between the files if there are many

Comment thread src/app/screens/Feed/components/ComplianceCriterionBody.tsx Outdated
@Alessandro100

Copy link
Copy Markdown
Contributor
Screenshot 2026-09-16 at 09 10 25 Remove the divider line at the bottom if there are no errors to display

@cka-y

cka-y commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

image source: /tdg-84170

  1. "3 errors are carried from earlier datasets." I'm not sure what that means, isn't this purely based on the latest dataset?
  2. Add a , between the files if there are many

@Alessandro100

  1. It means that the error existed in previous datasets. If the 3 errors were new it would say '3 new errors in this dataset'. My rationale behind this information is that it might be valuable for producer to know if the error is newly introduced in the error state dataset (which might be different from the latest dataset) or existed before so they can better determine which part of their pipeline it came from. Happy to remove it if it has no value cc: @emmambd
  2. addressed ✅

@emmambd

emmambd commented Sep 16, 2026

Copy link
Copy Markdown
Contributor
  1. This made sense to me upon reading it so I'd keep it in at this stage (given when you look at the dataset history, it's clear the newest validation report is unknown)

@davidgamez

Copy link
Copy Markdown
Member

This PR LGTM; one question:

  • How are we handling a high number of errors for a single feed?

@cka-y cka-y self-assigned this Sep 16, 2026
@cka-y

cka-y commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author
image cc: @davidgamez - the most errors i could find on prod is 6

@Alessandro100 Alessandro100 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.

Looks good, great addition

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@cka-y
cka-y merged commit 326106b into main Sep 16, 2026
4 checks passed
@welcome

welcome Bot commented Sep 16, 2026

Copy link
Copy Markdown

🥳 Congrats on getting your first pull request merged!

This branch was successfully deployed

1 active deployment
Preview — 101f7e25 Deployed Sep 16, 2026 by vercel[bot]
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.

4 participants