Skip to content

Conversation

@ono-max
Copy link
Member

@ono-max ono-max commented Nov 4, 2021

What this PR does / why we need it:
This PR is related to #2742, but doesn't fix it. The following picture is an example.

Screen Shot 2021-11-10 at 16 36 35

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Send notification events when it fails to trigger deployment

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/piped/notifier/slack.go
--- pkg/app/piped/notifier/slack.go.orig
+++ pkg/app/piped/notifier/slack.go
@@ -213,7 +213,7 @@
 		md := event.Metadata.(*model.NotificationEventPipedStopped)
 		title = "A piped has been stopped"
 		generatePipedEventData(md.Id, md.Name, md.Version, md.ProjectId)
-	
+
 	case model.NotificationEventType_EVENT_PIPED_FAILED:
 		md := event.Metadata.(*model.NotificationEventPipedFailed)
 		title = "A piped failed to start"

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.09%. This pull request decreases coverage by -0.02%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/piped/trigger/deployment.go
--- pkg/app/piped/trigger/deployment.go.orig
+++ pkg/app/piped/trigger/deployment.go
@@ -190,7 +190,7 @@
 		Metadata: &model.NotificationEventDeploymentTriggerFailed{
 			Application: app,
 			Commit: &model.GitCommit{
-				Hash: commit.Hash,
+				Hash:    commit.Hash,
 				Message: commit.Message,
 			},
 			Reason: reason,

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.08%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/notifier/slack.go makeCommitLink -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@ono-max
Copy link
Member Author

ono-max commented Nov 5, 2021

I modified some fields as follows:

Screen Shot 2021-11-05 at 16 16 02

@ono-max ono-max requested a review from nghialv November 5, 2021 07:17
@ono-max
Copy link
Member Author

ono-max commented Nov 5, 2021

@nakabonne @nghialv

Updated 👍

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.08%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/notifier/slack.go makeCommitLink -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@ono-max ono-max requested a review from nghialv November 10, 2021 01:40
@ono-max
Copy link
Member Author

ono-max commented Nov 10, 2021

@nghialv

Updated 👍

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.08%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/notifier/slack.go makeCommitLink -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.07%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.07%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@ono-max
Copy link
Member Author

ono-max commented Nov 10, 2021

@nakabonne @khanhtc1202

Thanks! Updated 👍

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.07%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@ono-max ono-max requested a review from nakabonne November 10, 2021 08:30
@ono-max
Copy link
Member Author

ono-max commented Nov 10, 2021

@nakabonne

Updated 👍

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/piped/notifier/slack.go
--- pkg/app/piped/notifier/slack.go.orig
+++ pkg/app/piped/notifier/slack.go
@@ -172,7 +172,7 @@
 				{"Commit", makeSlackLink(truncateText(msg, 8), commitURL), true},
 			}
 		}
-		
+
 	}
 	generatePipedEventData := func(id, name, version, project string) {
 		link = fmt.Sprintf("%s/settings/piped?project=%s", webURL, project)

@ono-max
Copy link
Member Author

ono-max commented Nov 10, 2021

/golinter fmt

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.07%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.07%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed -- 0.00% +0.00%
pkg/app/piped/notifier/slack.go slack.buildSlackMessage 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% 0.00% +0.00%

@nakabonne
Copy link
Member

There you go. Can't wait to show off this!
/lgtm

@nghialv
Copy link
Member

nghialv commented Nov 11, 2021

Good job!
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit d347f79 into master Nov 11, 2021
@pipecd-bot pipecd-bot deleted the send-notification branch November 11, 2021 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants