-
Notifications
You must be signed in to change notification settings - Fork 77
Refactor OS installation progress #591
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
Conversation
lib/services/common-api-presenter.js
Outdated
| error: error | ||
| logger.error('Unable to render error profile.', { | ||
| error: error, | ||
| profileName: name, |
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.
'name' is not defined.
1daab9d to
8828985
Compare
|
test this please |
|
👍 |
|
|
||
| # The progress notification is just something nice-to-have, so progress notification failure should | ||
| # never impact the normal installation process | ||
| <% if( typeof progressMilestones !== 'undefined' && progressMilestones.enterProfileUri ) { %> |
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.
this code line is mixed in comments, the comments below could be indented
lib/services/common-api-presenter.js
Outdated
| logger.error('Unable to render error template.', { | ||
| macaddress: options.macaddress, | ||
| error: error | ||
| logger.error('Unable to render error profile.', { |
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 logs should be "Unable to render boilerplate.ipxe" ?
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 error occurs when both the input profile & boilerplate.ipxe rendering fail, but the error input profile is really something we care while analyzing log, so I don't think your log message is better than the original one.
lib/api/2.0/notification.js
Outdated
| notificationPost: notificationPost, | ||
| notificationProgressGet: notificationProgressGet | ||
| notificationProgressPost: notificationProgressPost, | ||
| //NOTE: in some environment, the HTTP client doesn't support POST, so we have to define |
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.
'environments' could you help provide the example 'ipxe' explicitly for understanding
static/monorail-2.0-sb.yaml
Outdated
| # to compromise to define below GET api to update progress information, but actually it does the | ||
| # job of verb "POST" | ||
| get: | ||
| operationId: notificationProgressGet |
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.
how about using 'notificationProgressPost' directly, it could avoid confusion in two places( another is "notificationProgressGet: notificationProgressPost" ) and avoid you have to comments in two places.
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.
Good idea
pengz1
left a comment
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.
+1 after update comments
lib/api/2.0/notification.js
Outdated
| notificationProgressGet: notificationProgressGet | ||
| notificationProgressPost: notificationProgressPost, | ||
| //NOTE: in some environment, the HTTP client doesn't support POST, so we have to define | ||
| //a ugly API which use verb GET to update the progress information |
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.
a =>an, use => uses
| Task instance identifier | ||
| required: true | ||
| The identifier of task instance which the progress applies to | ||
| required: false |
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.
Without taskId, progress actually can't work, suppose it is required.
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.
Actually if the progress data is embedded in http request body, then the taskId is optional in query.
| in: query | ||
| description: | | ||
| The identifier of task instance which the progress applies to | ||
| required: false |
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.
taskId should be required
1. Directly reference the milestone definition rather than the raw value. 2. Change all progress notification to be sent via URI /notification/progress 3. Explain the strange implemention for GET /notification/progress 4. Remove totalSteps/currentStep, always use the typic variable maximum/value
8828985 to
48d6b10
Compare
|
jenkins: test this please |
jenkins: depends on RackHD/on-tasks#407
@pengz1 @lanchongyizu