-
Notifications
You must be signed in to change notification settings - Fork 503
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
fix(check_redirects): make the checks fail fast #7226
Conversation
Ping @caugner |
7dfb281
to
bfd8e7e
Compare
bfd8e7e
to
3f433c8
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.
If the checks fail fast, doesn't this mean that only the first error will be displayed?
Alternatively, could we make sure that all output is prefixed with either info:
or error:
, and additionally prefix the error messages with ❌ to make them easier to discover? (Likewise, skipping could have ➖.)
If a locale has error(s) it'll be processed but remaining locales after it won't be processed. We shouldn't keep the feature (of gathering errors) for that very rare PR. Unless I am missing any historical context, in such case, the contributor will not hesitate to fix redirection errors one by one for each locale. |
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.
Alright, let's stick with throwing, but then we can throw the specific error message directly.
53c4c1a
to
d4da6eb
Compare
After applying the changes:
|
d4da6eb
to
f8d58d4
Compare
Ping @caugner |
Summary
Wrapping original error and failing at the end, after all the checks are done, makes it hard to figure out what went wrong.
Refer mdn/translated-content#8171 (comment)
Problem
The check run https://github.com/mdn/translated-content/actions/runs/3114446745/jobs/5050295335 failed with following log:
There are no colors in GitHub's run logs.
The log before the error
🔥 Errors loading redirects 🔥
message said all went well:info: ✓ redirects for zh-tw looking good!
.So the PR author failed to figure out what actually went wrong:
Solution
Fail fast: we do not have to continue checking remaining locales if one fails.
Fail on the spot: delaying the reporting makes it hard to figure out what and where is went wrong.
Screenshots
Before
After
How did you test this change?
In terminal using command
yarn tool validate-redirects --strict