Issues icon indicating copy to clipboard operation
Issues copied to clipboard

When using Git source, scoping the branch variable causes unresolvable variable error on create release or runbook run

Open garrettdass opened this issue 1 year ago • 1 comments

Severity

Low

Version

2024.1.4490-hotfix.5037

Latest Version

I could reproduce the problem in the latest build

What happened?

Scoping a bound Branch variable when sourcing from Git repository as a source causes error as #{TheVariable} is not evaluated before the Runbook run or create release.

image Scoping:

image Error:

image

Unscoped evaluates fine and allows Runbook run or create release to be saved:

image

Create release:

image

Reproduction

Steps to reproduce:

  1. Create a custom script step in a Runbook
  2. Choose Git as the script source
  3. Populate everything to use the Git repository
  4. Set the branch parameter to an Octopus variable
  5. Create the Octopus variable and add any scope
  6. Attempt to run the Runbook

Error and Stacktrace

There was a problem with your request.
Unable to retrieve commit details from the provided Git repository at 'https://github.com/garrettdass/garrettdass-repo', for branch '#{BranchVariable}'. Ensure that the Uri and credentials are correct, and try again.

One or more steps with Git resources contain variables which are not resolvable at release creation:
Run a Script

More Information

Customer report: Internal Ticket

Workaround

Unscope Branch variable

garrettdass avatar Dec 21 '23 23:12 garrettdass

I am also experiencing this issue when trying to create a release via the CLI.

Interestingly, it works when I use the UI. It doesn't however, work when I use the CLI.

Which all of our processes and deployments are built around the CLI and not creating releases in the UI. So we would love to see this issue fixed.

It prevents us from testing changes in a branch to a script step template that uses git repository as the script source. Instead, as a workaround I am having to duplicate step templates for each branch in order to test changes to them. Then once I am done with the changes to the scripts I have to manually copy my changes into the right step template. Which gets messy and cumbersome.

image

The only difference between OP and our implementation is we add a parameter to the script step template. And then reference the parameter in the branch settings. Then when we use the step template in a project's process. We type the parameter in: image

image

zackery-parkhurst avatar Apr 12 '24 03:04 zackery-parkhurst

Release Note: Fixed issue where creating a Release or Runbook Snapshot fails if one or more steps have a git dependency referencing variables

octoreleasebot avatar Aug 16 '24 02:08 octoreleasebot

:tada: The fix for this issue has been released in:

Release stream Release
2024.3 2024.3.10989
2024.4+ all releases

Octobob avatar Sep 04 '24 02:09 Octobob