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

Improvements to GitHub Team API's #275

Merged
merged 10 commits into from
Aug 14, 2020

Conversation

HowardWolosky
Copy link
Member

Description

#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 capitalize and simplify headers, and simplify the display of the team parent

Issues Fixed

n/a

References

GitHub Teams API

Checklist

  • You actually ran the code that you just wrote, especially if you did just "one last quick change".
  • Comment-based help added/updated, including examples.
  • Static analysis is reporting back clean.
  • New/changed code adheres to our coding guidelines.
  • Formatters were created for any new types being added.
  • New/changed code continues to support the pipeline.
  • Changes to the manifest file follow the manifest guidance.
  • Unit tests were added/updated and are all passing. See testing guidelines. This includes making sure that all pipeline input variations have been covered.
  • Relevant usage examples have been added/updated in USAGE.md.
  • If desired, ensure your name is added to our Contributors list

@HowardWolosky HowardWolosky added enhancement An issue or pull request introducing new functionality to the project. breaking change This includes a change in existing published module behavior. api-teams Work to complete the API's defined here: https://developer.github.com/v3/teams/ labels Aug 12, 2020
@HowardWolosky
Copy link
Member Author

/azp run PowerShellForGitHub-CI

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@HowardWolosky
Copy link
Member Author

@X-Guardian - Leaving this up a day before merging it in in case you have any feedback on it.

@HowardWolosky
Copy link
Member Author

/azp run PowerShellForGitHub-CI

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

<PropertyName>permission</PropertyName>
</ListItem>
<ListItem>
<Label>Created</Label>
Copy link
Contributor

Choose a reason for hiding this comment

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

I always find it annoying when the default view of an object shows label names that don't exist as properties on the object. I.e for this, if I try and read $Team.Created I will not get the desired result. I will then have to run $Team | Fl -Property * to get the actual property name created_at. Same for the updated labels below. If you want to do this, you should build the output object with these new property names.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is interesting feedback that I hadn't considered, and I appreciate it. I'll make that change (and change Parent to be parent.name).

@HowardWolosky
Copy link
Member Author

/azp run PowerShellForGitHub-CI

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@HowardWolosky HowardWolosky merged commit 9ef3c2b into microsoft:master Aug 14, 2020
@HowardWolosky HowardWolosky deleted the teamslug branch August 14, 2020 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-teams Work to complete the API's defined here: https://developer.github.com/v3/teams/ breaking change This includes a change in existing published module behavior. enhancement An issue or pull request introducing new functionality to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants