wpt-pr-bot
A helper bot for web-platform-tests.
Authoring tests
For the purposes of automated testing, this project uses the replay
module to record responses from the
GitHub HTTP API. Contributors seeking to add new tests or modify existing tests
will need to capture new request/response pairs. This can be achieved as
follows:
- Create a "personal access token" though GitHub.com (no particular access scopes are necessary)
- Set the
GITHUB_TOKENenvironment variable to the value created above, set theREPLAYenvironment variable torecord, and run the tests. - If the tests pass, include the files that were generated by the previous command in the patch.
Development
Requirements:
- Node v16
Getting Started
Download the dependencies
npm installRunning Tests
To lint and run the tests, run:
npm run testDeploying
- Get the secrets:
-
npm run gcp-build
- TODO: Can remove step 1 after #213
-
- Deploy:
-
# Create a variable to represent the version VERSION_ID="rev-$(git rev-parse --short HEAD)" # Deploy the new version but do not promote it gcloud --project=wpt-pr-bot app deploy --no-promote -v "${VERSION_ID}"
-
- Check the logs for the instance
-
gcloud --project=wpt-pr-bot app logs tail -s default -v "${VERSION_ID}" - Check to make sure that the app has started. It should
print
App started in ....
-
- Redirect traffic to the new version.
-
gcloud --project=wpt-pr-bot app services set-traffic default \ --splits="${VERSION_ID}"=1
-
- Keep only 2 versions of the app (VERSION_ID and the previous version).
To delete older versions:
-
# Check the number of versions. There should only be two. gcloud --project=wpt-pr-bot app versions list --service=default # If there are more than two. Get the version id. # Given old version ${REALLY_OLD_VERSION_ID}, delete it. gcloud --project=wpt-pr-bot app versions delete \ ${REALLY_OLD_VERSION_ID} --service=default
-
- Monitor the "Recent Deliveries" tab in wpt. If there are any failures, use the command in step 3 to tail the logs.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
