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 options to disable fork mode #141

Merged
merged 4 commits into from Aug 8, 2019

Conversation

@sqren
Copy link
Owner

commented Aug 7, 2019

Closes #140

Adds the ability to create backports in the origin repository instead of in a fork. Fork mode is still the default. To disable fork mode run backport --fork=false or add it to the project config:

{
  "upstream": "elastic/kibana",
  "branches": [{ "name": "7.x", "checked": true }, "7.3", "7.2"],
  "fork": false
}

@sqren sqren force-pushed the add-no-fork-mode branch from a8e6f47 to 57b66e5 Aug 7, 2019

@sqren sqren force-pushed the add-no-fork-mode branch from 57b66e5 to 0728158 Aug 7, 2019

@brianmcgue
Copy link

left a comment

LGTM! I was actually just working on this exact functionality before stumbling upon this. Thanks for taking it on!

EDIT: It would be nice to have a spec with fork: false

@@ -152,10 +152,9 @@ export function pushFeatureBranch(
options: BackportOptions,
featureBranch: string
) {
const remoteName = options.fork ? options.username : options.repoOwner;

This comment has been minimized.

Copy link
@brianmcgue

brianmcgue Aug 7, 2019

The only thing I did differently was move this to its own function so the logic exists in only one place (instead of having it exist in the doBackportVersions.ts file as well)

This comment has been minimized.

Copy link
@sqren

sqren Aug 8, 2019

Author Owner

Good idea. Done.

@sqren sqren force-pushed the add-no-fork-mode branch from 5e3a61c to 0408994 Aug 8, 2019

@@ -140,3 +149,66 @@ describe('when a multiple commits are backported', () => {
`);
});
});

describe('when disabling fork mode', () => {

This comment has been minimized.

Copy link
@sqren

sqren Aug 8, 2019

Author Owner

@brianmcgue Added a spec that verifies it can correctly backport with fork=false

@sqren sqren merged commit 4f63c53 into master Aug 8, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.2%) to 90.385%
Details

@sqren sqren deleted the add-no-fork-mode branch Aug 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.