Skip to content
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

feat(tasks): allow notifications for tasks #668

Merged
merged 1 commit into from
Oct 2, 2019

Conversation

emjburns
Copy link
Contributor

@emjburns emjburns commented Oct 2, 2019

Right now we can't send notifications for tasks. Why? Not sure. This code is 2015 vintage.

This PR adds support for sending notifications for tasks:

"trigger": {
		"notifications": [
			{
				"address": "#myslackchannel",
				"level": "pipeline",
				"type": "slack",
				"when": [
					"orchestration.starting",
					"orchestration.complete",
					"orchestration.failed"
				]
			}
		]
	},

It also moves some error handling from subclasses to the parent class because of 💁style.

if (config.type == 'stage') {
String stageName = event.content.name ?: event.content?.context?.stageDetails?.name
message = """Stage $stageName for """
if (config.type == 'pipeline' || config.type == 'stage') {
Copy link
Member

Choose a reason for hiding this comment

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

Pulling on a thread here... I think we may want to isExecution(config.type) here as well. I bet the other notification agents also have similar conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about I save those improvements for going through and cleaning up all the notification logic?

@emjburns emjburns merged commit c3d4e5b into spinnaker:master Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants