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

Add nightly pa11y scan #3832

Closed
caleywoods opened this issue May 15, 2024 · 5 comments
Closed

Add nightly pa11y scan #3832

caleywoods opened this issue May 15, 2024 · 5 comments
Assignees

Comments

@caleywoods
Copy link
Contributor

Feature suggestion

Create a GitHub/CircleCI action that runs a nightly pa11y scan. If this scan results in pa11y finding issues, it should create a GitHub issue with the details.

@caleywoods
Copy link
Contributor Author

caleywoods commented May 15, 2024

Research findings/approach:

  1. Create a scheduled pipeline run in CircleCI
  2. The .circleci/config.yml needs to have its "Jekyll build" and "Run pa11yci" steps adjusted. "Jekyll build" no longer needs to export the pa11y_targets file contents to the env var nor does it need to source $BASH_ENV and the "Run pa11yci" step should be: ./serve-pa11yci && npm run pa11y-sitemap to do a full scan
  3. A final step should be added that checks to see if the pa11y scan returned any failures and if so it should run the terminal command curl \ -X POST \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/18f/18f.gsa.gov/dispatches \ -d '{"event_type":"pa11y_scan_failure", "client_payload": {"message":"failed_urls_list"}} to dispatch an event to our repo which will trigger the GitHub action we have created that listens for the GitHub repository_dispatch event

The logic to determine if pa11y failed may need to make use of the $BASH_ENV stuff again where we export the failed URL list to an env var in the "Run pa11yci" step and then read it back out to send in the client_payload object when calling the GH API.

@caleywoods
Copy link
Contributor Author

This is working, see #3878 as an example. This issue will be closed soon by a PR.

@caleywoods
Copy link
Contributor Author

@beechnut If you've got the spoons, can you review the rough wiki entry I've created for this? I'm linking directly to the Jekyll plugin portion but the whole thing could use a review. I know we're also in the process of porting the site to Eleventy so if it makes more sense to just let the Jekyll plugin section live as is for now and not spend time on it that makes sense.

https://github.com/18F/18f.gsa.gov/wiki/CircleCI-scheduled-nightly-pa11y-scan#jekyll-plugin

@beechnut
Copy link
Contributor

beechnut commented Jul 9, 2024

@caleywoods What's the status of the nightly scan work here? I'm noticing that both this and the parent ticket say "in progress".

@caleywoods
Copy link
Contributor Author

Closing this issue since the parent ticket tracks this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants