bdy 1.25.37-dev → 1.25.38-dev-pr
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 +2 -1
- package/distTs/src/agent/agent.js +65 -6
- package/distTs/src/api/client.js +191 -1
- package/distTs/src/autocomplete.js +90 -0
- package/distTs/src/cliError.js +5 -0
- package/distTs/src/cliIndex.js +3 -0
- package/distTs/src/command/artifact/downloadDir.js +110 -0
- package/distTs/src/command/autocomplete/install.js +16 -0
- package/distTs/src/command/autocomplete/uninstall.js +16 -0
- package/distTs/src/command/autocomplete.js +14 -0
- package/distTs/src/command/environment/resolve.js +39 -0
- package/distTs/src/command/login.js +1 -1
- package/distTs/src/command/package/create.js +64 -0
- package/distTs/src/command/package/delete.js +38 -0
- package/distTs/src/command/package/docker/login.js +26 -0
- package/distTs/src/command/package/docker.js +11 -0
- package/distTs/src/command/package/download.js +138 -0
- package/distTs/src/command/package/get.js +36 -0
- package/distTs/src/command/package/list.js +31 -0
- package/distTs/src/command/package/publish.js +241 -0
- package/distTs/src/command/package/version/delete.js +39 -0
- package/distTs/src/command/package/version/get.js +45 -0
- package/distTs/src/command/package/version/list.js +47 -0
- package/distTs/src/command/package/version.js +16 -0
- package/distTs/src/command/package.js +26 -0
- package/distTs/src/command/pipeline/run/apply.js +62 -0
- package/distTs/src/command/pr/comment/add.js +66 -0
- package/distTs/src/command/pr/comment/list.js +169 -0
- package/distTs/src/command/pr/comment/status.js +48 -0
- package/distTs/src/command/pr/comment.js +19 -0
- package/distTs/src/command/pr/create.js +43 -0
- package/distTs/src/command/pr/diff.js +227 -0
- package/distTs/src/command/pr/file/list.js +124 -0
- package/distTs/src/command/pr/file/mark.js +45 -0
- package/distTs/src/command/pr/file.js +16 -0
- package/distTs/src/command/pr/get.js +29 -0
- package/distTs/src/command/pr/list.js +79 -0
- package/distTs/src/command/pr/merge.js +66 -0
- package/distTs/src/command/pr/review/request.js +29 -0
- package/distTs/src/command/pr/review/start.js +29 -0
- package/distTs/src/command/pr/review/verdict.js +81 -0
- package/distTs/src/command/pr/review.js +18 -0
- package/distTs/src/command/pr/shared.js +595 -0
- package/distTs/src/command/pr/state.js +38 -0
- package/distTs/src/command/pr/summary.js +316 -0
- package/distTs/src/command/pr/update.js +54 -0
- package/distTs/src/command/pr/updateBranch.js +22 -0
- package/distTs/src/command/pr/versions.js +42 -0
- package/distTs/src/command/pr.js +39 -0
- package/distTs/src/command/scrape/validation.js +154 -0
- package/distTs/src/command/scrape.js +144 -0
- package/distTs/src/command/suiteLink.js +14 -0
- package/distTs/src/command/tests/visual/result/download.js +31 -0
- package/distTs/src/command/tests/visual/result/get.js +68 -0
- package/distTs/src/command/tests/visual/result/list.js +49 -0
- package/distTs/src/command/tests/visual/result.js +23 -0
- package/distTs/src/command/tests/visual/session/get.js +70 -0
- package/distTs/src/command/tests/visual/session/list.js +69 -0
- package/distTs/src/command/tests/visual/session/open.js +22 -0
- package/distTs/src/command/tests/visual/session/reviewUrl.js +37 -0
- package/distTs/src/command/tests/visual/session/update.js +26 -0
- package/distTs/src/command/tests/visual/shared/context.js +144 -0
- package/distTs/src/command/tests/visual/shared/diffRegions.js +172 -0
- package/distTs/src/command/tests/visual/shared/format.js +21 -0
- package/distTs/src/command/tests/visual/shared/lookup.js +107 -0
- package/distTs/src/command/tests/visual/shared/options.js +90 -0
- package/distTs/src/command/tests/visual/shared/review.js +146 -0
- package/distTs/src/command/tests/visual/shared/reviewUrl.js +62 -0
- package/distTs/src/command/tests/visual/shared/session.js +217 -0
- package/distTs/src/command/tests/visual/snapshot/get.js +46 -0
- package/distTs/src/command/tests/visual/snapshot/list.js +68 -0
- package/distTs/src/command/tests/visual/snapshot/open.js +26 -0
- package/distTs/src/command/tests/visual/snapshot/reviewUrl.js +48 -0
- package/distTs/src/command/tests/visual/snapshot.js +28 -0
- package/distTs/src/command/tests/visual/suite/create.js +38 -0
- package/distTs/src/command/tests/visual/suite/delete.js +29 -0
- package/distTs/src/command/tests/visual/suite/get.js +43 -0
- package/distTs/src/command/tests/visual/suite/list.js +35 -0
- package/distTs/src/command/tests/visual/suite/open.js +20 -0
- package/distTs/src/command/tests/visual/suite/update.js +47 -0
- package/distTs/src/command/tests/visual/suite.js +30 -0
- package/distTs/src/command/tunnel/http.js +1 -1
- package/distTs/src/command/tunnel/start.js +1 -1
- package/distTs/src/command/tunnel/tcp.js +1 -1
- package/distTs/src/command/tunnel/tls.js +1 -1
- package/distTs/src/command/ut/upload.js +86 -0
- package/distTs/src/command/ut.js +12 -0
- package/distTs/src/command/vt/close.js +27 -0
- package/distTs/src/command/vt/compare/validation.js +46 -0
- package/distTs/src/command/vt/compare.js +100 -0
- package/distTs/src/command/vt/exec.js +82 -0
- package/distTs/src/command/vt/installBrowser.js +20 -0
- package/distTs/src/command/vt/shared/validation.js +145 -0
- package/distTs/src/command/vt/storybook.js +138 -0
- package/distTs/src/command/vt.js +20 -0
- package/distTs/src/command/yaml/agents.js +88 -0
- package/distTs/src/command/yaml/init.js +110 -0
- package/distTs/src/main.js +190 -0
- package/distTs/src/output/pipeline.js +54 -56
- package/distTs/src/output.js +83 -26
- package/distTs/src/texts.js +450 -1
- package/distTs/src/tunnel/output/interactive/tunnel.js +28 -11
- package/distTs/src/tunnel/output/noninteractive/tunnel.js +17 -1
- package/distTs/src/tunnel/output/noninteractive/tunnelJsonl.js +8 -0
- package/distTs/src/types/options.js +2 -0
- package/distTs/src/types/scrape.js +2 -0
- package/distTs/src/types/tunnel.js +6 -1
- package/distTs/src/types/visualTests.js +2 -0
- package/distTs/src/utils.js +134 -3
- package/package.json +2 -1
|
@@ -0,0 +1,81 @@
|
|
|
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);
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|