-
Notifications
You must be signed in to change notification settings - Fork 191
GitHubTeams: Add New/Update/Remove Functions #257
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
GitHubTeams: Add New/Update/Remove Functions #257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional feedback for you to consider.
I've re-added |
@HowardWolosky, this PR is ready for the next review. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
This had some test failures, likely do to timing issues. I see two options forward:
I recommend the first option for this PR. |
@HowardWolosky, I've added delays to the failing tests. Can you re-run the CI? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
d50b6e3
to
a128b92
Compare
@HowardWolosky, this PR is ready for the next review. |
@X-Guardian - I have a backlog of work that I'm getting through, and so I haven't had the chance to re-review your updated PR's quite yet. I should get to your PR's by the end of the weekend. I appreciate your patience here. |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
5b5c1a0
to
34a1abf
Compare
@HowardWolosky, can you run the CI for this PR? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
f262b52
to
1185492
Compare
@HowardWolosky, can you run the CI for this PR? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
@HowardWolosky, can you run the CI for this PR? |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
GitHubTeams.ps1
Outdated
$repositoryFullName = @() | ||
foreach ($repository in $RepositoryName) | ||
{ | ||
$repositoryFullName += "$OrganizationName/$Repository" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$repositoryFullName += "$OrganizationName/$Repository" | |
$repositoryFullName += "$OrganizationName/$repository" |
@@ -1,240 +1,245 @@ | |||
# Copyright (c) Microsoft Corporation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the line endings in this file so that we only see the actual diffs of the changes made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is because this file was originally saved as UTF-8 with BOM. Editing it within GitHub removes the BOM.
...and it's in! Thanks for your contribution here! |
#257 did a fantastic job closing the gap on missing functionality in the module related to GitHub Teams. This PR just adds onto that work by providing options that will reduce the need for additional queries during common operations. * `Get-GitHubTeam`: **Breaking Change** Looking up a team by its `ID` has been deprecated per GitHub documentation. Removed that functionality and added the ability to look up by `slug` instead. This also means that you can now pipe in a team and get back the specific result without needing to filter through all org results. * `Get-GitHubTeamMember`: Updated to use the `slug` instead of the team `ID`. * `New-GitHubTeam`: Added ability to pass in the `ParentTeamId` (also via the pipeline) to avoid the need to query through all org teams. * `Set-GitHubTeam`: Added ability to pass in the team `slug` (also via the pipeline) to avoid the need to query through all org teams. Similar to `New-GitHubTeam`, also added the ability to pass-in the `ParentTeamId` to avoid the full org team lookup. * `Remove-GitHubTeam`: Added ability to pass in the team `slug` (also via the pipeline) to avoid the need to query through all org teams. * Added `Rename-GitHubTeam` as a helper/wrapper on top of `Set-GitHubTeam` * Added additional pipeline tests for existing functions * Added new tests for `Rename-GitHubTeam` and `Get-GitHubTeamMember` * Small update to formatters to simplify the display of the team parent References: [GitHub Teams API](https://developer.github.com./v3/teams/)
Description
This PR adds the following functions to the
GitHubTeams
module:Add-GitHubTeam
Update-GitHubTeam
Remove-GitHubTeam
It also adds the
TeamName
parameter to theGet-GitHubTeam
function to allow getting team details by team name, which is used by the new functions.Pester tests have also been added for the following functions:
Get-GitHubTeam
Add-GitHubTeam
Update-GitHubTeam
Remove-GitHubTeam
Positional Binding has been set as
false
for the three functions, andPosition
attributes added to the function's mandatory parameters.Type view formats have been added for the
GitHub.TeamSummary
andGitHub.Team
types.Issues Fixed
None
References
GitHub Teams API
Checklist
If desired, ensure your name is added to our Contributors list