Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing metrics data breaks accessibility test for datagov-11ty #5118

Closed
neilmb opened this issue Mar 4, 2025 · 3 comments
Closed

Missing metrics data breaks accessibility test for datagov-11ty #5118

neilmb opened this issue Mar 4, 2025 · 3 comments
Assignees
Labels
bug Software defect or bug

Comments

@neilmb
Copy link
Contributor

neilmb commented Mar 4, 2025

There is a metric file missing on S3 for the City of Philadelphia. When we go to build the data.gov website in datagov-11ty, that file isn't found and the metrics page that results from the missing data fails our accessibility tests. https://github.com/GSA/datagov-11ty/actions/runs/13658174955/job/38182613348?pr=412

How to reproduce

  1. Run npm run dev and then npm pa11y-ci in GSA/datagov-11ty.

Expected behavior

Tests pass.

Actual behavior

> [email protected] start
> npx @11ty/eleventy --serve

ERROR :: Fetch failed :: Error: Bad response for https://s3-us-gov-west-1.amazonaws.com/cg-baa85e06-1bdd-4672-9e3a-36333c05c6ce/city-of-philadelphia__page_requests__last30.2025-02-28.csv (403): Forbidden
ERROR :: Fetch failed :: Error: Bad response for https://s3-us-gov-west-1.amazonaws.com/cg-baa85e06-1bdd-4672-9e3a-36333c05c6ce/city-of-philadelphia__download_requests__last30.2025-02-28.csv (403): Forbidden
ERROR :: Fetch failed :: Error: Bad response for https://s3-us-gov-west-1.amazonaws.com/cg-baa85e06-1bdd-4672-9e3a-36333c05c6ce/city-of-philadelphia__link_requests__last30.2025-02-28.csv (403): Forbidden

and the pa11y errors:

Errors in http://localhost:8080/metrics/organization/city-of-philadelphia/:

 • This table appears to be used for layout, but contains a caption element.
   Layout tables must not contain captions.

   (#main-content > section > div > div:nth-child(7) > div > table)

   <table class="usa-table usa-table--borderless usa-table--stacked
   full-width"><caption> <a href="...</table>

 • This table appears to be used for layout, but contains a caption element.
   Layout tables must not contain captions.

   (#main-content > section > div > div:nth-child(8) > div > table)

   <table class="usa-table usa-table--borderless usa-table--stacked"><caption>
   <a href="...</table>

 • This table appears to be used for layout, but contains a caption element.
   Layout tables must not contain captions.

   (#main-content > section > div > div:nth-child(9) > div > table)

   <table class="usa-table usa-table--borderless usa-table--stacked"><caption>
   <a href="...</table>

Sketch

If there is an organization in CKAN when we build the site but there is no report for that organization generated by "Fetch reports", then we have to choose what to do. We could (1) generate an empty report CSV for that organization in "Fetch reports" or (2) not generate those pages in the site build process or (3) generate pages that don't fail the pa11y-ci tests.

@neilmb
Copy link
Contributor Author

neilmb commented Mar 4, 2025

Pairing discussion notes: The report for City of Philadelphia is empty because it added a working harvest source for the first time after 2/28 but before 3/3, so we found the org in CKAN when we generated the reports on 3/3, but there is no data in GA for the 2/1-2/28 time frame.

Consensus resolution: fix the 11ty templates so that when they run over orgs with no data, they generate markup that says something like "No data for this month" instead of an empty table which triggers pa11y's ire.

@tdlowden
Copy link
Member

tdlowden commented Mar 5, 2025

@neilmb we can close this now yes?

@neilmb
Copy link
Contributor Author

neilmb commented Mar 5, 2025

Yes, this should be done too now.

@neilmb neilmb closed this as completed Mar 5, 2025
@neilmb neilmb self-assigned this Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software defect or bug
Projects
Status: ✔ Done
Development

No branches or pull requests

2 participants