8000 feat(#896): store notification status in workflowrun by supereagle · Pull Request #897 · caicloud/cyclone · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(#896): store notification status in workflowrun #897

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

Merged
merged 2 commits into from
Apr 8, 2019

Conversation

supereagle
Copy link
Member

What this PR does / why we need it:

Add your description

Which issue(s) this PR is related to (optional, link to 3rd issue(s)):

Fixes #896

Reference to #

Special notes for your reviewer:

/cc @zhujian7 @cd1989

Release note:

NONE

@caicloud-bot caicloud-bot requested review from cd1989 and zhujian7 April 7, 2019 12:59
@caicloud-bot caicloud-bot added release-note-none Denotes a PR that doesn't merit a release note. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. labels Apr 7, 2019
@caicloud-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: zhujian7

Assign the PR to them by writing /assign @zhujian7 in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@caicloud-bot caicloud-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 7, 2019
@zhujian7
Copy link
Collaborator
zhujian7 commented Apr 7, 2019

LGTM

// sendNotifications send notifications for workflowruns when:
// * its workflow has notification config
// * finish time after workflow controller starts
// * notification status of workflowrun is not nil
Copy link
Contributor

Choose a reason for hiding this comment

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

notification status of workflowrun is nil ?

// * notification status of workflowrun is not nil
// If the returned notification status is nil, it means that there is no need to send notification.
func (h *Handler) sendNotifications(wfr *v1alpha1.WorkflowRun) (map[string]v1alpha1.NotificationStatus, error) {
// No need to send notifications for workflowruns finished before workflow controller starts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't describe all the conditions in the if clause.

Copy link
Member Author

Choose a reason for hiding this comment

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

Remove this, have included in method comments.

return err
}

if !reflect.DeepEqual(latest.Status.Notifications, status) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does latest.Status.Notifications == nil suffices ?

// If the returned notification status is nil, it means that there is no need to send notification.
func (h *Handler) sendNotifications(wfr *v1alpha1.WorkflowRun) (map[string]v1alpha1.NotificationStatus, error) {
// No need to send notifications for workflowruns finished before workflow controller starts.
if wfr.Spec.WorkflowRef == nil || wfr.Status.Notifications != nil ||
Copy link
Contributor

Choose a reason for hiding this comment

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

wfr.Spec.WorkflowRef == nil is an abnormal condition, I think we should report error instead of keep silent

@cd1989
Copy link
Contributor
cd1989 commented Apr 8, 2019

/lgtm

@caicloud-bot caicloud-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@supereagle supereagle force-pushed the notification-status branch from ab38b82 to bcd9ea7 Compare April 8, 2019 02:32
@caicloud-bot caicloud-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@cd1989
Copy link
Contributor
cd1989 commented Apr 8, 2019

/lgtm

@caicloud-bot caicloud-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@cd1989 cd1989 merged commit 40dacb0 into caicloud:master Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0