-
Notifications
You must be signed in to change notification settings - Fork 7
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 an automatic check that URL redirects work #1089
Labels
enhancement
New feature or request
Comments
StevenMaude
changed the title
Add an automatic check that redirects work
Add an automatic check that URL redirects work
Jan 11, 2023
As a semi-automated process: test $(cut -f1 -d' ' _redirects | awk '{print "https://3b9cf57d.opensafely-docs.pages.dev"$0}' | xargs -n1 curl -o /dev/null --silent --head --write-out '%{url_effective} '%{http_code}' \n' | grep "404" | wc -l) -eq 0 displays the URL and status code for each redirect, assuming a 404 catches every issue (which it possibly doesn't). The better approach would be to compare the status code from the |
StevenMaude
added a commit
that referenced
this issue
Jan 12, 2023
I have no idea why the ordering has an effect, but it does. The redirects were checked by eye using a variant of the bash one-liner in #1089: ```sh cut -f1 -d' ' _redirects | awk '{print "$OPENSAFELY_PREVIEW_URL"$0}' | xargs -n1 curl -o /dev/null --silent --head --write-out '%{url_effective} '%{http_code}' \n' ``` The preview URL depends on the deployment, which depends on the commit, so can't easily get the actual URL in there.
StevenMaude
added a commit
that referenced
this issue
Jan 12, 2023
I have no idea why the ordering has an effect, but it does. The redirects were checked by eye using a variant of the bash one-liner in #1089: ```sh cut -f1 -d' ' _redirects | awk '{print "$OPENSAFELY_PREVIEW_URL"$0}' | xargs -n1 curl -o /dev/null --silent --head --write-out '%{url_effective} '%{http_code}' \n' ``` The preview URL depends on the deployment, which depends on the commit, so can't easily get the actual URL in there.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #1064, I found that some redirects I added weren't working as expected. I'm still not sure why that is yet.
Depending on the reason for it (are we encountering a limit? or is it something more subtle?) we might want to add a scheduled check that:
The text was updated successfully, but these errors were encountered: