Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Package control type can't be used in script source

Open Clare-Octopus opened this issue 1 year ago • 1 comments

Severity

Blocking a few customers using custom step templates, workaround exists.

Version

2023.3.4541, 2024.1.12087, 2024.2.2914

Latest Version

I could reproduce the problem in the latest build

What happened?

When creating custom Step Templates with a Parameter that's of Package type, the option to let the project select the package doesn't appear in the step, instead giving a warning message when the Template is added to a Project:

This parameter is not currently used by the step, it might have been replaced by another parameter

image

Workaround is shown at the bottom of this GitHub issue.

Our engineers mentioned this as a missing functionality.

Reproduction

  1. Create a step template, choosing “Run a script” as the base step.
  2. Add a parameter “MyPackage” with the control type “Package”.
  3. In the step’s “Script source”, choose “Package”
  4. Enable “Bind” on Package ID, and set #{MyPackage} as the value, make sure you give the script a filename and save it. (Note - I can also get this to break if I don't bind the field and I use the dropdown option to select a package from the feed).
  5. Try to add this step template to any deployment process. It won’t let you select a package, saying:

This parameter is not currently used by the step, it might have been replaced by another parameter.

Error and Stacktrace

This parameter is not currently used by the step, it might have been replaced by another parameter

More Information

Old forum post where this was initially mentioned (the forum is no longer in use) - https://help.octopus.com/t/step-template-package-parameter-not-usable-because-it-is-not-used-by-the-step-even-though-im-referencing-it/29184

R and D thread for this (internal) - https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1688535818633209

Workaround

Adding the package as an additional reference in the step template allows for the package selection option to appear in the project step:

image

You will need to ensure you chose choose Let the project select the package:

image

This then allows you to pick a package when adding that step template to a step:

image

Clare-Octopus avatar Mar 27 '24 14:03 Clare-Octopus

Tickets in so far for this (internal):

  • https://octopus.zendesk.com/agent/tickets/154573
  • https://octopus.zendesk.com/agent/tickets/176938

Clare-Octopus avatar Mar 27 '24 15:03 Clare-Octopus