Skip to content

Create new module to aid in interacting with the RFC repo #168

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

Merged
merged 2 commits into from
May 22, 2019

Conversation

JamesWTruher
Copy link
Contributor

A few functions to help with the RFC repo.
Get-NextRFCNumber will return the next available number for an RFC

NAME
    Get-GitFork

SYNOPSIS
    Get-GitFork [-repoOwner [string]] [-repoName [string]]

    Get-GitFork [-forkurl [string]]]


    -------------------------- EXAMPLE 1 --------------------------

    PS>get-gitfork -repoName PowerShell-RFC | select -first 3

    pushed_at           html_url
    ---------           --------
    4/24/19 10:16:37 PM https://github.com/SydneyhSmith/PowerShell-RFC
    1/16/19 4:34:24 PM  https://github.com/vcgato29/PowerShell-RFC
    11/21/18 6:14:03 PM https://github.com/IISResetMe/PowerShell-RFC


NAME
    Get-LastCommit

SYNOPSIS
    Get the last commit id from a repository


    -------------------------- EXAMPLE 1 --------------------------

    PS>Get-LastCommit -reponame powershell-rfc

    249e8d88eb779a6003fd138609ae94417ae13698



NAME
    Get-MaxRFC

SYNOPSIS
    Get the repo file information for the highest RFC


    -------------------------- EXAMPLE 1 --------------------------

    PS>get-maxrfc

    size  path                                            file_url
    ----  ----                                            --------
    10393 2-Draft-Accepted/RFC0036-AdditionalTelemetry.md https://github.com/PowerShell/PowerShell-RFC/blob/master/2-Draft-Accepted/RFC0036-AdditionalTelemetry.md



NAME
    Get-MaxRFCNumber

SYNOPSIS
    Get the highest RFC number which is actually part of the repo


    -------------------------- EXAMPLE 1 --------------------------

    PS>get-maxrfcnumber

    36



NAME
    Get-PR

SYNOPSIS
    Get the PRs from a repo


    -------------------------- EXAMPLE 1 --------------------------

    PS>Get-PR -state open | select -first 3

    Number Author   Updated          Title
    ------ ------   -------          -----
    9466   RDIL     4/25/19 2:47 PM  Fix gulp in markdown tests
    9460   xtqqczze 4/25/19 4:05 AM  Suppress PossibleIncorrectUsageOfAssignmentOperator rule violation
    9459   xtqqczze 4/24/19 11:48 PM Avoid using Invoke-Expression




NAME
    Get-RepoFileList

SYNOPSIS
    Retrieve the file list from a repository


    -------------------------- EXAMPLE 1 --------------------------

    PS>Get-RepoFileList -repoName "PowerShell-RFC" | Select-Object -First 3

    size path                                            FileUrl
    ---- ----                                            -------
    2498 1-Draft/RFC0003-Lexical-Strict-Mode.md          https://github.com/PowerShell/PowerShell-RFC/blob/master/1-Draft/RFC0003-Lexical-Strict-Mode.md
    6342 1-Draft/RFC0004-PowerShell-Module-Versioning.md https://github.com/PowerShell/PowerShell-RFC/blob/master/1-Draft/RFC0004-PowerShell-Module-Versioning.md

NAME
    Get-RFCPullRequest

SYNOPSIS
    Retrieve pull requestions for the PowerShell-RFC repo


    -------------------------- EXAMPLE 1 --------------------------

    PS>Get-RFCPullRequest -state open | select-object -first 3

    Number Author       Updated          Title
    ------ ------       -------          -----
    167    iSazonov     4/24/19 12:53 PM Enhance some cmdlets with Culture and Comparison parameters
    164    daxian-dbw   4/2/19 7:33 PM   Investigation on supporting module isolation
    163    SydneyhSmith 4/11/19 1:21 AM  Update RFC0004-PowerShell-Module-Versioning.md

There are some other more general git/github tools here as well
Update to use variables instead of duplicated strings
Support authtoken since it's pretty easy to hit Github limits on API call
Use Invoke-RestMethod consistently (rather than Invoke-WebRequest in places)
@JamesWTruher
Copy link
Contributor Author

@SteveL-MSFT please take a look, I think I've updated everything

@SteveL-MSFT SteveL-MSFT merged commit e68275c into PowerShell:master May 22, 2019
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