backport 5.6.6 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -39
- package/dist/entrypoint.cli.js +1 -1
- package/dist/entrypoint.module.d.ts +6 -5
- package/dist/entrypoint.module.js +8 -6
- package/dist/ink.d.ts +1 -0
- package/dist/ink.js +49 -0
- package/dist/main.d.ts +11 -6
- package/dist/main.js +40 -24
- package/dist/options/ConfigOptions.d.ts +13 -8
- package/dist/options/cliArgs.d.ts +11 -9
- package/dist/options/cliArgs.js +74 -36
- package/dist/options/cliArgs.test.js +33 -37
- package/dist/options/config/config.d.ts +17 -15
- package/dist/options/config/config.js +8 -8
- package/dist/options/config/config.test.js +3 -2
- package/dist/options/config/getOptionsFromGit.js +1 -1
- package/dist/options/config/globalConfig.d.ts +2 -51
- package/dist/options/config/globalConfig.js +8 -8
- package/dist/options/config/globalConfig.test.js +7 -3
- package/dist/options/config/projectConfig.d.ts +2 -51
- package/dist/options/config/projectConfig.js +2 -2
- package/dist/options/config/projectConfig.test.js +3 -3
- package/dist/options/config/readConfigFile.d.ts +2 -51
- package/dist/options/config/readConfigFile.js +2 -2
- package/dist/options/options.d.ts +19 -14
- package/dist/options/options.js +5 -6
- package/dist/options/options.test.js +48 -11
- package/dist/options/parseRequiredOptions.d.ts +18 -13
- package/dist/options/parseRequiredOptions.js +8 -12
- package/dist/options/parseRequiredOptions.test.js +25 -16
- package/dist/runSequentially.d.ts +20 -0
- package/dist/runSequentially.js +41 -0
- package/dist/runSequentially.test.d.ts +1 -0
- package/dist/runSequentially.test.js +235 -0
- package/dist/runWithOptions.js +7 -14
- package/dist/runWithOptions.test.js +138 -17
- package/dist/scripts/generate-gql.d.ts +1 -0
- package/dist/scripts/generate-gql.js +15 -0
- package/dist/scripts/postinstall.js +4 -4
- package/dist/scripts/postinstall.test.js +9 -2
- package/dist/scripts/runPostinstall.js +1 -1
- package/dist/services/HandledError.d.ts +11 -1
- package/dist/services/HandledError.js +2 -1
- package/dist/services/child-process-promisified.d.ts +1 -1
- package/dist/services/child-process-promisified.js +1 -1
- package/dist/services/env.js +5 -5
- package/dist/services/env.test.js +11 -4
- package/dist/services/fs-promisified.js +4 -4
- package/dist/services/getExpectedTarget.d.ts +9 -0
- package/dist/services/getExpectedTarget.js +77 -0
- package/dist/services/getExpectedTargetPullRequests.d.ts +9 -0
- package/dist/services/getExpectedTargetPullRequests.js +77 -0
- package/dist/services/git.d.ts +15 -4
- package/dist/services/git.integration.test.d.ts +1 -0
- package/dist/services/git.integration.test.js +168 -0
- package/dist/services/git.js +86 -61
- package/dist/services/git.test.js +61 -64
- package/dist/services/github/commitFormatters.d.ts +3 -7
- package/dist/services/github/commitFormatters.js +10 -19
- package/dist/services/github/commitFormatters.test.js +2 -24
- package/dist/services/github/v3/addAssigneesToPullRequest.d.ts +1 -1
- package/dist/services/github/v3/addAssigneesToPullRequest.js +2 -6
- package/dist/services/github/v3/addAssigneesToPullRequest.test.js +2 -3
- package/dist/services/github/v3/addLabelsToPullRequest.d.ts +1 -1
- package/dist/services/github/v3/addLabelsToPullRequest.js +2 -6
- package/dist/services/github/v3/addReviewersToPullRequest.d.ts +2 -0
- package/dist/services/github/v3/addReviewersToPullRequest.js +34 -0
- package/dist/services/github/v3/createPullRequest.d.ts +3 -2
- package/dist/services/github/v3/createPullRequest.js +32 -23
- package/dist/services/github/v3/createStatusComment.d.ts +11 -0
- package/dist/services/github/v3/createStatusComment.js +97 -0
- package/dist/services/github/v3/createStatusComment.test.d.ts +1 -0
- package/dist/services/github/v3/createStatusComment.test.js +209 -0
- package/dist/services/github/v4/FetchPullRequestId.js +1 -1
- package/dist/services/github/v4/apiRequestV4.d.ts +1 -1
- package/dist/services/github/v4/apiRequestV4.js +5 -7
- package/dist/services/github/v4/apiRequestV4.test.js +7 -7
- package/dist/services/github/v4/disablePullRequestAutoMerge.js +3 -4
- package/dist/services/github/v4/enablePullRequestAutoMerge.js +8 -7
- package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.js +94 -33
- package/dist/services/github/v4/fetchAuthorId.js +1 -1
- package/dist/services/github/v4/fetchAuthorId.private.test.js +3 -3
- package/dist/services/github/v4/fetchCommitByPullNumber.js +11 -9
- package/dist/services/github/v4/fetchCommitByPullNumber.private.test.js +4 -4
- package/dist/services/github/v4/fetchCommitBySha.js +14 -12
- package/dist/services/github/v4/fetchCommitBySha.private.test.js +4 -4
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.d.ts +5 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +46 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +67 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.d.ts +5 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +36 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +55 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +16 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +90 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +130 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +127 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.d.ts +28 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.js +52 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.d.ts +10 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.js +49 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +81 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.js +252 -0
- package/dist/services/github/v4/fetchCommitsByAuthor.d.ts +2 -1
- package/dist/services/github/v4/fetchCommitsByAuthor.js +81 -70
- package/dist/services/github/v4/fetchCommitsByAuthor.private.test.js +78 -5
- package/dist/services/github/v4/fetchCommitsByAuthor.test.js +29 -21
- package/dist/services/github/v4/fetchDefaultBranch.js +1 -1
- package/dist/services/github/v4/fetchExistingPullRequest.js +2 -3
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +3 -3
- package/dist/services/github/v4/fetchMergedPullRequests.d.ts +18 -19
- package/dist/services/github/v4/fetchMergedPullRequests.js +22 -69
- package/dist/services/github/v4/fetchMergedPullRequests.private.test.js +8 -9
- package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.js +2 -3
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.js +12 -10
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.js +3 -3
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.js +2 -2
- package/dist/services/github/v4/getExistingTargetPullRequests.d.ts +4 -58
- package/dist/services/github/v4/getExistingTargetPullRequests.js +3 -58
- package/dist/services/github/v4/getOptionsFromGithub/index.d.ts +16 -10
- package/dist/services/github/v4/getOptionsFromGithub/index.js +52 -22
- package/dist/services/github/v4/getOptionsFromGithub/index.private.test.js +25 -7
- package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +13 -16
- package/dist/services/github/v4/getOptionsFromGithub/query.js +13 -15
- package/dist/services/github/v4/getTargetBranchesFromLabels.d.ts +0 -7
- package/dist/services/github/v4/getTargetBranchesFromLabels.js +1 -26
- package/dist/services/github/v4/getTargetBranchesFromLabels.test.js +69 -32
- package/dist/services/github/v4/mocks/commitsByAuthorMock.d.ts +2 -2
- package/dist/services/github/v4/mocks/commitsByAuthorMock.js +39 -25
- package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.d.ts +1 -1
- package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.js +10 -0
- package/dist/services/github/v4/mocks/getCommitsByAuthorMock.d.ts +1 -1
- package/dist/services/github/v4/mocks/getCommitsByAuthorMock.js +2 -0
- package/dist/services/github/v4/mocks/getPullRequestNodeMock.d.ts +1 -1
- package/dist/services/github/v4/mocks/getPullRequestNodeMock.js +1 -0
- package/dist/services/github/v4/throwOnInvalidAccessToken.js +10 -15
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +7 -7
- package/dist/services/logger.d.ts +3 -3
- package/dist/services/logger.js +16 -15
- package/dist/services/prompt.test.d.ts +1 -0
- package/dist/services/prompt.test.js +87 -0
- package/dist/services/prompts.d.ts +10 -4
- package/dist/services/prompts.js +85 -22
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.d.ts +9 -0
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +92 -0
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.d.ts +1 -0
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.js +396 -0
- package/dist/services/sourceCommit/getMockSourceCommit.d.ts +21 -0
- package/dist/services/sourceCommit/getMockSourceCommit.js +67 -0
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.d.ts +5 -0
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.js +20 -0
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.d.ts +1 -0
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.js +201 -0
- package/dist/services/sourceCommit/parseSourceCommit.d.ts +78 -0
- package/dist/services/sourceCommit/parseSourceCommit.js +96 -0
- package/dist/services/sourceCommit/parseSourceCommit.test.d.ts +1 -0
- package/dist/services/sourceCommit/parseSourceCommit.test.js +114 -0
- package/dist/services/sourceCommit/sourceCommit.d.ts +78 -0
- package/dist/services/sourceCommit/sourceCommit.js +86 -0
- package/dist/services/sourceCommit/sourceCommit.test.d.ts +1 -0
- package/dist/services/sourceCommit/sourceCommit.test.js +287 -0
- package/dist/services/sourceCommit.d.ts +78 -0
- package/dist/services/sourceCommit.js +86 -0
- package/dist/services/sourceCommit.test.d.ts +1 -0
- package/dist/services/sourceCommit.test.js +280 -0
- package/dist/test/inquirer.private.test.js +22 -15
- package/dist/test/integration/createSpies.js +6 -6
- package/dist/test/integration/envConstants.js +5 -6
- package/dist/test/integration/helpers.js +1 -1
- package/dist/test/integration/integration.private.test.d.ts +1 -0
- package/dist/test/integration/integration.private.test.js +308 -0
- package/dist/test/integration/integration.test.js +28 -29
- package/dist/test/nockHelpers.js +3 -7
- package/dist/test/setupFiles/automatic-mocks.d.ts +0 -1
- package/dist/test/setupFiles/automatic-mocks.js +0 -22
- package/dist/types/Commit.d.ts +85 -0
- package/dist/types/Commit.js +139 -0
- package/dist/types/commitNode.d.ts +89 -0
- package/dist/types/commitNode.js +139 -0
- package/dist/types/commitNode.test.d.ts +1 -0
- package/dist/types/commitNode.test.js +255 -0
- package/dist/types/commitWithAssociatedPullRequests.d.ts +86 -0
- package/dist/types/commitWithAssociatedPullRequests.js +145 -0
- package/dist/ui/cherrypickAndCreatePullRequest.test.js +277 -59
- package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +11 -1
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +131 -68
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.d.ts +1 -0
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +468 -0
- package/dist/ui/getCommits.d.ts +1 -1
- package/dist/ui/getCommits.js +55 -25
- package/dist/ui/getTargetBranches.d.ts +2 -2
- package/dist/ui/getTargetBranches.js +16 -17
- package/dist/ui/getTargetBranches.test.js +75 -99
- package/dist/ui/getTargetBranchesFromLabels.d.ts +6 -0
- package/dist/ui/getTargetBranchesFromLabels.js +40 -0
- package/dist/ui/getTargetBranchesFromLabels.test.d.ts +1 -0
- package/dist/ui/getTargetBranchesFromLabels.test.js +288 -0
- package/dist/ui/maybeSetupRepo.js +9 -9
- package/dist/ui/maybeSetupRepo.test.js +5 -1
- package/package.json +36 -51
- package/yarn.lock +2387 -2987
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { Commit } from './sourceCommit/parseSourceCommit';
|
|
2
|
+
declare type Meta = {
|
|
3
|
+
type: 'commitsWithoutBackports';
|
|
4
|
+
commitsWithoutBackports: {
|
|
5
|
+
formatted: string;
|
|
6
|
+
commit: Commit;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
1
9
|
export declare class HandledError extends Error {
|
|
2
|
-
|
|
10
|
+
meta?: Meta;
|
|
11
|
+
constructor(message: string, meta?: Meta);
|
|
3
12
|
}
|
|
13
|
+
export {};
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HandledError = void 0;
|
|
4
4
|
class HandledError extends Error {
|
|
5
|
-
constructor(message) {
|
|
5
|
+
constructor(message, meta) {
|
|
6
6
|
super(message);
|
|
7
7
|
Error.captureStackTrace(this, HandledError);
|
|
8
8
|
this.name = 'HandledError';
|
|
9
|
+
this.meta = meta;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
exports.HandledError = HandledError;
|
|
@@ -4,4 +4,4 @@ export declare function exec(cmd: string, options: child_process.ExecOptions): P
|
|
|
4
4
|
stdout: string;
|
|
5
5
|
stderr: string;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const execAsCallback: (command: string, options: (import("fs").
|
|
7
|
+
export declare const execAsCallback: (command: string, options: (import("fs").ObjectEncodingOptions & child_process.ExecOptions) | null | undefined, callback?: ((error: child_process.ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined) => child_process.ChildProcess;
|
|
@@ -8,7 +8,7 @@ const child_process_1 = __importDefault(require("child_process"));
|
|
|
8
8
|
const util_1 = require("util");
|
|
9
9
|
const logger_1 = require("./logger");
|
|
10
10
|
async function exec(cmd, options) {
|
|
11
|
-
const execPromisified = util_1.promisify(child_process_1.default.exec);
|
|
11
|
+
const execPromisified = (0, util_1.promisify)(child_process_1.default.exec);
|
|
12
12
|
try {
|
|
13
13
|
const res = await execPromisified(cmd, {
|
|
14
14
|
maxBuffer: 100 * 1024 * 1024,
|
package/dist/services/env.js
CHANGED
|
@@ -7,22 +7,22 @@ exports.getRepoPath = exports.getRepoOwnerPath = exports.getReposPath = exports.
|
|
|
7
7
|
const os_1 = require("os");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
function getLogfilePath() {
|
|
10
|
-
return path_1.default.join(os_1.homedir(), '.backport', 'backport.log');
|
|
10
|
+
return path_1.default.join((0, os_1.homedir)(), '.backport', 'backport.log');
|
|
11
11
|
}
|
|
12
12
|
exports.getLogfilePath = getLogfilePath;
|
|
13
13
|
function getGlobalConfigPath() {
|
|
14
|
-
return path_1.default.join(os_1.homedir(), '.backport', 'config.json');
|
|
14
|
+
return path_1.default.join((0, os_1.homedir)(), '.backport', 'config.json');
|
|
15
15
|
}
|
|
16
16
|
exports.getGlobalConfigPath = getGlobalConfigPath;
|
|
17
17
|
function getReposPath() {
|
|
18
|
-
return path_1.default.join(os_1.homedir(), '.backport', 'repositories');
|
|
18
|
+
return path_1.default.join((0, os_1.homedir)(), '.backport', 'repositories');
|
|
19
19
|
}
|
|
20
20
|
exports.getReposPath = getReposPath;
|
|
21
21
|
function getRepoOwnerPath({ repoOwner }) {
|
|
22
|
-
return path_1.default.join(os_1.homedir(), '.backport', 'repositories', repoOwner);
|
|
22
|
+
return path_1.default.join((0, os_1.homedir)(), '.backport', 'repositories', repoOwner);
|
|
23
23
|
}
|
|
24
24
|
exports.getRepoOwnerPath = getRepoOwnerPath;
|
|
25
25
|
function getRepoPath({ repoOwner, repoName }) {
|
|
26
|
-
return path_1.default.join(os_1.homedir(), '.backport', 'repositories', repoOwner, repoName);
|
|
26
|
+
return path_1.default.join((0, os_1.homedir)(), '.backport', 'repositories', repoOwner, repoName);
|
|
27
27
|
}
|
|
28
28
|
exports.getRepoPath = getRepoPath;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const os_1 = __importDefault(require("os"));
|
|
3
7
|
const env_1 = require("../services/env");
|
|
4
8
|
describe('env', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
jest.spyOn(os_1.default, 'homedir').mockReturnValue('/myHomeDir');
|
|
11
|
+
});
|
|
5
12
|
test('getGlobalConfigPath', () => {
|
|
6
|
-
expect(env_1.getGlobalConfigPath()).toBe('/myHomeDir/.backport/config.json');
|
|
13
|
+
expect((0, env_1.getGlobalConfigPath)()).toBe('/myHomeDir/.backport/config.json');
|
|
7
14
|
});
|
|
8
15
|
test('getReposPath', () => {
|
|
9
|
-
expect(env_1.getReposPath()).toBe('/myHomeDir/.backport/repositories');
|
|
16
|
+
expect((0, env_1.getReposPath)()).toBe('/myHomeDir/.backport/repositories');
|
|
10
17
|
});
|
|
11
18
|
test('getRepoOwnerPath', () => {
|
|
12
|
-
expect(env_1.getRepoOwnerPath({ repoOwner: 'elastic' })).toBe('/myHomeDir/.backport/repositories/elastic');
|
|
19
|
+
expect((0, env_1.getRepoOwnerPath)({ repoOwner: 'elastic' })).toBe('/myHomeDir/.backport/repositories/elastic');
|
|
13
20
|
});
|
|
14
21
|
test('getRepoPath', () => {
|
|
15
|
-
expect(env_1.getRepoPath({
|
|
22
|
+
expect((0, env_1.getRepoPath)({
|
|
16
23
|
repoOwner: 'elastic',
|
|
17
24
|
repoName: 'kibana',
|
|
18
25
|
})).toBe('/myHomeDir/.backport/repositories/elastic/kibana');
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.chmod = exports.stat = exports.readFile = exports.writeFile = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const util_1 = require("util");
|
|
9
|
-
exports.writeFile = util_1.promisify(fs_1.default.writeFile);
|
|
10
|
-
exports.readFile = util_1.promisify(fs_1.default.readFile);
|
|
11
|
-
exports.stat = util_1.promisify(fs_1.default.stat);
|
|
12
|
-
exports.chmod = util_1.promisify(fs_1.default.chmod);
|
|
9
|
+
exports.writeFile = (0, util_1.promisify)(fs_1.default.writeFile);
|
|
10
|
+
exports.readFile = (0, util_1.promisify)(fs_1.default.readFile);
|
|
11
|
+
exports.stat = (0, util_1.promisify)(fs_1.default.stat);
|
|
12
|
+
exports.chmod = (0, util_1.promisify)(fs_1.default.chmod);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidConfigOptions } from '../options/options';
|
|
2
|
+
import { SourceCommitWithTargetPullRequest } from './sourceCommit';
|
|
3
|
+
export declare type ExpectedTargetPullRequest = {
|
|
4
|
+
url?: string;
|
|
5
|
+
number?: number;
|
|
6
|
+
branch: string;
|
|
7
|
+
state: 'OPEN' | 'CLOSED' | 'MERGED' | 'MISSING';
|
|
8
|
+
};
|
|
9
|
+
export declare function getExpectedTargetPullRequests(sourceCommit: SourceCommitWithTargetPullRequest, branchLabelMapping: ValidConfigOptions['branchLabelMapping']): ExpectedTargetPullRequest[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExpectedTargetPullRequests = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const getTargetBranchesFromLabels_1 = require("../services/github/v4/getTargetBranchesFromLabels");
|
|
6
|
+
const filterEmpty_1 = require("../utils/filterEmpty");
|
|
7
|
+
const commitFormatters_1 = require("./github/commitFormatters");
|
|
8
|
+
function getExpectedTargetPullRequests(sourceCommit, branchLabelMapping) {
|
|
9
|
+
const sourcePullRequest = sourceCommit.associatedPullRequests.edges?.[0]?.node;
|
|
10
|
+
// if there is no source pull request the commit was pushed directly to the source branch
|
|
11
|
+
// in that case there will be no labels, and thus not possible to deduce the expected target branches
|
|
12
|
+
if (!sourcePullRequest) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const existingTargetPullRequests = getExistingTargetPullRequests(sourceCommit, sourcePullRequest);
|
|
16
|
+
// if there's no `branchLabelMapping`, it's not possible to deduce the missing target branches
|
|
17
|
+
if (!branchLabelMapping) {
|
|
18
|
+
return existingTargetPullRequests;
|
|
19
|
+
}
|
|
20
|
+
const missingTargetPullRequests = getMissingTargetPullRequests(sourcePullRequest, existingTargetPullRequests, branchLabelMapping);
|
|
21
|
+
return [...existingTargetPullRequests, ...missingTargetPullRequests];
|
|
22
|
+
}
|
|
23
|
+
exports.getExpectedTargetPullRequests = getExpectedTargetPullRequests;
|
|
24
|
+
function getExistingTargetPullRequests(sourceCommit, sourcePullRequest) {
|
|
25
|
+
const sourceCommitMessage = (0, commitFormatters_1.getFirstLine)(sourceCommit.message);
|
|
26
|
+
return sourcePullRequest.timelineItems.edges
|
|
27
|
+
.filter(filterEmpty_1.filterNil)
|
|
28
|
+
.filter(filterPullRequests)
|
|
29
|
+
.filter((item) => {
|
|
30
|
+
const { targetPullRequest } = item.node;
|
|
31
|
+
// ignore closed PRs
|
|
32
|
+
if (targetPullRequest.state === 'CLOSED') {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
// at least one of the commits in `targetPullRequest` should match the merge commit from the source pull request
|
|
36
|
+
const didCommitMatch = targetPullRequest.commits.edges.some((commitEdge) => {
|
|
37
|
+
const { targetCommit } = commitEdge.node;
|
|
38
|
+
const matchingRepoName = sourceCommit.repository.name === targetCommit.repository.name;
|
|
39
|
+
const matchingRepoOwner = sourceCommit.repository.owner.login ===
|
|
40
|
+
targetCommit.repository.owner.login;
|
|
41
|
+
const targetCommitMessage = (0, commitFormatters_1.getFirstLine)(targetCommit.message);
|
|
42
|
+
const matchingMessage = targetCommitMessage === sourceCommitMessage;
|
|
43
|
+
return matchingRepoName && matchingRepoOwner && matchingMessage;
|
|
44
|
+
});
|
|
45
|
+
const titleIncludesMessage = targetPullRequest.title.includes(sourceCommitMessage);
|
|
46
|
+
const titleIncludesNumber = targetPullRequest.title.includes(sourcePullRequest.number.toString());
|
|
47
|
+
return didCommitMatch || (titleIncludesMessage && titleIncludesNumber);
|
|
48
|
+
})
|
|
49
|
+
.map((item) => {
|
|
50
|
+
const { targetPullRequest } = item.node;
|
|
51
|
+
return {
|
|
52
|
+
url: targetPullRequest.url,
|
|
53
|
+
number: targetPullRequest.number,
|
|
54
|
+
branch: targetPullRequest.baseRefName,
|
|
55
|
+
state: targetPullRequest.state,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function getMissingTargetPullRequests(sourcePullRequest, existingTargetPullRequests, branchLabelMapping) {
|
|
60
|
+
const labels = sourcePullRequest.labels.nodes.map((label) => label.name);
|
|
61
|
+
const targetBranchesFromLabels = labels
|
|
62
|
+
.map((label) => (0, getTargetBranchesFromLabels_1.getTargetBranchForLabel)({ branchLabelMapping, label }))
|
|
63
|
+
.filter(filterEmpty_1.filterNil)
|
|
64
|
+
.filter((targetBranch) => targetBranch !== sourcePullRequest.baseRefName);
|
|
65
|
+
const expectedTargetBranches = existingTargetPullRequests.map((pr) => pr.branch);
|
|
66
|
+
const expected = (0, lodash_1.uniq)(targetBranchesFromLabels);
|
|
67
|
+
return expected
|
|
68
|
+
.filter((targetBranch) => !expectedTargetBranches.includes(targetBranch))
|
|
69
|
+
.map((branch) => {
|
|
70
|
+
return { branch, state: 'MISSING' };
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// narrow TimelineEdge to TimelinePullRequestEdge
|
|
74
|
+
function filterPullRequests(item) {
|
|
75
|
+
const { targetPullRequest } = item.node;
|
|
76
|
+
return targetPullRequest.__typename === 'PullRequest';
|
|
77
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidConfigOptions } from '../options/options';
|
|
2
|
+
import { SourceCommitWithTargetPullRequest } from './sourceCommit';
|
|
3
|
+
export declare type ExpectedTargetPullRequest = {
|
|
4
|
+
url?: string;
|
|
5
|
+
number?: number;
|
|
6
|
+
branch: string;
|
|
7
|
+
state: 'OPEN' | 'CLOSED' | 'MERGED' | 'MISSING';
|
|
8
|
+
};
|
|
9
|
+
export declare function getExpectedTargetPullRequests(sourceCommit: SourceCommitWithTargetPullRequest, branchLabelMapping: ValidConfigOptions['branchLabelMapping']): ExpectedTargetPullRequest[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExpectedTargetPullRequests = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const getTargetBranchesFromLabels_1 = require("../services/github/v4/getTargetBranchesFromLabels");
|
|
6
|
+
const filterEmpty_1 = require("../utils/filterEmpty");
|
|
7
|
+
const commitFormatters_1 = require("./github/commitFormatters");
|
|
8
|
+
function getExpectedTargetPullRequests(sourceCommit, branchLabelMapping) {
|
|
9
|
+
const sourcePullRequest = sourceCommit.associatedPullRequests.edges?.[0]?.node;
|
|
10
|
+
// if there is no source pull request the commit was pushed directly to the source branch
|
|
11
|
+
// in that case there will be no labels, and thus not possible to deduce the expected target branches
|
|
12
|
+
if (!sourcePullRequest) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const existingTargetPullRequests = getExistingTargetPullRequests(sourceCommit, sourcePullRequest);
|
|
16
|
+
// if there's no `branchLabelMapping`, it's not possible to deduce the missing target branches
|
|
17
|
+
if (!branchLabelMapping) {
|
|
18
|
+
return existingTargetPullRequests;
|
|
19
|
+
}
|
|
20
|
+
const missingTargetPullRequests = getMissingTargetPullRequests(sourcePullRequest, existingTargetPullRequests, branchLabelMapping);
|
|
21
|
+
return [...existingTargetPullRequests, ...missingTargetPullRequests];
|
|
22
|
+
}
|
|
23
|
+
exports.getExpectedTargetPullRequests = getExpectedTargetPullRequests;
|
|
24
|
+
function getExistingTargetPullRequests(sourceCommit, sourcePullRequest) {
|
|
25
|
+
const sourceCommitMessage = (0, commitFormatters_1.getFirstLine)(sourceCommit.message);
|
|
26
|
+
return sourcePullRequest.timelineItems.edges
|
|
27
|
+
.filter(filterEmpty_1.filterNil)
|
|
28
|
+
.filter(filterPullRequests)
|
|
29
|
+
.filter((item) => {
|
|
30
|
+
const { targetPullRequest } = item.node;
|
|
31
|
+
// ignore closed PRs
|
|
32
|
+
if (targetPullRequest.state === 'CLOSED') {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
// at least one of the commits in `targetPullRequest` should match the merge commit from the source pull request
|
|
36
|
+
const didCommitMatch = targetPullRequest.commits.edges.some((commitEdge) => {
|
|
37
|
+
const { targetCommit } = commitEdge.node;
|
|
38
|
+
const matchingRepoName = sourceCommit.repository.name === targetCommit.repository.name;
|
|
39
|
+
const matchingRepoOwner = sourceCommit.repository.owner.login ===
|
|
40
|
+
targetCommit.repository.owner.login;
|
|
41
|
+
const targetCommitMessage = (0, commitFormatters_1.getFirstLine)(targetCommit.message);
|
|
42
|
+
const matchingMessage = targetCommitMessage === sourceCommitMessage;
|
|
43
|
+
return matchingRepoName && matchingRepoOwner && matchingMessage;
|
|
44
|
+
});
|
|
45
|
+
const titleIncludesMessage = targetPullRequest.title.includes(sourceCommitMessage);
|
|
46
|
+
const titleIncludesNumber = targetPullRequest.title.includes(sourcePullRequest.number.toString());
|
|
47
|
+
return didCommitMatch || (titleIncludesMessage && titleIncludesNumber);
|
|
48
|
+
})
|
|
49
|
+
.map((item) => {
|
|
50
|
+
const { targetPullRequest } = item.node;
|
|
51
|
+
return {
|
|
52
|
+
url: targetPullRequest.url,
|
|
53
|
+
number: targetPullRequest.number,
|
|
54
|
+
branch: targetPullRequest.baseRefName,
|
|
55
|
+
state: targetPullRequest.state,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function getMissingTargetPullRequests(sourcePullRequest, existingTargetPullRequests, branchLabelMapping) {
|
|
60
|
+
const labels = sourcePullRequest.labels.nodes.map((label) => label.name);
|
|
61
|
+
const targetBranchesFromLabels = labels
|
|
62
|
+
.map((label) => (0, getTargetBranchesFromLabels_1.getTargetBranchForLabel)({ branchLabelMapping, label }))
|
|
63
|
+
.filter(filterEmpty_1.filterNil)
|
|
64
|
+
.filter((targetBranch) => targetBranch !== sourcePullRequest.baseRefName);
|
|
65
|
+
const expectedTargetBranches = existingTargetPullRequests.map((pr) => pr.branch);
|
|
66
|
+
const expected = (0, lodash_1.uniq)(targetBranchesFromLabels);
|
|
67
|
+
return expected
|
|
68
|
+
.filter((targetBranch) => !expectedTargetBranches.includes(targetBranch))
|
|
69
|
+
.map((branch) => {
|
|
70
|
+
return { branch, state: 'MISSING' };
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// narrow TimelineEdge to TimelinePullRequestEdge
|
|
74
|
+
function filterPullRequests(item) {
|
|
75
|
+
const { targetPullRequest } = item.node;
|
|
76
|
+
return targetPullRequest.__typename === 'PullRequest';
|
|
77
|
+
}
|
package/dist/services/git.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ValidConfigOptions } from '../options/options';
|
|
2
|
-
import { Commit } from '
|
|
2
|
+
import { Commit } from './sourceCommit/parseSourceCommit';
|
|
3
3
|
export declare function repoExists(options: ValidConfigOptions): Promise<boolean>;
|
|
4
4
|
export declare function deleteRepo(options: ValidConfigOptions): Promise<string[]>;
|
|
5
5
|
export declare function getRemoteUrl({ repoName, accessToken, gitHostname }: ValidConfigOptions, repoOwner: string): string;
|
|
@@ -8,13 +8,24 @@ export declare function getLocalConfigFileCommitDate(): Promise<number | undefin
|
|
|
8
8
|
export declare function isLocalConfigFileUntracked(): Promise<boolean | undefined>;
|
|
9
9
|
export declare function isLocalConfigFileModified(): Promise<boolean | undefined>;
|
|
10
10
|
export declare function getUpstreamFromGitRemote(): Promise<string | undefined>;
|
|
11
|
+
export declare function getIsCommitInBranch(options: ValidConfigOptions, commitSha: string): Promise<boolean>;
|
|
11
12
|
export declare function deleteRemote(options: ValidConfigOptions, remoteName: string): Promise<void>;
|
|
12
13
|
export declare function addRemote(options: ValidConfigOptions, remoteName: string): Promise<void>;
|
|
13
|
-
export declare function
|
|
14
|
+
export declare function fetchBranch(options: ValidConfigOptions, branch: string): Promise<void>;
|
|
15
|
+
export declare function cherrypick(options: ValidConfigOptions, sha: Commit['sha']): Promise<{
|
|
16
|
+
conflictingFiles: {
|
|
17
|
+
absolute: string;
|
|
18
|
+
relative: string;
|
|
19
|
+
}[];
|
|
20
|
+
unstagedFiles: string[];
|
|
14
21
|
needsResolving: boolean;
|
|
15
22
|
}>;
|
|
16
23
|
export declare function commitChanges(commit: Commit, options: ValidConfigOptions): Promise<void>;
|
|
17
|
-
export declare
|
|
24
|
+
export declare type ConflictingFiles = Awaited<ReturnType<typeof getConflictingFiles>>;
|
|
25
|
+
export declare function getConflictingFiles(options: ValidConfigOptions): Promise<{
|
|
26
|
+
absolute: string;
|
|
27
|
+
relative: string;
|
|
28
|
+
}[]>;
|
|
18
29
|
export declare function getUnstagedFiles(options: ValidConfigOptions): Promise<string[]>;
|
|
19
30
|
export declare function setCommitAuthor(options: ValidConfigOptions, username: string): Promise<{
|
|
20
31
|
stdout: string;
|
|
@@ -39,4 +50,4 @@ export declare function pushBackportBranch({ options, backportBranch, }: {
|
|
|
39
50
|
}): Promise<{
|
|
40
51
|
stdout: string;
|
|
41
52
|
stderr: string;
|
|
42
|
-
}
|
|
53
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
const path_1 = require("path");
|
|
26
|
+
const del_1 = __importDefault(require("del"));
|
|
27
|
+
const make_dir_1 = __importDefault(require("make-dir"));
|
|
28
|
+
const childProcess = __importStar(require("./child-process-promisified"));
|
|
29
|
+
const env = __importStar(require("./env"));
|
|
30
|
+
const git_1 = require("./git");
|
|
31
|
+
const commitFormatters_1 = require("./github/commitFormatters");
|
|
32
|
+
jest.unmock('make-dir');
|
|
33
|
+
jest.unmock('del');
|
|
34
|
+
const GIT_SANDBOX_DIR_PATH = (0, path_1.resolve)(`${__dirname}/git-test-temp`);
|
|
35
|
+
async function resetGitSandbox() {
|
|
36
|
+
await (0, del_1.default)(GIT_SANDBOX_DIR_PATH);
|
|
37
|
+
await (0, make_dir_1.default)(GIT_SANDBOX_DIR_PATH);
|
|
38
|
+
// mock repo path to point to git-sandbox dir
|
|
39
|
+
jest.spyOn(env, 'getRepoPath').mockReturnValue(GIT_SANDBOX_DIR_PATH);
|
|
40
|
+
}
|
|
41
|
+
async function createAndCommitFile({ filename, content, execOpts, }) {
|
|
42
|
+
await childProcess.exec(`echo "${content}" > "${filename}"`, execOpts);
|
|
43
|
+
await childProcess.exec(`git add -A && git commit -m 'Update ${filename}'`, execOpts);
|
|
44
|
+
return getCurrentSha(execOpts);
|
|
45
|
+
}
|
|
46
|
+
async function getCurrentSha(execOpts) {
|
|
47
|
+
const { stdout } = await childProcess.exec('git rev-parse HEAD', execOpts);
|
|
48
|
+
return stdout.trim();
|
|
49
|
+
}
|
|
50
|
+
async function getCurrentMessage(execOpts) {
|
|
51
|
+
const { stdout } = await childProcess.exec('git --no-pager log -1 --pretty=%B', execOpts);
|
|
52
|
+
return stdout.trim();
|
|
53
|
+
}
|
|
54
|
+
describe('git.integration', () => {
|
|
55
|
+
describe('getIsCommitInBranch', () => {
|
|
56
|
+
let firstSha;
|
|
57
|
+
let secondSha;
|
|
58
|
+
beforeEach(async () => {
|
|
59
|
+
await resetGitSandbox();
|
|
60
|
+
const execOpts = { cwd: GIT_SANDBOX_DIR_PATH };
|
|
61
|
+
// create and commit first file
|
|
62
|
+
await childProcess.exec('git init', execOpts);
|
|
63
|
+
firstSha = await createAndCommitFile({
|
|
64
|
+
filename: 'foo.md',
|
|
65
|
+
content: 'My first file',
|
|
66
|
+
execOpts,
|
|
67
|
+
});
|
|
68
|
+
// create 7.x branch (but stay on `main` branch)
|
|
69
|
+
await childProcess.exec('git branch 7.x', execOpts);
|
|
70
|
+
// create and commit second file
|
|
71
|
+
secondSha = await createAndCommitFile({
|
|
72
|
+
filename: 'bar.md',
|
|
73
|
+
content: 'My second file',
|
|
74
|
+
execOpts,
|
|
75
|
+
});
|
|
76
|
+
// checkout 7.x
|
|
77
|
+
await childProcess.exec('git checkout 7.x', execOpts);
|
|
78
|
+
});
|
|
79
|
+
it('should contain the first commit', async () => {
|
|
80
|
+
const isFirstCommitInBranch = await (0, git_1.getIsCommitInBranch)({}, firstSha);
|
|
81
|
+
expect(isFirstCommitInBranch).toEqual(true);
|
|
82
|
+
});
|
|
83
|
+
it('should not contain the second commit', async () => {
|
|
84
|
+
const isSecondCommitInBranch = await (0, git_1.getIsCommitInBranch)({}, secondSha);
|
|
85
|
+
expect(isSecondCommitInBranch).toEqual(false);
|
|
86
|
+
});
|
|
87
|
+
it('should not contain a random commit', async () => {
|
|
88
|
+
const isSecondCommitInBranch = await (0, git_1.getIsCommitInBranch)({}, 'abcdefg');
|
|
89
|
+
expect(isSecondCommitInBranch).toEqual(false);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe('cherrypick', () => {
|
|
93
|
+
let firstSha;
|
|
94
|
+
let secondSha;
|
|
95
|
+
let fourthSha;
|
|
96
|
+
let execOpts;
|
|
97
|
+
beforeEach(async () => {
|
|
98
|
+
await resetGitSandbox();
|
|
99
|
+
execOpts = { cwd: GIT_SANDBOX_DIR_PATH };
|
|
100
|
+
// create and commit first file
|
|
101
|
+
await childProcess.exec('git init', execOpts);
|
|
102
|
+
firstSha = await createAndCommitFile({
|
|
103
|
+
filename: 'foo.md',
|
|
104
|
+
content: 'Creating first file',
|
|
105
|
+
execOpts,
|
|
106
|
+
});
|
|
107
|
+
// create 7.x branch (but stay on `main` branch)
|
|
108
|
+
await childProcess.exec('git branch 7.x', execOpts);
|
|
109
|
+
// create and commit second file
|
|
110
|
+
secondSha = await createAndCommitFile({
|
|
111
|
+
filename: 'bar.md',
|
|
112
|
+
content: 'Creating second file\nHello',
|
|
113
|
+
execOpts,
|
|
114
|
+
});
|
|
115
|
+
// edit first file
|
|
116
|
+
await createAndCommitFile({
|
|
117
|
+
filename: 'foo.md',
|
|
118
|
+
content: 'Changing first file',
|
|
119
|
+
execOpts,
|
|
120
|
+
});
|
|
121
|
+
// edit first file
|
|
122
|
+
fourthSha = await createAndCommitFile({
|
|
123
|
+
filename: 'foo.md',
|
|
124
|
+
content: 'Some more changes to the first file',
|
|
125
|
+
execOpts,
|
|
126
|
+
});
|
|
127
|
+
// checkout 7.x
|
|
128
|
+
await childProcess.exec('git checkout 7.x', execOpts);
|
|
129
|
+
});
|
|
130
|
+
it('should not cherrypick commit that already exists', async () => {
|
|
131
|
+
const shortSha = (0, commitFormatters_1.getShortSha)(firstSha);
|
|
132
|
+
return expect(() => (0, git_1.cherrypick)({}, firstSha)).rejects.toThrowError(`Cherrypick failed because the selected commit (${shortSha}) is empty. Did you already backport this commit?`);
|
|
133
|
+
});
|
|
134
|
+
it('should cherrypick commit cleanly', async () => {
|
|
135
|
+
const res = await (0, git_1.cherrypick)({ cherrypickRef: false }, secondSha);
|
|
136
|
+
expect(res).toEqual({
|
|
137
|
+
conflictingFiles: [],
|
|
138
|
+
needsResolving: false,
|
|
139
|
+
unstagedFiles: [],
|
|
140
|
+
});
|
|
141
|
+
const message = await getCurrentMessage(execOpts);
|
|
142
|
+
expect(message).toEqual(`Update bar.md`);
|
|
143
|
+
});
|
|
144
|
+
it('should cherrypick commit cleanly and append "(cherry picked from commit...)"', async () => {
|
|
145
|
+
const res = await (0, git_1.cherrypick)({ cherrypickRef: true }, secondSha);
|
|
146
|
+
expect(res).toEqual({
|
|
147
|
+
conflictingFiles: [],
|
|
148
|
+
needsResolving: false,
|
|
149
|
+
unstagedFiles: [],
|
|
150
|
+
});
|
|
151
|
+
const message = await getCurrentMessage(execOpts);
|
|
152
|
+
expect(message).toEqual(`Update bar.md\n\n(cherry picked from commit ${secondSha})`);
|
|
153
|
+
});
|
|
154
|
+
it('should cherrypick commit with conflicts', async () => {
|
|
155
|
+
const res = await (0, git_1.cherrypick)({}, fourthSha);
|
|
156
|
+
expect(res).toEqual({
|
|
157
|
+
needsResolving: true,
|
|
158
|
+
conflictingFiles: [
|
|
159
|
+
{
|
|
160
|
+
absolute: `${GIT_SANDBOX_DIR_PATH}/foo.md`,
|
|
161
|
+
relative: 'foo.md',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
unstagedFiles: [`${GIT_SANDBOX_DIR_PATH}/foo.md`],
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|