MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
445 stars 155 forks source link

Update Get-VSTeamRelease cmldet to get release via artifact ids #374

Closed hkarthik7 closed 3 years ago

hkarthik7 commented 3 years ago

PR Summary

Summary is in the comment below.

PR Checklist

hkarthik7 commented 3 years ago

Hi ya @SebastianSchuetze, @DarqueWarrior

I have added a new parameter 'artifactVersionId' to the function 'Get-VSTeamRelease'. I found this helpful as we can retrieve the associated release for a build using buildId(or artifactVersionId). I encountered a scenario where I had to fetch the list of pull requests and get it's associated build and releases, I was able to get the list of builds associated to a pull request but not the direct release associated to that build. Hence tried to achieve this by adding artifactVersionId to the function 'Get-VSTeamRelease'.

This is working in my local dev environment and I'm using Windows 2016 Datacenter.

Apologies for failing the checks.

hkarthik7 commented 3 years ago

@SebastianSchuetze there seems to be an issue only in the new test added, I tried to debug it locally and couldn't get through. Would you mind taking a look for me please?

Here is the modified version, I haven't pushed it to the repository yet as I'm afraid it may fail too.


It 'with build Id should return release as Object' {
         ## Act
         Get-VSTeamRelease -ProjectName VSTeamRelease -artifactVersionId 101

         ## Assert
         Should -Invoke Invoke-RestMethod -Exactly -Scope It -Times 1 -ParameterFilter {
            $Uri -eq "https://vsrm.dev.azure.com/test/VSTeamRelease/_apis/release/releases?api-version=$(_getApiVersion Release)&artifactVersionId=101"
         }
}
SebastianSchuetze commented 3 years ago

@hkarthik7 it doesn't matter if it fails or the number commits you to have to do. This is why we have the build. And for the number of commits and the history, we do a squash merge anyways.

DarqueWarrior commented 3 years ago

Why was this closed? Did I miss something?

hkarthik7 commented 3 years ago

Hi ya, sorry about that I closed it by mistake.