Unable to Update All step templates when RunOnServer=true

Hi,

A possible bug:

Summary:
When clicking Update All to update all the projects that use a step template, the updates fail if the projects use the step as Run on Octopus Server without specifying any target roles.

Replication steps:

  • Create a step template of type Run a Script.
  • Create one (or more) projects with a step that uses that step template with settings:
    • Run on: Octopus Server
    • On behalf of target roles: [empty]
  • Edit the step template and save your changes.
  • Click on the step template’s Usage tab.
  • Click on the Update All button.
  • The project’s steps are not updated and the UI doesn’t update.

More details:

  • When you click Update All, the front end does a GET for each project that needs updating. The returned JSON for the step looks like e.g:
"Actions" : [{
		"Id" : "f9de3cd8-5ea0-436d-b975-4c0a09e6b14d",
		"Name" : "milestone - deployment start",
		"ActionType" : "Octopus.Script",
		"Environments" : [],
		"Channels" : [],
		"Properties" : {
			"Octopus.Action.Script.Syntax" : "PowerShell",
			"Octopus.Action.Script.ScriptSource" : "Inline",
			"Octopus.Action.Script.ScriptBody" : "Send-DeploymentStartNotification",
			"Octopus.Action.RunOnServer" : "true",
			"Octopus.Action.Template.Id" : "ActionTemplates-43",
			"Octopus.Action.Template.Version" : "4"
		},
		"Links" : {}
	}
]
  • The front end then makes a PUT call to update the step, with the updated JSON looking like:
"Actions" : [{
		"Id" : "f9de3cd8-5ea0-436d-b975-4c0a09e6b14d",
		"Name" : "milestone - deployment start",
		"ActionType" : "Octopus.Script",
		"Environments" : [],
		"Channels" : [],
		"Properties" : {
			"Octopus.Action.Script.Syntax" : "PowerShell",
			"Octopus.Action.Script.ScriptSource" : "Inline",
			"Octopus.Action.Script.ScriptBody" : "Send-DeploymentStartNotification\n",
			"Octopus.Action.Template.Id" : "ActionTemplates-43",
			"Octopus.Action.Template.Version" : 5
		},
		"Links" : {}
	}
]
  • The PUT is missing "Octopus.Action.RunOnServer" : "true",.
  • That’s probably the reason for the update failing and returning:
{
  "ErrorMessage": "There was a problem with your request.",
  "Errors": [
    "Please select one or more roles that this script step will apply to."
  ]
}

Can you confirm whether this is a bug, or whether I need to worry about e.g. my project data being corrupted?

Thanks,
Martin Digon.

Hi Martin,

Thanks for reaching out. The “Update All” button is not a feature included in Octopus. Are you using the BlueFin plugin by any chance? http://bluefin.teapotcoder.com/

If that is the case, perhaps you wanna reach out to the developer behind that project in Twitter or through his github project.

Best regards,
Dalmiro

Hi Dalmiro,

You’re right of course, I hadn’t noticed that button was part of Bluefin! I’ll contact the developer.

Thanks,
Martin.

Yeah, Matt (Bluefin contributor) and I have talked about adding something to the Bluefin features that let’s people know it’s part of Bluefin and not native Octopus Deploy.

Nice to know it integrated that well though from a user’s perspective. :slight_smile:

Just to keep Octopus folk in the loop here’s the issue logged on the Bluefin github repository.

Should have it fixed by the weekend. Maybe tonight.