backport 7.3.6 → 7.4.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 +1 -5
- package/dist/backportRun.d.ts +9 -3
- package/dist/backportRun.js +18 -9
- package/dist/entrypoint.cli.js +1 -1
- package/dist/entrypoint.module.js +5 -1
- package/dist/entrypoint.module.private.test.js +103 -5
- package/dist/options/ConfigOptions.d.ts +2 -2
- package/dist/options/cliArgs.d.ts +1 -2
- package/dist/options/cliArgs.js +4 -6
- package/dist/options/config/config.d.ts +2 -2
- package/dist/options/config/config.js +2 -2
- package/dist/options/config/projectConfig.d.ts +2 -2
- package/dist/options/config/projectConfig.js +3 -3
- package/dist/options/config/projectConfig.test.js +19 -7
- package/dist/options/config/readConfigFile.d.ts +2 -2
- package/dist/options/options.d.ts +1 -2
- package/dist/options/options.js +2 -3
- package/dist/options/options.test.js +2 -3
- package/dist/runSequentially.d.ts +1 -1
- package/dist/runSequentially.js +0 -1
- package/dist/services/HandledError.d.ts +6 -2
- package/dist/services/HandledError.js +8 -8
- package/dist/services/git.js +0 -4
- package/dist/services/git.test.js +0 -34
- package/dist/services/github/v3/createStatusComment.js +3 -2
- package/dist/services/github/v3/createStatusComment.test.js +2 -0
- package/dist/services/github/v4/apiRequestV4.js +6 -9
- package/dist/services/github/v4/fetchAuthorId.private.test.js +3 -6
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +5 -6
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +5 -8
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +5 -8
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +4 -7
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +3 -6
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +3 -6
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.js +4 -7
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +2 -2
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +6 -7
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +4 -7
- package/dist/services/logger.d.ts +1 -4
- package/dist/services/logger.js +9 -18
- package/dist/test/e2e/cli/entrypoint.cli.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +219 -0
- package/dist/test/e2e/module/entrypoint.module.mutation.test.d.ts +1 -0
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +369 -0
- package/dist/test/handleUnbackportedPullRequests.private.test.js +1 -2
- package/dist/test/setupFiles/automatic-mocks.js +11 -11
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +7 -3
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +1 -1
|
@@ -43,21 +43,21 @@ jest.mock('del', () => {
|
|
|
43
43
|
return jest.fn(async (path) => `Attempted to delete ${path}`);
|
|
44
44
|
});
|
|
45
45
|
(0, mocks_1.mockOra)();
|
|
46
|
-
// silence logger
|
|
47
46
|
jest.mock('../../services/logger', () => {
|
|
48
47
|
const spy = jest.fn();
|
|
48
|
+
const logger = {
|
|
49
|
+
spy: spy,
|
|
50
|
+
info: (msg, meta) => spy(`[INFO] ${msg}`, meta),
|
|
51
|
+
verbose: (msg, meta) => spy(`[VERBOSE] ${msg}`, meta),
|
|
52
|
+
warn: (msg, meta) => spy(`[WARN] ${msg}`, meta),
|
|
53
|
+
error: (msg, meta) => spy(`[ERROR] ${msg}`, meta),
|
|
54
|
+
debug: (msg, meta) => spy(`[DEBUG] ${msg}`, meta),
|
|
55
|
+
};
|
|
49
56
|
return {
|
|
50
|
-
initLogger: jest.fn(),
|
|
57
|
+
initLogger: jest.fn(() => logger),
|
|
51
58
|
redactAccessToken: jest.fn((str) => str),
|
|
52
59
|
consoleLog: jest.fn(),
|
|
53
|
-
|
|
54
|
-
logger
|
|
55
|
-
spy: spy,
|
|
56
|
-
info: (msg, meta) => spy(`[INFO] ${msg}`, meta),
|
|
57
|
-
verbose: (msg, meta) => spy(`[VERBOSE] ${msg}`, meta),
|
|
58
|
-
warn: (msg, meta) => spy(`[WARN] ${msg}`, meta),
|
|
59
|
-
error: (msg, meta) => spy(`[ERROR] ${msg}`, meta),
|
|
60
|
-
debug: (msg, meta) => spy(`[DEBUG] ${msg}`, meta),
|
|
61
|
-
},
|
|
60
|
+
setAccessToken: jest.fn(),
|
|
61
|
+
logger,
|
|
62
62
|
};
|
|
63
63
|
});
|
|
@@ -140,16 +140,20 @@ async function waitForCherrypick(options, commit, targetBranch, gitConfigAuthor)
|
|
|
140
140
|
}
|
|
141
141
|
autoResolveSpinner.fail();
|
|
142
142
|
}
|
|
143
|
+
const conflictingFilesRelative = conflictingFiles
|
|
144
|
+
.map((f) => f.relative)
|
|
145
|
+
.slice(0, 50);
|
|
143
146
|
const commitsWithoutBackports = await (0, getCommitsWithoutBackports_1.getCommitsWithoutBackports)({
|
|
144
147
|
options,
|
|
145
148
|
commit,
|
|
146
149
|
targetBranch,
|
|
147
|
-
conflictingFiles:
|
|
150
|
+
conflictingFiles: conflictingFilesRelative,
|
|
148
151
|
});
|
|
149
152
|
if (options.ci) {
|
|
150
153
|
throw new HandledError_1.HandledError({
|
|
151
154
|
code: 'merge-conflict-exception',
|
|
152
155
|
commitsWithoutBackports,
|
|
156
|
+
conflictingFiles: conflictingFilesRelative,
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
159
|
(0, logger_1.consoleLog)(chalk_1.default.bold('\nThe commit could not be backported due to conflicts\n'));
|
|
@@ -201,13 +205,13 @@ async function listConflictingAndUnstagedFiles({ retries, options, conflictingFi
|
|
|
201
205
|
const unstagedSection = hasUnstagedFiles
|
|
202
206
|
? `Unstaged files:\n${chalk_1.default.reset(unstagedFiles.map((file) => ` - ${file}`).join('\n'))}`
|
|
203
207
|
: '';
|
|
204
|
-
const
|
|
208
|
+
const didConfirm = await (0, prompts_1.confirmPrompt)(`${header}
|
|
205
209
|
|
|
206
210
|
${conflictSection}
|
|
207
211
|
${unstagedSection}
|
|
208
212
|
|
|
209
213
|
Press ENTER when the conflicts are resolved and files are staged`);
|
|
210
|
-
if (!
|
|
214
|
+
if (!didConfirm) {
|
|
211
215
|
throw new HandledError_1.HandledError({ code: 'abort-exception' });
|
|
212
216
|
}
|
|
213
217
|
const MAX_RETRIES = 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "7.
|
|
1
|
+
export declare const PACKAGE_VERSION = "7.4.0";
|