Skip to content

Conversation

@rbleattler
Copy link
Contributor

PR Summary

  • Added Update-VSTeamGitRepositoryDefaultBranch to allow for changing the default branch of a repository.
  • Fixed bad link in README.md

PR Checklist

… the default branch of a repository.

- Fixed bad link in README.md
Copy link
Contributor

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

Hey @rbleattler thank you for the contribution!

After reviewing it feels like you are not completely sure about your approach with some parts of the code. We need to clarify and clean this up before we can merge it!

CHANGELOG.md Outdated
@@ -1,5 +1,8 @@
# Changelog

- Added Update-VSTeamGitRepositoryDefaultBranch to allow for changing the default branch of a repository.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Added Update-VSTeamGitRepositoryDefaultBranch to allow for changing the default branch of a repository.
## 7.8.0
- Added Update-VSTeamGitRepositoryDefaultBranch to allow for changing the default branch of a repository.

Copy link
Contributor

Choose a reason for hiding this comment

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

For a new freature you can raise the minor version. Can you please do the same in the PS manifest?

# Storing the object before you return it cleaned up the pipeline.
# When I just write the object from the constructor each property
# seemed to be written
# $repo = [vsteam_lib.GitRepository]::new($resp, $ProjectName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain this to me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a remnant from the function I used as a basis for creating this. Will remove and re-commit.

# $Method -eq 'Patch' -and $Uri -eq "https://localhost:8080/tfs/PeopleTracker/PeopleTracker/_apis/git/repositories/00000000-0000-0000-0000-000000000000?api-version=$(_getApiVersion Git)"
# }
# }
# }
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove it if not needed. Or are you not finished yet?

Or do you try to solve something specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to follow convention used in a different test but am not particularly proficient with pester and wanted to get this out there. Apologies for not removing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaning up, and re-committing.


## Assert
Should -Invoke Invoke-RestMethod -ParameterFilter {
Write-Debug "Method : $Method"
Copy link
Contributor

Choose a reason for hiding this comment

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

Mhh this works? Never thought of that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The debug lines (meant to remove, again sorry -- working on this at work while working on some migration stuff so in a time crunch) or the assertion itself?

# area : git
# resourceName : repositories
# routeTemplate : {project}/_apis/{area}/{resource}/{repositoryId}
# http://bit.ly/Add-VSTeamGitRepository
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# http://bit.ly/Add-VSTeamGitRepository
# http://bit.ly/Add-VSTeamGitRepository

Please update this to the same name as the cmdlet

)
begin {
try {
# $Repo = Get-VSTeamGitRepository -Name $Name -ProjectName $ProjectName
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you not using this cmdlet? We are fine to use existing cmdlet to make more complex ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly, I believe I intended to be revert this once the tests were working, but this is related to the aforementioned issue with Pester.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, re-committing.



$body = @{
# name = $Name
Copy link
Contributor

Choose a reason for hiding this comment

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

Also remove as soon as it is clear what you wanna do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaning up, and re-committing.

Bleattler added 3 commits August 18, 2022 09:42
…ze it as something when mocked)

Removed call to dot source common.ps1
Removed debug messages
Cleaned up comments
Bumped Version
Updated Changelog
@rbleattler
Copy link
Contributor Author

Closing and re-opening with proposed changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants