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

Add Sha and Pipeline support to New-GitHubRepositoryBranch #261

Closed
HowardWolosky opened this issue Jul 7, 2020 · 0 comments · Fixed by #277
Closed

Add Sha and Pipeline support to New-GitHubRepositoryBranch #261

HowardWolosky opened this issue Jul 7, 2020 · 0 comments · Fixed by #277
Labels
enhancement An issue or pull request introducing new functionality to the project. in progress Work on this issue is already underway. Please don't work start new work on it.

Comments

@HowardWolosky
Copy link
Member

HowardWolosky commented Jul 7, 2020

Feature Idea Summary

Follow-up from PR feedback:

This should have an optional parameter for Sha. If not supplied, I agree, the function can continue to look up the existing Sha value. However, in the event that a user pipes in a GitHub.Branch object, it should have everything that it needs.

  1. New-GitHubRepositoryBranch should be able to completely take in a GitHub.Branch object as its pipeline input. It should therefore have [Parameter(ValueFromPipelineByPropertyName)] added to $BranchName.
  2. Add-GitHubBranchAdditionalProperties should add Sha as a top-level property that it adds to a GitHub.Branch object.
  3. New-GitHubRepositoryBranch should have an optional Sha property that can receive ValueFromPipelineByPropertyName, and only resorts to looking up the Sha via an additional REST request if it wasn't supplied.

Feature Idea Additional Details

Requested Assignment

- I'm just suggesting this idea, but don't want to implement it.

Operating System

Name               : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2004
WindowsBuildLabEx    : 19041.1001.amd64fre.vb_release_ingestion.191208-1700
OsLanguage           : en-US
OsMuiLanguages       : {en-US, es-MX}

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.19041.1001
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1001
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module Version

Running: 0.14.0
Installed:
@HowardWolosky HowardWolosky added enhancement An issue or pull request introducing new functionality to the project. up for grabs Anyone in the community is welcome to do this work help wanted Anyone in the community is welcome to do this work good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. labels Jul 7, 2020
@HowardWolosky HowardWolosky changed the title Add Sha support to New-GitHubRepositoryBranch Add Sha and Pipeline support to New-GitHubRepositoryBranch Jul 7, 2020
@HowardWolosky HowardWolosky added in progress Work on this issue is already underway. Please don't work start new work on it. and removed good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. help wanted Anyone in the community is welcome to do this work up for grabs Anyone in the community is welcome to do this work labels Aug 13, 2020
HowardWolosky added a commit that referenced this issue Aug 13, 2020
* Updates `New-GitHubBranch` to be able to take a `GitHub.Branch` object as pipeline input (for the base branch)
* Updates `New-GitHubBranch` to be able to take in a `Sha` so that a branch can be created from an arbitrary commit (which also enables a new branch to be created from a `GitHub.Branch` pipeline input value without needing to perform an additional query on `BranchName` to get its `Sha`)
* Updates `GitHub.Branch` to have `Sha` as a top-level property.
* Updated existing tests and added additional tests.

Reference: [GitHub Refs API](https://developer.github.com/v3/git/refs/)

Fixes #261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue or pull request introducing new functionality to the project. in progress Work on this issue is already underway. Please don't work start new work on it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant