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

workflows: Allow urls-check to write issues #20166

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/urls-check
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def check_urls(verbose):
if resp.geturl() != url and not any(fnmatch.fnmatch(url, pattern) for pattern in KNOWN_REDIRECTS):
redirects.append(url)
if resp.getcode() >= 400:
failed.append(url)
except urllib.error.URLError:
failed.append(url)
failed.append(f"{url} : {resp.getcode()} {resp.reason}")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this looks a bit unusual/asymmetric, I tested this code path as well, by changing the 400 to 200, and then got:

Checked 177 URLs out of which 1 is/are invalid:
    https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_2.7.1.pdf: 200 OK

except urllib.error.URLError as e:
failed.append(f"{url} : {e.code} {e.reason}")

err = ""
success = ""
Expand Down
Loading