-
Notifications
You must be signed in to change notification settings - Fork 66
Add mechanism to communicate back to Bitballoon from Build Plugins #735
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
Comments
Yes I agree. At the moment plugins can do this by throwing an error but as @jlengstorf points out in this comment (thumbed up by one of our users @talves), this does not allow differentiating between bugs/crashes and assertion/validation errors. The syntax chosen by @jlengstorf was I think this question is also related to cancelling builds (#241), which are basically the same thing with the additional requirement that the error also marks the build as "cancelled": We could merge those 3 different proposals into a single API: // Stops plugin but does not stop build
utils.build.error('message')
// Stops plugin and stops build
utils.build.terminate('message')
// Same but also mark the build as cancelled in the UI
utils.build.cancel('message') If we ever need to expand those methods, we can add a options object optional parameter. What do you think? |
I like where you're going, @ehmicky — I think I'd push for more verbose names, though, to make it easier to infer what will happen perhaps something like this? // stops plugin but does not stop build
utils.build.recoverableError('message')
// or
utils.build.logErrorAndContinue('message')
// stops both
utils.build.failBuild('message')
// or
utils.build.logErrorAndTerminate('message')
// cancel
utils.build.cancelBuild('message')
// or
utils.build.logErrorAndCancel('message')
|
Yes this makes sense. What about using your first examples but dropping the // stops plugin but does not stop build
utils.recoverableError('message')
// stops both
utils.failBuild('message')
// cancel
utils.cancelBuild('message') |
I think it makes sense to have a single util/namespace. Let's keep in mind that this API can be added to or superseded without having to break things. We're going to learn a lot over the beta and we'll be able to make better informed design decisions in the future. For now, let's go with:
No one expects logging an error to fail anything, and the other two are pretty self explanatory. |
Sure this makes sense. utils.build.logError()
utils.build.fail()
utils.build.cancel() |
@vbrown608 @mraerino this is the API we're looking at for minimal communication from plugins back to the API, are there related tickets we should link for backend support? (Added Marcus as he provided related feedback to @DavidWells.) |
Looks like this is just related to access for cancellation and logging. Access to cancellation was added by https://github.com/netlify/bitballoon/pull/5467. Still need to complete https://github.com/netlify/buildbot/issues/583 (make buildbot consume that token and pass it to netlify-builds). I'm starting that today. In terms of logging, we're discussing that here: https://github.com/netlify/bitballoon/issues/5468 - basically buildbot should send logs directly to firebase rather than going through bitballon |
Does It seems like the name |
This is confusing to me as well. What is the use case of |
I think the original idea from @jlengstorf was for recoverable errors, i.e. when the plugin should fail, but not the whole build. However the current name I suggest renaming
Also I think calling the namespace
What do you think? |
Current status update of this feature:
What's left:
|
@ehmicky I know we made progress here, can you provide a quick status update? |
The
|
Nice!! If the utilities work is complete, we can close this and use #711 to drive requirements for surfacing errors in the UI. |
We need a way to communicate back to bitballoon from build plugins.
If an error occurs, it would be great if we can surface those issues to users like described in #711 (comment)
Additionally plugin outputs & other data would likely need to pipe back into the deploy UI of app.netlify.com to enhance the experience. You an imagine this structured information being shown on the deploy summary for example:
So we need some sort of mechanism to pass back errors / stack traces when build fail.
Additionally we need a mechanism that will allow plugins to communicate back and display additional information (in deploy summary or elsewhere depending on where design lands)
Perhaps something like:
However it materializes, we should keep in mind how this can & should evolve.
Related #161
The text was updated successfully, but these errors were encountered: