-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
download-plugins: raise error in case of errors downloading plugins #8788
download-plugins: raise error in case of errors downloading plugins #8788
Conversation
f8f47a3
to
e0d68b6
Compare
e0d68b6
to
8cb5f52
Compare
Technically this is a breaking change since this script is public and people might have relied on it always exiting with code 0. Can you add a flag like Also add an entry to the CHANGELOG to mention this new flag. Thanks :) |
Thank you, that's right, this would be a breaking change. I pushed more commits to introduce a
PS: I'm not sure I correctly understood the suggestion properly about what should be the default behaviour. Since the previous behaviour was reported as incorrect in #7819 , I was thinking that the default behaviour should become to fail on download error. Before I discovered the behaviour, I was assuming that unresolvable entries for plugins in package.json would cause the build to fail, just like the build fails when we there are unresolvable entries for npm packages in package.json. Also, if we keep the current behaviour of tolerating download failures by default and introduce an flag that users would have to pass to make download failures fatal, then this would not be enough to fix #7819 (we would have to do something such as updating documentation so that user pass the flag) |
Signed-off-by: Jérome Perrin <[email protected]>
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.
I'm not sure I correctly understood the suggestion properly about what should be the default behaviour.
@perrinjerome the default should be to fail the build if there are errors when retrieving plugins (that is why it is marked as a breaking change
. This aligns with the expectation from the issue.
@perrinjerome I was asking to not change the default behavior and only throw when adding the flag, this way nothing breaks? |
After discussing with @vince-fugnitto it seems to make sense to throw by default, and have a |
Thank you for your feedback. I have pushed a new commit to name the flag |
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.
@perrinjerome thank you for your changes 👍
Please squash your commits (into a single commit) so we can approve and merge :)
681de54
to
da443ed
Compare
Thank you, I squashed everything in one commit |
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.
@perrinjerome it looks like there is currently a conflict with the changelog
, please rebase, resolve conflicts and squash if necessary 👍
If something went wrong while downloading plugins, the build should be interrupted, instead of creating an environment where some plugins might be missing. A new --ignore-errors flag is added to retain the previous behavior of not failing the build in case of download errors. Signed-off-by: Jérome Perrin <[email protected]>
da443ed
to
41f3080
Compare
@vince-fugnitto thanks ! I rebased and resolved conflict on changelog |
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.
Thank you for the pull-request @perrinjerome!
I verified the following:
- the script successfully downloads plugins
- the script successfully reports errors when plugins cannot be fetched
- the
-i
or--ignore-errors
flag correctly works in suppressing errors
What it does
Fixes: #7819.
If something went wrong while downloading plugins, the build should be
interrupted, instead of creating an environment where some plugins might
be missing.
How to test
One possible way is to add invalid entries in
theiaPlugins
frompackage.json
, for example:and use
yarn download:plugins
.Without these changes, the command exits with success status code:
There are messages in red, yes, but the build report a success.
With the changes from this pull request, the command exit with error status code:
Review checklist
Reminder for reviewers