-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Proof of Concept: Testing for docs.python.org redirects #499
Conversation
Interested in @AA-Turner and @JacobCoffee's thoughts here. |
ab57468
to
730e716
Compare
730e716
to
8baa9fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good, but this just means docs contributors will need to write there tests as well as the redirect changes?
If so, rebasing #498 onto this and adding those tests would be nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also cc @JulienPalard
Could we add some notes or a brief guide on how we should run this locally? I see it runs in CI, but I'd like to try and avoid pushing many commits to test something.
How extensive should the tests be? What should we be testing for? What do good hurl tests look like?
A
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restricting branches is unhelpful for testing against CI when needed:
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
on: | |
push: | |
paths: | |
- "salt/docs/**" | |
- "test/docs/redirects/**" | |
pull_request: | |
paths: | |
- "salt/docs/**" | |
- "test/docs/redirects/**" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses: actions/checkout@v3 | |
uses: actions/checkout@v4 |
permissions: | ||
contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set permissions at the workflow level
permissions: | |
contents: read |
Most of the specifics are up for debate. Probably the main thing to consider if the test specifications in the hurl file are acceptable. hurl is pretty extensible for testing, but for our concern here of making sure new redirects act as expected and are well defined the status code and resulting Backfilling tests for old redirects will be a chore, but probably worth doing. Big advantage would be ensuring that our existing redirects aren't broken or interfered with by new ones. If there's value seen here, it's probably worth wrapping as much of this up into containers as possible, putting behind a make target, and documenting. Probably more usefully, I found it much more ergonomic and faster feedback for playing with the redirect from your other outstanding PR (a few seconds per run vs running a full salt hullabaloo). |
oh snap. incredible @AA-Turner! I'll review them serially. |
Description
Right now we have lots of docs redirects and they are pretty complex and difficult to scrute.
This is a proof of concept for extracting those redirects to a separate file so we can stand it up in a bare-bone nginx docker container to run automated tests against.
This should be helpful for people developing redirects and let PSF Infra more readily merge changes like #498
Requires docker and
hurl
to be installed locally.