Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

hkarthik7
Copy link
Contributor

@hkarthik7 hkarthik7 commented Nov 10, 2020

PR Summary

Summary is in the comment below.

PR Checklist

@hkarthik7
Copy link
Contributor Author

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.

Copy link
Collaborator

@SebastianSchuetze SebastianSchuetze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you can get the unit tests running on the agents then it would be fine. On first sight I can't see why they are not going through.

@hkarthik7
Copy link
Contributor Author

hkarthik7 commented Nov 11, 2020

@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
Copy link
Collaborator

SebastianSchuetze commented Dec 19, 2020

@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.

Copy link
Contributor Author

@hkarthik7 hkarthik7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SebastianSchuetze, I have updated the changes. Thank you.

@hkarthik7 hkarthik7 closed this Feb 22, 2021
@DarqueWarrior
Copy link
Collaborator

Why was this closed? Did I miss something?

@hkarthik7
Copy link
Contributor Author

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

@hkarthik7 hkarthik7 reopened this Feb 28, 2021
Copy link
Collaborator

@SebastianSchuetze SebastianSchuetze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@SebastianSchuetze SebastianSchuetze added the enhancement Improvements that do not include new features label Jun 25, 2021
@SebastianSchuetze SebastianSchuetze changed the title Vsteam release cmdlet update Update Get-VSTeamRelease cmldet to get release via artifact ids Jun 25, 2021
@SebastianSchuetze SebastianSchuetze merged commit b7431d1 into MethodsAndPractices:trunk Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements that do not include new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants