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

feat: create a branch from origin owner, repo, branch name, and an optional primary branch #27

Merged
merged 9 commits into from
Jul 13, 2020

Conversation

TomKristie
Copy link
Contributor

This PR implements the basic functionality of creating a branch and has basic mock test.

Given:

  • an owner
  • a repository
  • a branch name
  • an optional primary branch name

Correctly create a new GitHub reference based off the primary branch HEAD SHA.
On successful reference creation, the GitHub API (wrapped by Octokit) returns the base SHA for new commits to be applied on top of.

On GitHub API error, log error and re-throw the error. On primary branch not found error, throw that error.

This PR also groups repository domain data together, and reverts accidental .gitattribute and synth.metadata changes

Towards #19

@TomKristie TomKristie requested a review from a team as a code owner July 10, 2020 18:39
@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #27 into master will increase coverage by 13.67%.
The diff coverage is 84.16%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #27       +/-   ##
===========================================
+ Coverage   44.69%   58.36%   +13.67%     
===========================================
  Files           6        7        +1     
  Lines         179      281      +102     
  Branches        4       11        +7     
===========================================
+ Hits           80      164       +84     
- Misses         99      117       +18     
Impacted Files Coverage Δ
src/github-handler/index.ts 0.00% <0.00%> (ø)
src/types/index.ts 0.00% <0.00%> (ø)
src/github-handler/branch-handler.ts 98.91% <98.91%> (ø)
src/github-handler/fork-handler.ts 98.07% <100.00%> (-0.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 362124e...d2e17aa. Read the comment docs.

.gitattributes Outdated Show resolved Hide resolved
synth.metadata Outdated Show resolved Hide resolved
@TomKristie TomKristie requested review from chingor13 and removed request for a team July 10, 2020 18:55
.gitattributes Outdated Show resolved Hide resolved
src/github-handler/branch-handler.ts Outdated Show resolved Hide resolved
src/github-handler/branch-handler.ts Outdated Show resolved Hide resolved
src/types/index.ts Show resolved Hide resolved
src/github-handler/branch-handler.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits

src/github-handler/branch-handler.ts Outdated Show resolved Hide resolved
src/github-handler/branch-handler.ts Outdated Show resolved Hide resolved
test/branch.ts Outdated Show resolved Hide resolved
test/branch.ts Outdated Show resolved Hide resolved
@TomKristie TomKristie added the automerge Merge the pull request once unit tests and other checks pass. label Jul 13, 2020
@chingor13 chingor13 merged commit fecaaba into master Jul 13, 2020
@chingor13 chingor13 deleted the basic-branch branch July 13, 2020 22:39
@TomKristie TomKristie added the type: process A process-related concern. May include testing, release, or the like. label Jul 14, 2020
@TomKristie TomKristie added this to the Open-PR-From-Fork milestone Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants