Skip to content

Conversation

@yyscamper
Copy link
Contributor

  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

jenkins: depends on RackHD/on-tasks#407

@pengz1 @lanchongyizu

error: error
logger.error('Unable to render error profile.', {
error: error,
profileName: name,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'name' is not defined.

@changev
Copy link
Member

changev commented Feb 17, 2017

test this please

@lanchongyizu
Copy link
Member

👍


# 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 ) { %>
Copy link
Member

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

logger.error('Unable to render error template.', {
macaddress: options.macaddress,
error: error
logger.error('Unable to render error profile.', {
Copy link
Member

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" ?

Copy link
Contributor Author

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.

notificationPost: notificationPost,
notificationProgressGet: notificationProgressGet
notificationProgressPost: notificationProgressPost,
//NOTE: in some environment, the HTTP client doesn't support POST, so we have to define
Copy link
Member

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

# to compromise to define below GET api to update progress information, but actually it does the
# job of verb "POST"
get:
operationId: notificationProgressGet
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

Copy link
Member

@pengz1 pengz1 left a 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

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
Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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
@yyscamper yyscamper force-pushed the refactor-os-progress branch from 8828985 to 48d6b10 Compare February 21, 2017 09:05
@yyscamper
Copy link
Contributor Author

jenkins: test this please

@anhou anhou merged commit 7d3a816 into RackHD:master Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants