dmitryserbin / azdev-release-orchestrator

Azure DevOps extension to manage and orchestrate release pipelines
MIT License
23 stars 12 forks source link

Take default release pipeline artifact version #59

Closed LunicLynx closed 3 years ago

LunicLynx commented 3 years ago

Hello @dmitryserbin ,

first let me thank you for this awesome extension. The quality overall feels in comparison to other extensions really high. 👍

But we have one issue. We use the extension to start a really big other release with 20+ artifacts. The artifact filter does only apply to the primary artifact, which probably is the best compromise without making it really complicated. Unfortunately for all other artifacts the latest version is choosen which is not the default behavior when triggerin the artifact directly. We setup our release to use a release variable to specify the branch we want for some of the artifacts. So my first try was to set this variable via release orchestrator. This did also not effect the outcome.

I then turned on the debug output, and saw that for every artifact there is a given default version. This version looks correct for our case.

Here is an exempt from our log:

release-orchestrator:ReleaseHelper:getArtifacts { sourceId: 'yyy',
   alias: 'Build',
   versions:
    [ { id: '124',
        name: '1.0',
        definitionId: '5',
        definitionName: 'abc',
        sourceBranch: 'refs/heads/main',
        sourceVersion: 'xx',
        sourceRepositoryId: 'xx',
        sourceRepositoryType: 'TfsGit' },
        ...
       ],
   defaultVersion:
    { id: '123',
      name: '1.1-rc',
      definitionId: '5',
      definitionName: 'abc',
      sourceBranch: 'refs/heads/develop',
      sourceVersion: 'xx',
      sourceRepositoryId: 'xx',
      sourceRepositoryType: 'TfsGit' },
   errorMessage: null }

Please verify my proposed change, i think this should fix it.

dmitryserbin commented 3 years ago

Hi @LunicLynx! Thanks for using the Orchestrator and for your kind feedback.

It's a good find, I'm glad you have already found the solution. I just need to run it through my CI release pipeline to get the task tested in Azure DevOps environment. I also might need to reproduce your scenario to make sure it works as expected with multiple artifacts.

I'll try to get this done within the next day or two. Will keep you updated.

LunicLynx commented 3 years ago

Thanks for your fast response!

Here are some more detailed steps to reproduce the issue:

  1. Create 2 release pipelines.
  2. Create 2 build pipelines with artifacts.
  3. Make builds so that one pipelines latest is from master while the seconds latest build is from dev.
  4. Add both artifacts to one of the release pipelines. Remember which will be the primary artifact.
  5. Set the the Default Version to Latest from a specific branch with tags to either master or dev for both artifacts. Just ensure both artifacts have the same branch.
  6. Add release orchestrator to the other release pipeline, and set it up to trigger the previously setup pipeline.
  7. Trigger a release.

It should now be apparent that for the non primary build artifact the latest is choosen over what we defined in step 5.

If i can help in any way please let me know.

dmitryserbin commented 3 years ago

/azp run

azure-pipelines[bot] commented 3 years ago
Azure Pipelines successfully started running 1 pipeline(s).
dmitryserbin commented 3 years ago

Released under v2.0.826 @LunicLynx

LunicLynx commented 3 years ago

@dmitryserbin awesome thank you!