-
Notifications
You must be signed in to change notification settings - Fork 1
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
Listen for and show publish failure events in progress view #321
Conversation
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.
Just a couple of nits.
Nice and simple overall.
@@ -22,26 +26,46 @@ | |||
:key="index" | |||
> | |||
<q-item-section> | |||
{{ log }} | |||
<template v-if="isErrorLog(log)"> | |||
<span class="text-red text-weight-medium">{{ log.msg }}</span> |
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.
The specification of the actual color should come from the color store as a computed value.
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.
Oh I assumed that we would use the color store if the color wasn't consistently the same. I will switch this over to using the store.
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.
Addressed in 66f712d
I kept it pretty generic colorStore.activePallete.textError
so the error text wasn't specific to the part of the UI we were in. Let me know if you had something else in mind.
import { useColorStore } from 'src/stores/color'; | ||
import { colorToHex } from 'src/utils/colorValues'; | ||
|
||
type AdvancedLog = { |
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.
Perhaps we should move Log type definition outside of PublishStep, and have it located with our other API types?
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 personally comfortable having this type in the PublishStep component for it to specify for itself what it takes a log for its logs
prop.
If this gets re-used in multiple components then I think it should be extracted and shared.
However to touch on your question if it should be located with our other API types - I don't think any type that isn't related to the API responses, API requests, or how we interact with them should be located in the api
module.
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 agree it should, but in this case, aren't you simply replicating exactly what was being sent in on the event message? So I would think it would own the type unless it was changed by the prop? This is where my observation was coming from...
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.
After a discussion we agreed that I am replicating the event msg structure and we can pass that directly to PublishStep
without much issue.
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.
Addressed in 79fdf6e
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.
Thanks for the updates! LGTM!
Failure scenarios tested: Create Bundle: Create Deployment: Restore Python Environment: Run Content: I attempted to give the app a bad import statement and expected this step to fail since it fails in Connect. How is the Recently in rsconnect-python @mmarchetti included a |
Verifying app deployments are live should be a separate issue. For now, you could test having a bad import in a jupyter notebook, which will fail rendering and therefore the deployment. |
This PR makes each step in the publish process subscribe to its correlated
/failure
server side event. It uses the samemsg.data.message
extraction and places that inside of the logs passed toPublishStep.vue
which styleserror
logs and the surrounding expandable section.Preview
Intent
Resolves #302
Type of Change
Approach
My approach here was to make the generic component
PublishStep.vue
style itself differently if it received a log message that was an error. If it contains an error message ithasError = true
which changes the icon, color, and stylizes the error to be semi-bold (medium weight) and red as well.Some TypeScript changes (types and type predicate functions) were needed to distinguish from a generic string log message and an
AdvancedLog
message which kept the usage ofPublishStep.vue
as simple as possible.A lot of the changes in the publish step components is the same other than the event they specifically subscribe to.
Directions for Reviewers
Create an error when publishing to see the error get handled. The easiest example that I used was pointing to a non-existent destination like a stopped
localhost:3939
.Keep in mind we cannot cancel a publish, and an error message doesn't currently set
publishInProgress = false
to allow the usage of the back button. Of course we can change that in another PR or here based on feedback.