bdy 1.25.43-dev-pr → 1.25.44-dev
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/distTs/package.json +6 -5
- package/distTs/src/api/client.js +1 -191
- package/distTs/src/cliError.js +0 -5
- package/distTs/src/cliIndex.js +0 -3
- package/distTs/src/command/login.js +1 -1
- package/distTs/src/output/pipeline.js +56 -54
- package/distTs/src/output.js +22 -85
- package/distTs/src/texts.js +1 -510
- package/distTs/src/tunnel/output/interactive/tunnel.js +10 -14
- package/distTs/src/tunnel/output/noninteractive/tunnel.js +1 -3
- package/distTs/src/utils.js +6 -142
- package/package.json +6 -5
- package/distTs/src/autocomplete.js +0 -90
- package/distTs/src/command/artifact/downloadDir.js +0 -110
- package/distTs/src/command/autocomplete/install.js +0 -16
- package/distTs/src/command/autocomplete/uninstall.js +0 -16
- package/distTs/src/command/autocomplete.js +0 -14
- package/distTs/src/command/environment/resolve.js +0 -39
- package/distTs/src/command/package/create.js +0 -64
- package/distTs/src/command/package/delete.js +0 -38
- package/distTs/src/command/package/docker/login.js +0 -26
- package/distTs/src/command/package/docker.js +0 -11
- package/distTs/src/command/package/download.js +0 -138
- package/distTs/src/command/package/get.js +0 -36
- package/distTs/src/command/package/list.js +0 -31
- package/distTs/src/command/package/publish.js +0 -241
- package/distTs/src/command/package/version/delete.js +0 -39
- package/distTs/src/command/package/version/get.js +0 -45
- package/distTs/src/command/package/version/list.js +0 -47
- package/distTs/src/command/package/version.js +0 -16
- package/distTs/src/command/package.js +0 -26
- package/distTs/src/command/pipeline/run/apply.js +0 -62
- package/distTs/src/command/pr/comment/add.js +0 -66
- package/distTs/src/command/pr/comment/list.js +0 -167
- package/distTs/src/command/pr/comment/status.js +0 -50
- package/distTs/src/command/pr/comment.js +0 -19
- package/distTs/src/command/pr/create.js +0 -44
- package/distTs/src/command/pr/diff.js +0 -337
- package/distTs/src/command/pr/file/list.js +0 -139
- package/distTs/src/command/pr/file/mark.js +0 -45
- package/distTs/src/command/pr/file.js +0 -16
- package/distTs/src/command/pr/get.js +0 -29
- package/distTs/src/command/pr/list.js +0 -79
- package/distTs/src/command/pr/merge.js +0 -67
- package/distTs/src/command/pr/review/request.js +0 -30
- package/distTs/src/command/pr/review/start.js +0 -29
- package/distTs/src/command/pr/review/verdict.js +0 -81
- package/distTs/src/command/pr/review.js +0 -18
- package/distTs/src/command/pr/shared.js +0 -704
- package/distTs/src/command/pr/state.js +0 -38
- package/distTs/src/command/pr/summary.js +0 -341
- package/distTs/src/command/pr/update.js +0 -56
- package/distTs/src/command/pr/updateBranch.js +0 -22
- package/distTs/src/command/pr/versions.js +0 -42
- package/distTs/src/command/pr.js +0 -39
- package/distTs/src/command/scrape/validation.js +0 -154
- package/distTs/src/command/scrape.js +0 -144
- package/distTs/src/command/suiteLink.js +0 -14
- package/distTs/src/command/tests/visual/result/download.js +0 -31
- package/distTs/src/command/tests/visual/result/get.js +0 -68
- package/distTs/src/command/tests/visual/result/list.js +0 -49
- package/distTs/src/command/tests/visual/result.js +0 -23
- package/distTs/src/command/tests/visual/session/get.js +0 -70
- package/distTs/src/command/tests/visual/session/list.js +0 -69
- package/distTs/src/command/tests/visual/session/open.js +0 -22
- package/distTs/src/command/tests/visual/session/reviewUrl.js +0 -37
- package/distTs/src/command/tests/visual/session/update.js +0 -26
- package/distTs/src/command/tests/visual/shared/context.js +0 -144
- package/distTs/src/command/tests/visual/shared/diffRegions.js +0 -172
- package/distTs/src/command/tests/visual/shared/format.js +0 -21
- package/distTs/src/command/tests/visual/shared/lookup.js +0 -107
- package/distTs/src/command/tests/visual/shared/options.js +0 -90
- package/distTs/src/command/tests/visual/shared/review.js +0 -146
- package/distTs/src/command/tests/visual/shared/reviewUrl.js +0 -62
- package/distTs/src/command/tests/visual/shared/session.js +0 -217
- package/distTs/src/command/tests/visual/snapshot/get.js +0 -46
- package/distTs/src/command/tests/visual/snapshot/list.js +0 -68
- package/distTs/src/command/tests/visual/snapshot/open.js +0 -26
- package/distTs/src/command/tests/visual/snapshot/reviewUrl.js +0 -48
- package/distTs/src/command/tests/visual/snapshot.js +0 -28
- package/distTs/src/command/tests/visual/suite/create.js +0 -38
- package/distTs/src/command/tests/visual/suite/delete.js +0 -29
- package/distTs/src/command/tests/visual/suite/get.js +0 -43
- package/distTs/src/command/tests/visual/suite/list.js +0 -35
- package/distTs/src/command/tests/visual/suite/open.js +0 -20
- package/distTs/src/command/tests/visual/suite/update.js +0 -47
- package/distTs/src/command/tests/visual/suite.js +0 -30
- package/distTs/src/command/ut/upload.js +0 -86
- package/distTs/src/command/ut.js +0 -12
- package/distTs/src/command/vt/close.js +0 -27
- package/distTs/src/command/vt/compare/validation.js +0 -46
- package/distTs/src/command/vt/compare.js +0 -100
- package/distTs/src/command/vt/exec.js +0 -82
- package/distTs/src/command/vt/installBrowser.js +0 -20
- package/distTs/src/command/vt/shared/validation.js +0 -145
- package/distTs/src/command/vt/storybook.js +0 -138
- package/distTs/src/command/vt.js +0 -20
- package/distTs/src/command/yaml/agents.js +0 -88
- package/distTs/src/command/yaml/init.js +0 -110
- package/distTs/src/main.js +0 -190
- package/distTs/src/types/options.js +0 -2
- package/distTs/src/types/scrape.js +0 -2
- package/distTs/src/types/visualTests.js +0 -2
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const texts_1 = require("../../texts");
|
|
8
|
-
const output_1 = __importDefault(require("../../output"));
|
|
9
|
-
const cliError_1 = __importDefault(require("../../cliError"));
|
|
10
|
-
const shared_1 = require("./shared");
|
|
11
|
-
const commandPrMerge = (0, utils_1.newCommand)('merge', texts_1.DESC_COMMAND_PR_MERGE, {
|
|
12
|
-
requiredScopes: [utils_1.REST_API_SCOPE.REPOSITORY_WRITE],
|
|
13
|
-
examples: texts_1.EXAMPLE_PR_MERGE,
|
|
14
|
-
});
|
|
15
|
-
(0, shared_1.addPrOptions)(commandPrMerge, true);
|
|
16
|
-
commandPrMerge.option('--method <method>', texts_1.OPTION_PR_MERGE_METHOD);
|
|
17
|
-
commandPrMerge.option('--delete-branch', texts_1.OPTION_PR_DELETE_BRANCH);
|
|
18
|
-
commandPrMerge.option('--message <text|->', texts_1.OPTION_PR_MERGE_MESSAGE);
|
|
19
|
-
commandPrMerge.option('--message-file <path|->', texts_1.OPTION_PR_MERGE_MESSAGE_FILE);
|
|
20
|
-
commandPrMerge.option('--no-review', texts_1.OPTION_PR_NO_REVIEW);
|
|
21
|
-
commandPrMerge.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
|
|
22
|
-
commandPrMerge.argument('[N]', texts_1.OPTION_PR_NUMBER);
|
|
23
|
-
commandPrMerge.action(async (n, options) => {
|
|
24
|
-
const method = String(options.method || utils_1.PR_MERGE_METHOD.MERGE).toUpperCase();
|
|
25
|
-
if (!Object.values(utils_1.PR_MERGE_METHOD).includes(method)) {
|
|
26
|
-
throw new cliError_1.default('usage_error', texts_1.ERR_PR_MERGE_METHOD);
|
|
27
|
-
}
|
|
28
|
-
const rev = (0, shared_1.parseRev)(options.rev);
|
|
29
|
-
const commitMessage = (0, shared_1.readText)(options, false);
|
|
30
|
-
const json = options.format === 'json';
|
|
31
|
-
const scope = (0, shared_1.prScope)(options);
|
|
32
|
-
const number = await (0, shared_1.resolveNumber)(scope, n);
|
|
33
|
-
const { client, workspace, project } = scope;
|
|
34
|
-
// the version is fixed before the prompt, so a version that appears meanwhile is refused (409)
|
|
35
|
-
const pr = await client.getPullRequest(workspace, project, number);
|
|
36
|
-
const version = rev ?? pr.version;
|
|
37
|
-
if (!json)
|
|
38
|
-
(0, shared_1.noteVersionBehind)(pr.version, version);
|
|
39
|
-
// -f skips only the prompt; --no-review skips this check
|
|
40
|
-
if (options.review !== false) {
|
|
41
|
-
const result = await client.getPullRequestReviews(workspace, project, number);
|
|
42
|
-
const reviews = result?.reviews || [];
|
|
43
|
-
if (!reviews.some((r) => r.verdict === utils_1.PR_VERDICT.APPROVED)) {
|
|
44
|
-
throw new cliError_1.default('usage_error', texts_1.ERR_PR_NOT_APPROVED);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const confirmed = await output_1.default.confirmDestructive(options.force, (0, texts_1.TXT_PR_MERGE_CONFIRM)(number, version, method), json);
|
|
48
|
-
if (!confirmed)
|
|
49
|
-
output_1.default.exitResult(json, { merged: null });
|
|
50
|
-
let merged;
|
|
51
|
-
try {
|
|
52
|
-
merged = await client.mergePullRequest(workspace, project, number, {
|
|
53
|
-
version,
|
|
54
|
-
method,
|
|
55
|
-
delete_branch: options.deleteBranch ? true : undefined,
|
|
56
|
-
commit_message: commitMessage,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
if ((0, shared_1.isVersionConflict)(err)) {
|
|
61
|
-
throw new cliError_1.default('usage_error', (0, texts_1.TXT_PR_MERGE_VERSION_CONFLICT)(scope.cmd, number, (0, shared_1.conflictVersion)(err)));
|
|
62
|
-
}
|
|
63
|
-
throw err;
|
|
64
|
-
}
|
|
65
|
-
output_1.default.exitResult(json, merged, (0, texts_1.TXT_PR_MERGED)(number, version));
|
|
66
|
-
});
|
|
67
|
-
exports.default = commandPrMerge;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
const texts_1 = require("../../../texts");
|
|
8
|
-
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
-
const cliError_1 = __importDefault(require("../../../cliError"));
|
|
10
|
-
const shared_1 = require("../shared");
|
|
11
|
-
const commandPrReviewRequest = (0, utils_1.newCommand)('request', texts_1.DESC_COMMAND_PR_REVIEW_REQUEST, {
|
|
12
|
-
requiredScopes: [utils_1.REST_API_SCOPE.REPOSITORY_WRITE],
|
|
13
|
-
examples: texts_1.EXAMPLE_PR_REVIEW_REQUEST,
|
|
14
|
-
});
|
|
15
|
-
// asking for a review does not depend on a version
|
|
16
|
-
(0, shared_1.addPrOptions)(commandPrReviewRequest, 'ignored');
|
|
17
|
-
// `[N] <login...>`: N is split off in the action
|
|
18
|
-
commandPrReviewRequest.argument('<logins...>', texts_1.OPTION_PR_REVIEW_LOGINS);
|
|
19
|
-
commandPrReviewRequest.usage('[options] [N] <login...>');
|
|
20
|
-
commandPrReviewRequest.action(async (args, options) => {
|
|
21
|
-
const { number: n, rest: logins } = (0, shared_1.splitNumberArgs)(args);
|
|
22
|
-
if (logins.length === 0) {
|
|
23
|
-
throw new cliError_1.default('usage_error', (0, texts_1.ERR_PR_ARGS)('[N] <login...>', args.join(' ')));
|
|
24
|
-
}
|
|
25
|
-
const scope = (0, shared_1.prScope)(options);
|
|
26
|
-
const number = await (0, shared_1.resolveNumber)(scope, n);
|
|
27
|
-
const pr = await scope.client.requestPullRequestReview(scope.workspace, scope.project, number, logins);
|
|
28
|
-
output_1.default.exitResult(options.format === 'json', pr, (0, texts_1.TXT_PR_REVIEW_REQUESTED)(logins.join(', ')));
|
|
29
|
-
});
|
|
30
|
-
exports.default = commandPrReviewRequest;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
const texts_1 = require("../../../texts");
|
|
8
|
-
const output_1 = __importDefault(require("../../../output"));
|
|
9
|
-
const shared_1 = require("../shared");
|
|
10
|
-
const summary_1 = require("../summary");
|
|
11
|
-
const commandPrReviewStart = (0, utils_1.newCommand)('start', texts_1.DESC_COMMAND_PR_REVIEW_START, {
|
|
12
|
-
requiredScopes: [utils_1.REST_API_SCOPE.REPOSITORY_WRITE],
|
|
13
|
-
examples: texts_1.EXAMPLE_PR_REVIEW_START,
|
|
14
|
-
});
|
|
15
|
-
(0, shared_1.addPrOptions)(commandPrReviewStart, true);
|
|
16
|
-
commandPrReviewStart.argument('[N]', texts_1.OPTION_PR_NUMBER);
|
|
17
|
-
commandPrReviewStart.action(async (n, options) => {
|
|
18
|
-
const version = (0, shared_1.parseRev)(options.rev);
|
|
19
|
-
const scope = (0, shared_1.prScope)(options);
|
|
20
|
-
const number = await (0, shared_1.resolveNumber)(scope, n);
|
|
21
|
-
// idempotent: an existing review stays as it is
|
|
22
|
-
await scope.client.startPullRequestReview(scope.workspace, scope.project, number, version);
|
|
23
|
-
await (0, summary_1.printSummary)(scope, number, {
|
|
24
|
-
rev: version,
|
|
25
|
-
json: options.format === 'json',
|
|
26
|
-
});
|
|
27
|
-
output_1.default.exitNormal();
|
|
28
|
-
});
|
|
29
|
-
exports.default = commandPrReviewStart;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.commandPrReviewRequestChanges = exports.commandPrReviewApprove = void 0;
|
|
7
|
-
const utils_1 = require("../../../utils");
|
|
8
|
-
const texts_1 = require("../../../texts");
|
|
9
|
-
const output_1 = __importDefault(require("../../../output"));
|
|
10
|
-
const cliError_1 = __importDefault(require("../../../cliError"));
|
|
11
|
-
const shared_1 = require("../shared");
|
|
12
|
-
/**
|
|
13
|
-
* The reasons of a refused approval, in a form an agent can act on: the
|
|
14
|
-
* threads not CLOSED, the unviewed MUST_REVIEW files (as the batches holding
|
|
15
|
-
* them when the list is split) and a pending triage.
|
|
16
|
-
*/
|
|
17
|
-
const blockedError = async (scope, number, version, err) => {
|
|
18
|
-
const body = err.body || {};
|
|
19
|
-
const lines = [`${texts_1.ERR_PR_APPROVAL_BLOCKED}: ${err.message}`];
|
|
20
|
-
const threads = body.open_threads || [];
|
|
21
|
-
const threadsCount = body.open_threads_count ?? threads.length;
|
|
22
|
-
if (threadsCount > 0) {
|
|
23
|
-
lines.push(`${(0, texts_1.TXT_PR_APPROVAL_OPEN_THREADS)(threadsCount)}${threads.length ? ` (${threads.join(', ')})` : ''}`);
|
|
24
|
-
lines.push(` ${scope.cmd(`comment ls ${number} --threads${version ? ` --rev v${version}` : ''}`)}`);
|
|
25
|
-
}
|
|
26
|
-
const notViewed = body.must_review_not_viewed || [];
|
|
27
|
-
const notViewedCount = body.must_review_not_viewed_count ?? notViewed.length;
|
|
28
|
-
if (notViewedCount > 0) {
|
|
29
|
-
lines.push((0, texts_1.TXT_PR_APPROVAL_NOT_VIEWED)(notViewedCount));
|
|
30
|
-
const mustReview = await (0, shared_1.fetchMustReview)(scope, number, version).catch(() => null);
|
|
31
|
-
const shown = mustReview?.version ?? version;
|
|
32
|
-
const batches = (0, shared_1.buildBatches)(mustReview?.files || []);
|
|
33
|
-
const missing = new Set((mustReview?.files || []).filter((f) => !f.viewed).map((f) => f.file_name));
|
|
34
|
-
const open = batches.filter((b) => b.files.some((f) => missing.has(f.file_name)));
|
|
35
|
-
if (open.length > 0) {
|
|
36
|
-
lines.push(texts_1.TXT_PR_APPROVAL_BATCHES);
|
|
37
|
-
open.forEach((b) => lines.push(` ${(0, texts_1.TXT_PR_BATCH_LINE)(b.batch, b.files.length, b.tokens, scope.cmd(`file ls ${number} --batch ${b.batch}${shown ? ` --rev v${shown}` : ''}`))}`));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
const paths = missing.size > 0 ? [...missing] : notViewed;
|
|
41
|
-
paths.forEach((path) => lines.push(` ${path}`));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (body.triage_pending)
|
|
45
|
-
lines.push(texts_1.TXT_PR_APPROVAL_TRIAGE_PENDING);
|
|
46
|
-
return new cliError_1.default('usage_error', lines.join('\n'), texts_1.TXT_PR_APPROVAL_FORCE_HINT);
|
|
47
|
-
};
|
|
48
|
-
const verdictCommand = (name, description, examples, verdict) => {
|
|
49
|
-
const command = (0, utils_1.newCommand)(name, description, {
|
|
50
|
-
requiredScopes: [utils_1.REST_API_SCOPE.REPOSITORY_WRITE],
|
|
51
|
-
examples,
|
|
52
|
-
});
|
|
53
|
-
(0, shared_1.addPrOptions)(command, true);
|
|
54
|
-
if (verdict === utils_1.PR_VERDICT.APPROVED)
|
|
55
|
-
command.option('--force', texts_1.OPTION_PR_APPROVE_FORCE);
|
|
56
|
-
command.argument('[N]', texts_1.OPTION_PR_NUMBER);
|
|
57
|
-
command.action(async (n, options) => {
|
|
58
|
-
const version = (0, shared_1.parseRev)(options.rev);
|
|
59
|
-
const scope = (0, shared_1.prScope)(options);
|
|
60
|
-
const number = await (0, shared_1.resolveNumber)(scope, n);
|
|
61
|
-
let review;
|
|
62
|
-
try {
|
|
63
|
-
review = await scope.client.submitPullRequestVerdict(scope.workspace, scope.project, number, { verdict, version, force: options.force ? true : undefined });
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
if ((0, shared_1.isVersionConflict)(err)) {
|
|
67
|
-
throw new cliError_1.default('usage_error', (0, texts_1.TXT_PR_VERSION_CONFLICT)(scope.cmd, number, (0, shared_1.conflictVersion)(err)));
|
|
68
|
-
}
|
|
69
|
-
if (err instanceof cliError_1.default && err.status === 400 && err.body && (err.body.open_threads_count !== undefined ||
|
|
70
|
-
err.body.must_review_not_viewed_count !== undefined ||
|
|
71
|
-
err.body.triage_pending !== undefined)) {
|
|
72
|
-
throw await blockedError(scope, number, version, err);
|
|
73
|
-
}
|
|
74
|
-
throw err;
|
|
75
|
-
}
|
|
76
|
-
output_1.default.exitResult(options.format === 'json', review, (0, texts_1.TXT_PR_REVIEW_VERDICT)(review?.verdict ?? verdict, review?.version ?? version));
|
|
77
|
-
});
|
|
78
|
-
return command;
|
|
79
|
-
};
|
|
80
|
-
exports.commandPrReviewApprove = verdictCommand('approve', texts_1.DESC_COMMAND_PR_REVIEW_APPROVE, texts_1.EXAMPLE_PR_REVIEW_APPROVE, utils_1.PR_VERDICT.APPROVED);
|
|
81
|
-
exports.commandPrReviewRequestChanges = verdictCommand('request-changes', texts_1.DESC_COMMAND_PR_REVIEW_REQUEST_CHANGES, texts_1.EXAMPLE_PR_REVIEW_REQUEST_CHANGES, utils_1.PR_VERDICT.CHANGE_REQUESTED);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const texts_1 = require("../../texts");
|
|
8
|
-
const start_1 = __importDefault(require("./review/start"));
|
|
9
|
-
const verdict_1 = require("./review/verdict");
|
|
10
|
-
const request_1 = __importDefault(require("./review/request"));
|
|
11
|
-
const commandPrReview = (0, utils_1.newCommand)('review', texts_1.DESC_COMMAND_PR_REVIEW, {
|
|
12
|
-
examples: texts_1.EXAMPLE_PR_REVIEW,
|
|
13
|
-
});
|
|
14
|
-
commandPrReview.addCommand(start_1.default);
|
|
15
|
-
commandPrReview.addCommand(verdict_1.commandPrReviewApprove);
|
|
16
|
-
commandPrReview.addCommand(verdict_1.commandPrReviewRequestChanges);
|
|
17
|
-
commandPrReview.addCommand(request_1.default);
|
|
18
|
-
exports.default = commandPrReview;
|