Can't select the right package for release versioning

I have a custom step that take 5 packages as parameters.
I want to select the second package for the release versioning of the project but I can’t.
When I select the package it’s always select the first package of this step and if I save it display the name of the last package of the step whereas I selected neither of them.

Here is a screen recording of the issue :
OctopusDeploySelectIssue

1 Like

Hey @kevin.petit,

Thanks for reaching out!
Sorry to hear you’re experiencing this issue.

Thanks for reporting this! I’m going to have a poke around on my side and see if I can reproduce it, what potential workarounds I can suggest and if it’s a bug - log it as such.

I’ll keep you informed of my progress, if you have any questions then please feel free to throw them in this thread and I’ll do my best to answer them.

Kind Regards,
Adam

Hey, again @kevin.petit,

I’ve confirmed that what you’re seeing is indeed happening on my end!
I’ll get a bug report sorted out ASAP, and I’ll pin it to this thread for anyone else to see and for yourself to follow.

In the meantime, I’ve configured a workaround that I’ve tested and worked on the cloud instance I was testing on.

# Create Script Variables
$octopusUrl = "https://octopusURL"
$octopusAPIKey = "API-XXXXXXXXXXXXXXXXXXXXXXXX"
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$spaceId = "Spaces-ID"
$projectName = "project name"
$packageName = "package name"

# Obtain Project data
$projectData = Invoke-RestMethod -Method Get "$($octopusUrl)/api/$($spaceId)/projects/$($projectName.Replace(" ", "-").ToLower())" -Headers $header

# Obtain Deployment Settings
$depSettings = Invoke-RestMethod -Method Get "$($octopusUrl)/$($projectData.Links.DeploymentSettings)" -Headers $header

# Set New Package Reference
$depSettings.VersioningStrategy.DonorPackage.PackageReference = $packageName

# API PUT New Settings
Invoke-RestMethod -Method Put "$($octopusUrl)/$($projectData.Links.DeploymentSettings)" -Body ($depSettings | ConvertTo-JSON -Depth 10) -Headers $header

Before running this script, be sure that the current package selected for versioning is one in the same step as what you’re planning to set it to.

Example:
Squirrel/Nuget is the package “Nuget” from the step ‘Squirrel’. If this was selected, you can run the script below to change to any package located within the step ‘Squirrel’, such as “Package”.

In your situation, as shown in the video above, you could place:
“Package”, “PsExec”, “SendTokenPin” in the packageName field.

The projectName field is turned into slugs for the API to use, so typing this as it appears in the UI is fine.

Please make sure that you read and understand the script before using it, as incorrectly putting the wrong data into these fields can cause nasty “Resource Not Found” errors.

Running the above script allowed me to set the correct package for versioning, but there was a weird interaction in the UI.

It shows the correct package is selected upon opening Deployment Settings, but when you click on “Release Versioning”, it shows the first package again - this is simply visual as querying the API endpoint shows the correct package, and when creating a release, the correct version is selected.

I hope this helps! As I mentioned, I’ll log the bug and post it back to this thread. If you have any questions or concerns, please reach out, and I’ll do my best to assist.

Kind Regards,
Adam

1 Like

Bug Report: GitHub Issue #7283 - Release Versioning is forced based on the first Package from step with multiple package references.