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.