Skip to content

Issue with Projects with Version Control Enabled #1547

@sgoncalvesLGC

Description

@sgoncalvesLGC

Step template

Chain Deployment

Step version

26

Octopus version

2023.4.8354

Step template parameter inputs

No response

What happened

After changing the project to use config as code, the deployment process URL changed to the following:
/api/Spaces-XX/projects/Projects-XX/{gitRef}/deploymentprocesses
With this the deployment process / project information will not show on the endpoint as the deployment process is stored in our git repository.
As the config as code project can have multiple branches, we will need to specify which branch to look for in the deployment process.

So maybe a new parameter to say if uses config as code and another to define the git reference needed?

Reproduction steps

Change a project that uses the Step Template octopus-chain-deployment and enable config as code in it. When it tries to run it will fail with the following message:

╔═══════════════════════════════════════════════╗ 
║                                Creating Release                                                               ║ ╚═══════════════════════════════════════════════╝ 

Project: XX
Project Lifecycle: DB Generic Environments 
Channel: YY
	********app#/Spaces-1/projects/Projects-340 
The remote server returned an error: (404) Not Found.

More Information

In Python I was able to resolve the situation with the following code change (but in this case it needs an evaluation to check if the project has code as config or not):

     # Get project template
    ## Example without version control
    #uri = '{0}api/{1}/deploymentprocesses/deploymentprocess-{2}/template?channel={3}'.format(octopus_server_uri, space['Id'], project['Id'], channel['Id'])
    ## Example with version control
    uri = '{0}api/{1}/projects/{2}/{3}/deploymentprocesses/template?channel={4}'.format(octopus_server_uri, space['Id'], project['Id'], gitRef, channel['Id'])
    template = get_octopus_resource(uri, headers)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions