mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-02-22 10:35:43 -05:00
feat: add --cherry-pick-options to add to all cherry-pick run (#116)
Fixes: https://github.com/kiegroup/git-backporting/issues/111
This commit is contained in:
parent
53cc505f17
commit
fe6be83074
18 changed files with 179 additions and 81 deletions
|
@ -124,6 +124,7 @@ This tool comes with some inputs that allow users to override the default behavi
|
||||||
| No squash | --no-squash | N | If provided the backporting will try to backport all pull request commits without squashing | false |
|
| No squash | --no-squash | N | If provided the backporting will try to backport all pull request commits without squashing | false |
|
||||||
| Strategy | --strategy | N | Cherry pick merging strategy, see [git-merge](https://git-scm.com/docs/git-merge#_merge_strategies) doc for all possible values | "recursive" |
|
| Strategy | --strategy | N | Cherry pick merging strategy, see [git-merge](https://git-scm.com/docs/git-merge#_merge_strategies) doc for all possible values | "recursive" |
|
||||||
| Strategy Option | --strategy-option | N | Cherry pick merging strategy option, see [git-merge](https://git-scm.com/docs/git-merge#_merge_strategies) doc for all possible values | "theirs" |
|
| Strategy Option | --strategy-option | N | Cherry pick merging strategy option, see [git-merge](https://git-scm.com/docs/git-merge#_merge_strategies) doc for all possible values | "theirs" |
|
||||||
|
| Cherry-pick Options | --cherry-pick-options | N | Additional cherry-pick options, see [git-cherry-pick](https://git-scm.com/docs/git-cherry-pick) doc for all possible values | "theirs" |
|
||||||
| Additional comments | --comments | N | Semicolon separated list of additional comments to be posted to the backported pull request | [] |
|
| Additional comments | --comments | N | Semicolon separated list of additional comments to be posted to the backported pull request | [] |
|
||||||
| Dry Run | -d, --dry-run | N | If enabled the tool does not push nor create anything remotely, use this to skip PR creation | false |
|
| Dry Run | -d, --dry-run | N | If enabled the tool does not push nor create anything remotely, use this to skip PR creation | false |
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,10 @@ inputs:
|
||||||
description: Cherry-pick merge strategy option
|
description: Cherry-pick merge strategy option
|
||||||
required: false
|
required: false
|
||||||
default: "theirs"
|
default: "theirs"
|
||||||
|
cherry-pick-options:
|
||||||
|
description: >
|
||||||
|
Additional cherry-pick options
|
||||||
|
required: false
|
||||||
comments:
|
comments:
|
||||||
description: >
|
description: >
|
||||||
Semicolon separated list of additional comments to be posted to the backported pull request
|
Semicolon separated list of additional comments to be posted to the backported pull request
|
||||||
|
|
17
dist/cli/index.js
vendored
17
dist/cli/index.js
vendored
|
@ -68,6 +68,7 @@ class ArgsParser {
|
||||||
squash: this.getOrDefault(args.squash, true),
|
squash: this.getOrDefault(args.squash, true),
|
||||||
strategy: this.getOrDefault(args.strategy),
|
strategy: this.getOrDefault(args.strategy),
|
||||||
strategyOption: this.getOrDefault(args.strategyOption),
|
strategyOption: this.getOrDefault(args.strategyOption),
|
||||||
|
cherryPickOptions: this.getOrDefault(args.cherryPickOptions),
|
||||||
comments: this.getOrDefault(args.comments)
|
comments: this.getOrDefault(args.comments)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -205,6 +206,7 @@ class CLIArgsParser extends args_parser_1.default {
|
||||||
.option("--no-squash", "if provided the tool will backport all commits as part of the pull request")
|
.option("--no-squash", "if provided the tool will backport all commits as part of the pull request")
|
||||||
.option("--strategy <strategy>", "cherry-pick merge strategy, default to 'recursive'", undefined)
|
.option("--strategy <strategy>", "cherry-pick merge strategy, default to 'recursive'", undefined)
|
||||||
.option("--strategy-option <strategy-option>", "cherry-pick merge strategy option, default to 'theirs'")
|
.option("--strategy-option <strategy-option>", "cherry-pick merge strategy option, default to 'theirs'")
|
||||||
|
.option("--cherry-pick-options <options>", "additional cherry-pick options")
|
||||||
.option("--comments <comments>", "semicolon separated list of additional comments to be posted to the backported pull request", args_utils_1.getAsSemicolonSeparatedList)
|
.option("--comments <comments>", "semicolon separated list of additional comments to be posted to the backported pull request", args_utils_1.getAsSemicolonSeparatedList)
|
||||||
.option("-cf, --config-file <config-file>", "configuration file containing all valid options, the json must match Args interface");
|
.option("-cf, --config-file <config-file>", "configuration file containing all valid options, the json must match Args interface");
|
||||||
}
|
}
|
||||||
|
@ -240,6 +242,7 @@ class CLIArgsParser extends args_parser_1.default {
|
||||||
squash: opts.squash,
|
squash: opts.squash,
|
||||||
strategy: opts.strategy,
|
strategy: opts.strategy,
|
||||||
strategyOption: opts.strategyOption,
|
strategyOption: opts.strategyOption,
|
||||||
|
cherryPickOptions: opts.cherryPickOptions,
|
||||||
comments: opts.comments,
|
comments: opts.comments,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -359,6 +362,7 @@ class PullRequestConfigsParser extends configs_parser_1.default {
|
||||||
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
||||||
mergeStrategy: args.strategy,
|
mergeStrategy: args.strategy,
|
||||||
mergeStrategyOption: args.strategyOption,
|
mergeStrategyOption: args.strategyOption,
|
||||||
|
cherryPickOptions: args.cherryPickOptions,
|
||||||
originalPullRequest: pr,
|
originalPullRequest: pr,
|
||||||
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
||||||
git: {
|
git: {
|
||||||
|
@ -555,9 +559,14 @@ class GitCLIService {
|
||||||
* @param cwd repository in which the sha should be cherry picked to
|
* @param cwd repository in which the sha should be cherry picked to
|
||||||
* @param sha commit sha
|
* @param sha commit sha
|
||||||
*/
|
*/
|
||||||
async cherryPick(cwd, sha, strategy = "recursive", strategyOption = "theirs") {
|
async cherryPick(cwd, sha, strategy = "recursive", strategyOption = "theirs", cherryPickOptions) {
|
||||||
this.logger.info(`Cherry picking ${sha}`);
|
this.logger.info(`Cherry picking ${sha}`);
|
||||||
const options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`, sha];
|
let options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`];
|
||||||
|
if (cherryPickOptions !== undefined) {
|
||||||
|
options = options.concat(cherryPickOptions.split(" "));
|
||||||
|
}
|
||||||
|
options.push(sha);
|
||||||
|
this.logger.debug(`Cherry picking command git ${options}`);
|
||||||
try {
|
try {
|
||||||
await this.git(cwd).raw(options);
|
await this.git(cwd).raw(options);
|
||||||
}
|
}
|
||||||
|
@ -1461,7 +1470,7 @@ class Runner {
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits) {
|
for (const sha of originalPR.commits) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
if (!configs.dryRun) {
|
if (!configs.dryRun) {
|
||||||
// 8. push the new branch to origin
|
// 8. push the new branch to origin
|
||||||
|
@ -23801,4 +23810,4 @@ module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"]
|
||||||
/******/ module.exports = __webpack_exports__;
|
/******/ module.exports = __webpack_exports__;
|
||||||
/******/
|
/******/
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
|
|
14
dist/gha/index.js
vendored
14
dist/gha/index.js
vendored
|
@ -68,6 +68,7 @@ class ArgsParser {
|
||||||
squash: this.getOrDefault(args.squash, true),
|
squash: this.getOrDefault(args.squash, true),
|
||||||
strategy: this.getOrDefault(args.strategy),
|
strategy: this.getOrDefault(args.strategy),
|
||||||
strategyOption: this.getOrDefault(args.strategyOption),
|
strategyOption: this.getOrDefault(args.strategyOption),
|
||||||
|
cherryPickOptions: this.getOrDefault(args.cherryPickOptions),
|
||||||
comments: this.getOrDefault(args.comments)
|
comments: this.getOrDefault(args.comments)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -208,6 +209,7 @@ class GHAArgsParser extends args_parser_1.default {
|
||||||
squash: !(0, args_utils_1.getAsBooleanOrDefault)((0, core_1.getInput)("no-squash")),
|
squash: !(0, args_utils_1.getAsBooleanOrDefault)((0, core_1.getInput)("no-squash")),
|
||||||
strategy: (0, args_utils_1.getOrUndefined)((0, core_1.getInput)("strategy")),
|
strategy: (0, args_utils_1.getOrUndefined)((0, core_1.getInput)("strategy")),
|
||||||
strategyOption: (0, args_utils_1.getOrUndefined)((0, core_1.getInput)("strategy-option")),
|
strategyOption: (0, args_utils_1.getOrUndefined)((0, core_1.getInput)("strategy-option")),
|
||||||
|
cherryPickOptions: (0, args_utils_1.getOrUndefined)((0, core_1.getInput)("cherry-pick-options")),
|
||||||
comments: (0, args_utils_1.getAsSemicolonSeparatedList)((0, core_1.getInput)("comments")),
|
comments: (0, args_utils_1.getAsSemicolonSeparatedList)((0, core_1.getInput)("comments")),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -327,6 +329,7 @@ class PullRequestConfigsParser extends configs_parser_1.default {
|
||||||
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
||||||
mergeStrategy: args.strategy,
|
mergeStrategy: args.strategy,
|
||||||
mergeStrategyOption: args.strategyOption,
|
mergeStrategyOption: args.strategyOption,
|
||||||
|
cherryPickOptions: args.cherryPickOptions,
|
||||||
originalPullRequest: pr,
|
originalPullRequest: pr,
|
||||||
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
||||||
git: {
|
git: {
|
||||||
|
@ -523,9 +526,14 @@ class GitCLIService {
|
||||||
* @param cwd repository in which the sha should be cherry picked to
|
* @param cwd repository in which the sha should be cherry picked to
|
||||||
* @param sha commit sha
|
* @param sha commit sha
|
||||||
*/
|
*/
|
||||||
async cherryPick(cwd, sha, strategy = "recursive", strategyOption = "theirs") {
|
async cherryPick(cwd, sha, strategy = "recursive", strategyOption = "theirs", cherryPickOptions) {
|
||||||
this.logger.info(`Cherry picking ${sha}`);
|
this.logger.info(`Cherry picking ${sha}`);
|
||||||
const options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`, sha];
|
let options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`];
|
||||||
|
if (cherryPickOptions !== undefined) {
|
||||||
|
options = options.concat(cherryPickOptions.split(" "));
|
||||||
|
}
|
||||||
|
options.push(sha);
|
||||||
|
this.logger.debug(`Cherry picking command git ${options}`);
|
||||||
try {
|
try {
|
||||||
await this.git(cwd).raw(options);
|
await this.git(cwd).raw(options);
|
||||||
}
|
}
|
||||||
|
@ -1429,7 +1437,7 @@ class Runner {
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits) {
|
for (const sha of originalPR.commits) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
if (!configs.dryRun) {
|
if (!configs.dryRun) {
|
||||||
// 8. push the new branch to origin
|
// 8. push the new branch to origin
|
||||||
|
|
|
@ -46,6 +46,7 @@ export default abstract class ArgsParser {
|
||||||
squash: this.getOrDefault(args.squash, true),
|
squash: this.getOrDefault(args.squash, true),
|
||||||
strategy: this.getOrDefault(args.strategy),
|
strategy: this.getOrDefault(args.strategy),
|
||||||
strategyOption: this.getOrDefault(args.strategyOption),
|
strategyOption: this.getOrDefault(args.strategyOption),
|
||||||
|
cherryPickOptions: this.getOrDefault(args.cherryPickOptions),
|
||||||
comments: this.getOrDefault(args.comments)
|
comments: this.getOrDefault(args.comments)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,5 +25,6 @@ export interface Args {
|
||||||
squash?: boolean, // if false use squashed/merged commit otherwise backport all commits as part of the pr
|
squash?: boolean, // if false use squashed/merged commit otherwise backport all commits as part of the pr
|
||||||
strategy?: string, // cherry-pick merge strategy
|
strategy?: string, // cherry-pick merge strategy
|
||||||
strategyOption?: string, // cherry-pick merge strategy option
|
strategyOption?: string, // cherry-pick merge strategy option
|
||||||
|
cherryPickOptions?: string, // additional cherry-pick options
|
||||||
comments?: string[], // additional comments to be posted
|
comments?: string[], // additional comments to be posted
|
||||||
}
|
}
|
|
@ -31,6 +31,7 @@ export default class CLIArgsParser extends ArgsParser {
|
||||||
.option("--no-squash", "if provided the tool will backport all commits as part of the pull request")
|
.option("--no-squash", "if provided the tool will backport all commits as part of the pull request")
|
||||||
.option("--strategy <strategy>", "cherry-pick merge strategy, default to 'recursive'", undefined)
|
.option("--strategy <strategy>", "cherry-pick merge strategy, default to 'recursive'", undefined)
|
||||||
.option("--strategy-option <strategy-option>", "cherry-pick merge strategy option, default to 'theirs'")
|
.option("--strategy-option <strategy-option>", "cherry-pick merge strategy option, default to 'theirs'")
|
||||||
|
.option("--cherry-pick-options <options>", "additional cherry-pick options")
|
||||||
.option("--comments <comments>", "semicolon separated list of additional comments to be posted to the backported pull request", getAsSemicolonSeparatedList)
|
.option("--comments <comments>", "semicolon separated list of additional comments to be posted to the backported pull request", getAsSemicolonSeparatedList)
|
||||||
.option("-cf, --config-file <config-file>", "configuration file containing all valid options, the json must match Args interface");
|
.option("-cf, --config-file <config-file>", "configuration file containing all valid options, the json must match Args interface");
|
||||||
}
|
}
|
||||||
|
@ -67,6 +68,7 @@ export default class CLIArgsParser extends ArgsParser {
|
||||||
squash: opts.squash,
|
squash: opts.squash,
|
||||||
strategy: opts.strategy,
|
strategy: opts.strategy,
|
||||||
strategyOption: opts.strategyOption,
|
strategyOption: opts.strategyOption,
|
||||||
|
cherryPickOptions: opts.cherryPickOptions,
|
||||||
comments: opts.comments,
|
comments: opts.comments,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ export default class GHAArgsParser extends ArgsParser {
|
||||||
squash: !getAsBooleanOrDefault(getInput("no-squash")),
|
squash: !getAsBooleanOrDefault(getInput("no-squash")),
|
||||||
strategy: getOrUndefined(getInput("strategy")),
|
strategy: getOrUndefined(getInput("strategy")),
|
||||||
strategyOption: getOrUndefined(getInput("strategy-option")),
|
strategyOption: getOrUndefined(getInput("strategy-option")),
|
||||||
|
cherryPickOptions: getOrUndefined(getInput("cherry-pick-options")),
|
||||||
comments: getAsSemicolonSeparatedList(getInput("comments")),
|
comments: getAsSemicolonSeparatedList(getInput("comments")),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ export interface Configs {
|
||||||
folder: string,
|
folder: string,
|
||||||
mergeStrategy?: string, // cherry-pick merge strategy
|
mergeStrategy?: string, // cherry-pick merge strategy
|
||||||
mergeStrategyOption?: string, // cherry-pick merge strategy option
|
mergeStrategyOption?: string, // cherry-pick merge strategy option
|
||||||
|
cherryPickOptions?: string, // additional cherry-pick options
|
||||||
originalPullRequest: GitPullRequest,
|
originalPullRequest: GitPullRequest,
|
||||||
backportPullRequests: BackportPullRequest[],
|
backportPullRequests: BackportPullRequest[],
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ export default class PullRequestConfigsParser extends ConfigsParser {
|
||||||
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
||||||
mergeStrategy: args.strategy,
|
mergeStrategy: args.strategy,
|
||||||
mergeStrategyOption: args.strategyOption,
|
mergeStrategyOption: args.strategyOption,
|
||||||
|
cherryPickOptions: args.cherryPickOptions,
|
||||||
originalPullRequest: pr,
|
originalPullRequest: pr,
|
||||||
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
backportPullRequests: this.generateBackportPullRequestsData(pr, args, targetBranches, bpBranchNames),
|
||||||
git: {
|
git: {
|
||||||
|
|
|
@ -110,10 +110,15 @@ export default class GitCLIService {
|
||||||
* @param cwd repository in which the sha should be cherry picked to
|
* @param cwd repository in which the sha should be cherry picked to
|
||||||
* @param sha commit sha
|
* @param sha commit sha
|
||||||
*/
|
*/
|
||||||
async cherryPick(cwd: string, sha: string, strategy = "recursive", strategyOption = "theirs"): Promise<void> {
|
async cherryPick(cwd: string, sha: string, strategy = "recursive", strategyOption = "theirs", cherryPickOptions: string | undefined): Promise<void> {
|
||||||
this.logger.info(`Cherry picking ${sha}`);
|
this.logger.info(`Cherry picking ${sha}`);
|
||||||
|
|
||||||
const options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`, sha];
|
let options = ["cherry-pick", "-m", "1", `--strategy=${strategy}`, `--strategy-option=${strategyOption}`];
|
||||||
|
if (cherryPickOptions !== undefined) {
|
||||||
|
options = options.concat(cherryPickOptions.split(" "));
|
||||||
|
}
|
||||||
|
options.push(sha);
|
||||||
|
this.logger.debug(`Cherry picking command git ${options}`);
|
||||||
try {
|
try {
|
||||||
await this.git(cwd).raw(options);
|
await this.git(cwd).raw(options);
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
|
|
@ -147,7 +147,7 @@ export default class Runner {
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits!) {
|
for (const sha of originalPR.commits!) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!configs.dryRun) {
|
if (!configs.dryRun) {
|
||||||
|
|
|
@ -81,6 +81,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("with config file [default, short]", () => {
|
test("with config file [default, short]", () => {
|
||||||
|
@ -110,6 +111,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("valid execution [default, long]", () => {
|
test("valid execution [default, long]", () => {
|
||||||
|
@ -141,6 +143,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("with config file [default, long]", () => {
|
test("with config file [default, long]", () => {
|
||||||
|
@ -170,6 +173,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("valid execution [override, short]", () => {
|
test("valid execution [override, short]", () => {
|
||||||
|
@ -208,6 +212,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("valid execution [override, long]", () => {
|
test("valid execution [override, long]", () => {
|
||||||
|
@ -264,6 +269,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("override using config file", () => {
|
test("override using config file", () => {
|
||||||
|
@ -293,6 +299,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("ignore custom option when config file is set", () => {
|
test("ignore custom option when config file is set", () => {
|
||||||
|
@ -351,6 +358,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("override squash to false", () => {
|
test("override squash to false", () => {
|
||||||
|
@ -383,7 +391,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(false);
|
expect(args.squash).toEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("override cherry pick strategies", () => {
|
test("override cherry pick strategies and options", () => {
|
||||||
addProcessArgs([
|
addProcessArgs([
|
||||||
"--target-branch",
|
"--target-branch",
|
||||||
"target",
|
"target",
|
||||||
|
@ -393,6 +401,8 @@ describe("cli args parser", () => {
|
||||||
"ort",
|
"ort",
|
||||||
"--strategy-option",
|
"--strategy-option",
|
||||||
"ours",
|
"ours",
|
||||||
|
"--cherry-pick-options",
|
||||||
|
"--allow-empty -x",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const args: Args = parser.parse();
|
const args: Args = parser.parse();
|
||||||
|
@ -416,6 +426,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual("ort");
|
expect(args.strategy).toEqual("ort");
|
||||||
expect(args.strategyOption).toEqual("ours");
|
expect(args.strategyOption).toEqual("ours");
|
||||||
|
expect(args.cherryPickOptions).toEqual("--allow-empty -x");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("additional pr comments", () => {
|
test("additional pr comments", () => {
|
||||||
|
@ -479,6 +490,7 @@ describe("cli args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("invalid execution with empty target branch", () => {
|
test("invalid execution with empty target branch", () => {
|
||||||
|
|
|
@ -72,6 +72,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("valid execution [override]", () => {
|
test("valid execution [override]", () => {
|
||||||
|
@ -113,6 +114,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("using config file", () => {
|
test("using config file", () => {
|
||||||
|
@ -140,6 +142,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("ignore custom options when using config file", () => {
|
test("ignore custom options when using config file", () => {
|
||||||
|
@ -182,6 +185,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("override squash to false", () => {
|
test("override squash to false", () => {
|
||||||
|
@ -235,6 +239,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual("ort");
|
expect(args.strategy).toEqual("ort");
|
||||||
expect(args.strategyOption).toEqual("ours");
|
expect(args.strategyOption).toEqual("ours");
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("additional pr comments", () => {
|
test("additional pr comments", () => {
|
||||||
|
@ -287,6 +292,7 @@ describe("gha args parser", () => {
|
||||||
expect(args.squash).toEqual(true);
|
expect(args.squash).toEqual(true);
|
||||||
expect(args.strategy).toEqual(undefined);
|
expect(args.strategy).toEqual(undefined);
|
||||||
expect(args.strategyOption).toEqual(undefined);
|
expect(args.strategyOption).toEqual(undefined);
|
||||||
|
expect(args.cherryPickOptions).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -119,7 +119,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -153,7 +153,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
||||||
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
||||||
|
@ -190,7 +190,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -221,7 +221,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -267,7 +267,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -325,7 +325,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/4444/head:pr/4444");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/4444/head:pr/4444");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "91748965051fae1330ad58d15cf694e103267c87", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "91748965051fae1330ad58d15cf694e103267c87", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9174896");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9174896");
|
||||||
|
@ -384,7 +384,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -442,7 +442,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -492,7 +492,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -541,7 +541,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -586,7 +586,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -634,7 +634,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -681,8 +681,8 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
||||||
|
@ -736,7 +736,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, truncatedBranch);
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, truncatedBranch);
|
||||||
|
@ -787,8 +787,8 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", "ort", "find-renames");
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", "ort", "find-renames", undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", "ort", "find-renames");
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", "ort", "find-renames", undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
||||||
|
@ -838,7 +838,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -891,9 +891,9 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-v1-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-v1-28f63db");
|
||||||
|
@ -973,9 +973,9 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom1");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom1");
|
||||||
|
@ -1060,9 +1060,9 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom-failure-head-v1");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom-failure-head-v1");
|
||||||
|
|
|
@ -101,7 +101,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitLabClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitLabClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -135,7 +135,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
||||||
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.addRemote).toBeCalledTimes(0);
|
||||||
|
@ -169,7 +169,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9e15674");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9e15674");
|
||||||
|
@ -227,7 +227,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -286,7 +286,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -343,7 +343,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -393,7 +393,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -442,7 +442,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -487,7 +487,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-prod-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-prod-ebb1eca");
|
||||||
|
@ -531,7 +531,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.createLocalBranch).toBeCalledWith(cwd, "bp-target-e4dd336");
|
expect(GitCLIService.prototype.createLocalBranch).toBeCalledWith(cwd, "bp-target-e4dd336");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336");
|
||||||
|
@ -578,8 +578,8 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "974519f65c9e0ed65277cd71026657a09fca05e7", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "974519f65c9e0ed65277cd71026657a09fca05e7", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336-974519f");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336-974519f");
|
||||||
|
|
|
@ -83,7 +83,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -112,7 +112,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -166,7 +166,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/4444/head:pr/4444");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/4444/head:pr/4444");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "91748965051fae1330ad58d15cf694e103267c87", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "91748965051fae1330ad58d15cf694e103267c87", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9174896");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9174896");
|
||||||
|
@ -217,7 +217,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -269,7 +269,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -316,7 +316,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -363,7 +363,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -407,7 +407,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -453,7 +453,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -498,8 +498,8 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-0404fb9-11da4e3");
|
||||||
|
@ -546,7 +546,53 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", "ort", "ours");
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", "ort", "ours", undefined);
|
||||||
|
|
||||||
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
|
||||||
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledTimes(1);
|
||||||
|
expect(GitHubClient.prototype.createPullRequest).toBeCalledWith({
|
||||||
|
owner: "owner",
|
||||||
|
repo: "reponame",
|
||||||
|
head: "bp-target-28f63db",
|
||||||
|
base: "target",
|
||||||
|
title: "[target] PR Title",
|
||||||
|
body: "**Backport:** https://github.com/owner/reponame/pull/2368\r\n\r\nPlease review and merge",
|
||||||
|
reviewers: ["gh-user", "that-s-a-user"],
|
||||||
|
assignees: [],
|
||||||
|
labels: [],
|
||||||
|
comments: [],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
expect(GitHubClient.prototype.createPullRequest).toReturnTimes(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("using github api url and additional cherry-pick options", async () => {
|
||||||
|
spyGetInput({
|
||||||
|
"target-branch": "target",
|
||||||
|
"pull-request": "https://api.github.com/repos/owner/reponame/pulls/2368",
|
||||||
|
"cherry-pick-options": "-x --allow-empty",
|
||||||
|
});
|
||||||
|
|
||||||
|
await runner.execute();
|
||||||
|
|
||||||
|
const cwd = process.cwd() + "/bp";
|
||||||
|
|
||||||
|
expect(GitClientFactory.getOrCreate).toBeCalledTimes(1);
|
||||||
|
expect(GitClientFactory.getOrCreate).toBeCalledWith(GitClientType.GITHUB, undefined, "https://api.github.com");
|
||||||
|
|
||||||
|
expect(GitCLIService.prototype.clone).toBeCalledTimes(1);
|
||||||
|
expect(GitCLIService.prototype.clone).toBeCalledWith("https://github.com/owner/reponame.git", cwd, "target");
|
||||||
|
|
||||||
|
expect(GitCLIService.prototype.createLocalBranch).toBeCalledTimes(1);
|
||||||
|
expect(GitCLIService.prototype.createLocalBranch).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
|
||||||
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(1);
|
||||||
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, "-x --allow-empty");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -592,7 +638,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-28f63db");
|
||||||
|
@ -642,9 +688,9 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-v1-28f63db");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-v1-28f63db");
|
||||||
|
@ -720,9 +766,9 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "pull/2368/head:pr/2368");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "28f63db774185f4ec4b57cd9aaeb12dbfb4c9ecc", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(3);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom-v1");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "custom-v1");
|
||||||
|
|
|
@ -94,7 +94,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(0);
|
||||||
expect(GitLabClient.prototype.createPullRequest).toBeCalledTimes(0);
|
expect(GitLabClient.prototype.createPullRequest).toBeCalledTimes(0);
|
||||||
|
@ -123,7 +123,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9e15674");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-9e15674");
|
||||||
|
@ -175,7 +175,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -225,7 +225,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -276,7 +276,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "9e15674ebd48e05c6e428a1fa31dbb60a778d644", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp_branch_name");
|
||||||
|
@ -321,7 +321,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -365,7 +365,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-ebb1eca");
|
||||||
|
@ -409,7 +409,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "ebb1eca696c42fd067658bd9b5267709f78ef38e", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-prod-ebb1eca");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-prod-ebb1eca");
|
||||||
|
@ -451,7 +451,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.createLocalBranch).toBeCalledWith(cwd, "bp-target-e4dd336");
|
expect(GitCLIService.prototype.createLocalBranch).toBeCalledWith(cwd, "bp-target-e4dd336");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336");
|
||||||
|
@ -496,8 +496,8 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
expect(GitCLIService.prototype.fetch).toBeCalledWith(cwd, "merge-requests/2/head:pr/2");
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "e4dd336a4a20f394df6665994df382fb1d193a11", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "974519f65c9e0ed65277cd71026657a09fca05e7", undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "974519f65c9e0ed65277cd71026657a09fca05e7", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336-974519f");
|
expect(GitCLIService.prototype.push).toBeCalledWith(cwd, "bp-target-e4dd336-974519f");
|
||||||
|
|
Loading…
Add table
Reference in a new issue