OctopusDeploy / Issues

| Public | Bug reports and known issues for Octopus Deploy and all related tools
https://octopus.com
162 stars 20 forks source link

Deployment build information not associating with an envrionment-scoped dynamic package associated with custom step template #8972

Open patrick-smergut-octopus opened 1 month ago

patrick-smergut-octopus commented 1 month ago

Severity

Currently impacting one customer, could affect many

Version

2024.3.10026

Latest Version

None

What happened?

When a package is selected dynamically based on a project variable in a step template, the build information may not be associated with that deployment.

Build information may not associate with a deployment for a package, in the following scenario:

At the time of this report, it looks like this was working about 1 month ago.

Reproduction

  1. Create a new step template based on a Deploy a Package step, and bind the package to a variable '#{MyPackageName}`
  2. Upload a package to the built-in feed and associate build information with it (e.g. MyPackageWithBuildInfo)
  3. Create a project variable MyPackageName and set the value to the above package MyPackageWithBuildInfo, then scope that value to an environment (e.g. Test)
  4. Add the custom step template Deploy a Package to the deployment process
  5. Create a release with the package version set to the one with build info from Step 3, and deploy it to the scoped environment (Test)
  6. Check the Build Information tab on the deployment and see there is no build information associated

Error and Stacktrace

No response

More Information

First reported here: internal link

Workaround

Use system variables based on a channel to select the package, or hard-code the package name.

tothegills commented 1 month ago

Confirmed this was working in 2024.2

justin-newman commented 3 weeks ago

any chance there is an update on this?

tothegills commented 3 weeks ago

Hi @justin-newman,

Here is the take from the engineering team:

This is expected behaviour, as build information is resolved at the time of release creation, and environments are not yet considered at that stage. Environments only come into play during deployment. Due to this bug fix related to build information, build info is no longer being associated because the #{packageName} variable is scoped to an environment. To restore the behaviour, descope one of the variables and use a 'Default' variable at the time of release creation. The more specifically scoped variable will always override the less specific one.

justin-newman commented 3 weeks ago

Ok, sounds weird! I was able to test this out though. I just changed the scope of the #{PackageType} variable which I was using for the package selection (Full thing was #{Octopus.Project.Name}.#{PackageType} where PackageType is Debug or Release). I removed the specific environment scopes for Debug and just left the Release variable scoped to staging and prod and I seem to be able to get the build information again.