azdo-cli 0.22.0-develop.782 → 0.22.0-develop.790
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 +7 -4
- package/dist/index.js +207 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Azure DevOps CLI focused on work item read/write workflows.
|
|
|
15
15
|
- Attach a local file to a work item, or remove a named attachment (`add-attachment`, `delete-attachment`)
|
|
16
16
|
- Read/write rich-text fields as markdown (`get-md-field`, `set-md-field`)
|
|
17
17
|
- Download images embedded in rich-text fields, optionally resized for LLM use (`get-item`/`get-md-field` `--download-images`, `--resize-images`)
|
|
18
|
-
-
|
|
18
|
+
- List pull requests with their draft state, dates, reviewers, labels and linked work item ids (`pr list --work-items`), check branch pull request status, open PRs to `develop` (optionally pre-filled from a repository-defined template), update an existing PR's title or description (`pr update`), abandon or reactivate one (`pr abandon` / `pr reactivate`), list PR comment threads for any PR (`--pr-number`), resolve/reopen threads, link/unlink work items, and add/remove required or optional reviewers — all from the CLI (`pr`)
|
|
19
19
|
- Feed long PR titles, descriptions and comment bodies from a file or a pipe instead of the shell (`--title-file`, `--description-file`, `--file`; `-` reads standard input)
|
|
20
20
|
- Persist org/project/default fields in local config (`config`)
|
|
21
21
|
- List all fields of a work item (`list-fields`)
|
|
@@ -67,9 +67,11 @@ azdo delete-attachment 12345 screenshot.png --yes # skip the prompt (scr
|
|
|
67
67
|
azdo delete-attachment 12345 screenshot.png --id <guid> # disambiguate when the name is shared
|
|
68
68
|
|
|
69
69
|
# Find a pull request — one API call, any branch
|
|
70
|
-
azdo pr list # active PRs in the repository
|
|
71
|
-
azdo pr list --branch feature/x --json # id, title, source/target, author, url, description
|
|
70
|
+
azdo pr list # active PRs in the repository ([active, draft] marks a draft)
|
|
71
|
+
azdo pr list --branch feature/x --json # id, title, source/target, author, url, description, isDraft,
|
|
72
|
+
# creationDate, closedDate, reviewers (uniqueName, vote), labels
|
|
72
73
|
azdo pr list --status all --top 50
|
|
74
|
+
azdo pr list --work-items --json # + workItemIds per PR: the whole PR ↔ work item map in one call
|
|
73
75
|
|
|
74
76
|
# PR comment threads — list, filter, target by number, resolve or reopen
|
|
75
77
|
azdo pr comments # active-branch PR; code-anchored threads show file:line
|
|
@@ -85,10 +87,11 @@ azdo pr status --pr-number 64 # same view for one PR by number, any st
|
|
|
85
87
|
azdo pr comment-resolve 17 --pr-number 64 # idempotent: exit 0 even when already resolved
|
|
86
88
|
azdo pr comment-reopen 17 --pr-number 64
|
|
87
89
|
|
|
88
|
-
# Write to a PR — new thread, in-place edit, reply
|
|
90
|
+
# Write to a PR — new thread, in-place edit, delete, reply
|
|
89
91
|
azdo pr comments add --file plan.md --pr-number 64 --dry-run # preview, writes nothing
|
|
90
92
|
azdo pr comments add --file plan.md --pr-number 64 # NEW thread on the overview
|
|
91
93
|
azdo pr comments edit 148 --file plan.md --pr-number 64 # rewrite it in place
|
|
94
|
+
azdo pr comments delete 148 --comment-id 3 --pr-number 64 # delete a comment (irreversible; no prompt)
|
|
92
95
|
azdo pr comments reply 148 "Great suggestion, I'll address it." # human-readable output
|
|
93
96
|
azdo pr comments reply 148 "Done." --pr-number 64 --json # JSON: { pullRequestId, threadId, commentId, content }
|
|
94
97
|
azdo pr comment-reply 148 "Done." --pr-number 64 # flat alias, identical behaviour
|
package/dist/index.js
CHANGED
|
@@ -3704,7 +3704,12 @@ function mapPullRequest(context, repo, pullRequest) {
|
|
|
3704
3704
|
url: pullRequest._links?.web?.href ?? buildPullRequestWebUrl(context, repo, pullRequest.pullRequestId),
|
|
3705
3705
|
description: pullRequest.description?.trim() || null,
|
|
3706
3706
|
createdByUniqueName: pullRequest.createdBy?.uniqueName ?? null,
|
|
3707
|
-
createdById: pullRequest.createdBy?.id ?? null
|
|
3707
|
+
createdById: pullRequest.createdBy?.id ?? null,
|
|
3708
|
+
isDraft: pullRequest.isDraft ?? false,
|
|
3709
|
+
creationDate: pullRequest.creationDate ?? null,
|
|
3710
|
+
closedDate: pullRequest.closedDate ?? null,
|
|
3711
|
+
reviewers: (pullRequest.reviewers ?? []).map(mapReviewer),
|
|
3712
|
+
labels: (pullRequest.labels ?? []).filter((label) => label.active !== false).map((label) => label.name)
|
|
3708
3713
|
};
|
|
3709
3714
|
}
|
|
3710
3715
|
function mapPullRequestCheckName(status2) {
|
|
@@ -3884,6 +3889,15 @@ async function listRepositoryPullRequests(context, repo, cred, opts) {
|
|
|
3884
3889
|
const data = await readJsonResponse(response);
|
|
3885
3890
|
return data.value.map((pullRequest) => mapPullRequest(context, repo, pullRequest));
|
|
3886
3891
|
}
|
|
3892
|
+
async function getPullRequestWorkItemIds(context, repo, cred, prId) {
|
|
3893
|
+
const url = new URL(
|
|
3894
|
+
`https://dev.azure.com/${encodeURIComponent(context.org)}/${encodeURIComponent(context.project)}/_apis/git/repositories/${encodeURIComponent(repo)}/pullRequests/${prId}/workitems`
|
|
3895
|
+
);
|
|
3896
|
+
url.searchParams.set("api-version", "7.1");
|
|
3897
|
+
const response = await fetchWithErrors(url.toString(), { headers: authHeaders(cred) });
|
|
3898
|
+
const data = await readJsonResponse(response);
|
|
3899
|
+
return data.value.map((ref) => Number.parseInt(ref.id, 10)).filter((id) => Number.isInteger(id) && id > 0).sort((a, b) => a - b);
|
|
3900
|
+
}
|
|
3887
3901
|
async function getPullRequestChecks(context, repo, cred, prId) {
|
|
3888
3902
|
const response = await fetchWithErrors(
|
|
3889
3903
|
buildPullRequestStatusesUrl(context, repo, prId).toString(),
|
|
@@ -4105,6 +4119,19 @@ async function updateThreadComment(context, repo, cred, prId, threadId, commentI
|
|
|
4105
4119
|
publishedAt: data.publishedDate ?? null
|
|
4106
4120
|
};
|
|
4107
4121
|
}
|
|
4122
|
+
async function deleteThreadComment(context, repo, cred, prId, threadId, commentId) {
|
|
4123
|
+
const url = new URL(
|
|
4124
|
+
`https://dev.azure.com/${encodeURIComponent(context.org)}/${encodeURIComponent(context.project)}/_apis/git/repositories/${encodeURIComponent(repo)}/pullRequests/${prId}/threads/${threadId}/comments/${commentId}`
|
|
4125
|
+
);
|
|
4126
|
+
url.searchParams.set("api-version", "7.1");
|
|
4127
|
+
const response = await fetchWithErrors(url.toString(), {
|
|
4128
|
+
method: "DELETE",
|
|
4129
|
+
headers: authHeaders(cred)
|
|
4130
|
+
});
|
|
4131
|
+
if (!response.ok) {
|
|
4132
|
+
throw httpError(response);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4108
4135
|
async function postThreadComment(context, repo, cred, prId, threadId, content) {
|
|
4109
4136
|
const response = await fetchWithErrors(buildThreadCommentUrl(context, repo, prId, threadId).toString(), {
|
|
4110
4137
|
method: "POST",
|
|
@@ -5229,6 +5256,7 @@ function createPrCommentsCommand() {
|
|
|
5229
5256
|
command.addCommand(createPrCommentsReplyCommand());
|
|
5230
5257
|
command.addCommand(createPrCommentsAddCommand());
|
|
5231
5258
|
command.addCommand(createPrCommentsEditCommand());
|
|
5259
|
+
command.addCommand(createPrCommentsDeleteCommand());
|
|
5232
5260
|
return command;
|
|
5233
5261
|
}
|
|
5234
5262
|
function parseTargetPrNumber(options) {
|
|
@@ -5547,7 +5575,26 @@ function createPrCommentAddCommand() {
|
|
|
5547
5575
|
'Post a new comment thread on the pull request overview (alias of "azdo pr comments add")'
|
|
5548
5576
|
);
|
|
5549
5577
|
}
|
|
5550
|
-
|
|
5578
|
+
function parseExplicitCommentId(options) {
|
|
5579
|
+
if (options.commentId === void 0) {
|
|
5580
|
+
return null;
|
|
5581
|
+
}
|
|
5582
|
+
const parsed = parsePositivePrNumber(options.commentId);
|
|
5583
|
+
if (parsed === null) {
|
|
5584
|
+
writeError(`Invalid --comment-id "${options.commentId}"; expected a positive integer.`);
|
|
5585
|
+
return "invalid";
|
|
5586
|
+
}
|
|
5587
|
+
return parsed;
|
|
5588
|
+
}
|
|
5589
|
+
function findCommentInThread(thread, commentId, target) {
|
|
5590
|
+
const match = thread.comments.find((comment) => comment.id === commentId);
|
|
5591
|
+
if (match === void 0) {
|
|
5592
|
+
writeError(`Comment #${commentId} not found in thread #${target.threadId} on pull request #${target.pullRequest.id}.`, EXIT_NOT_FOUND);
|
|
5593
|
+
return null;
|
|
5594
|
+
}
|
|
5595
|
+
return match;
|
|
5596
|
+
}
|
|
5597
|
+
async function fetchTargetThread(target) {
|
|
5551
5598
|
try {
|
|
5552
5599
|
return await getPullRequestThread(
|
|
5553
5600
|
target.context,
|
|
@@ -5566,12 +5613,7 @@ async function fetchThreadForEdit(target) {
|
|
|
5566
5613
|
}
|
|
5567
5614
|
function selectEditableComment(thread, explicitCommentId, target) {
|
|
5568
5615
|
if (explicitCommentId !== null) {
|
|
5569
|
-
|
|
5570
|
-
if (match === void 0) {
|
|
5571
|
-
writeError(`Comment #${explicitCommentId} not found in thread #${target.threadId} on pull request #${target.pullRequest.id}.`, EXIT_NOT_FOUND);
|
|
5572
|
-
return null;
|
|
5573
|
-
}
|
|
5574
|
-
return match;
|
|
5616
|
+
return findCommentInThread(thread, explicitCommentId, target);
|
|
5575
5617
|
}
|
|
5576
5618
|
const first = [...thread.comments].sort((a, b) => a.id - b.id)[0];
|
|
5577
5619
|
if (first === void 0) {
|
|
@@ -5606,13 +5648,9 @@ async function runCommentEdit(threadIdRaw, text, options) {
|
|
|
5606
5648
|
if (body === null) {
|
|
5607
5649
|
return;
|
|
5608
5650
|
}
|
|
5609
|
-
|
|
5610
|
-
if (
|
|
5611
|
-
|
|
5612
|
-
if (explicitCommentId === null) {
|
|
5613
|
-
writeError(`Invalid --comment-id "${options.commentId}"; expected a positive integer.`);
|
|
5614
|
-
return;
|
|
5615
|
-
}
|
|
5651
|
+
const explicitCommentId = parseExplicitCommentId(options);
|
|
5652
|
+
if (explicitCommentId === "invalid") {
|
|
5653
|
+
return;
|
|
5616
5654
|
}
|
|
5617
5655
|
const target = await resolveThreadTarget(threadIdRaw, options, {
|
|
5618
5656
|
onContextResolved: (resolved) => {
|
|
@@ -5622,7 +5660,7 @@ async function runCommentEdit(threadIdRaw, text, options) {
|
|
|
5622
5660
|
if (target === null) {
|
|
5623
5661
|
return;
|
|
5624
5662
|
}
|
|
5625
|
-
const thread = await
|
|
5663
|
+
const thread = await fetchTargetThread(target);
|
|
5626
5664
|
if (thread === null) {
|
|
5627
5665
|
return;
|
|
5628
5666
|
}
|
|
@@ -5684,44 +5722,176 @@ function createPrCommentEditCommand() {
|
|
|
5684
5722
|
'Edit an existing pull request comment in place (alias of "azdo pr comments edit")'
|
|
5685
5723
|
);
|
|
5686
5724
|
}
|
|
5725
|
+
function selectDeletableComment(thread, explicitCommentId, target) {
|
|
5726
|
+
if (explicitCommentId !== null) {
|
|
5727
|
+
return findCommentInThread(thread, explicitCommentId, target);
|
|
5728
|
+
}
|
|
5729
|
+
const comments = [...thread.comments].sort((a, b) => a.id - b.id);
|
|
5730
|
+
if (comments.length === 1) {
|
|
5731
|
+
return comments[0];
|
|
5732
|
+
}
|
|
5733
|
+
if (comments.length === 0) {
|
|
5734
|
+
writeError(`Thread #${target.threadId} on pull request #${target.pullRequest.id} has no comment to delete.`, EXIT_NOT_FOUND);
|
|
5735
|
+
return null;
|
|
5736
|
+
}
|
|
5737
|
+
const candidates = comments.map((comment) => `#${comment.id} (${comment.author ?? "Unknown"})`).join(", ");
|
|
5738
|
+
writeError(
|
|
5739
|
+
`Thread #${target.threadId} on pull request #${target.pullRequest.id} holds ${comments.length} comments; pass --comment-id to choose one: ${candidates}.`
|
|
5740
|
+
);
|
|
5741
|
+
return null;
|
|
5742
|
+
}
|
|
5743
|
+
function reportDeleteResult(result, json, comment) {
|
|
5744
|
+
if (json) {
|
|
5745
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
5746
|
+
`);
|
|
5747
|
+
return;
|
|
5748
|
+
}
|
|
5749
|
+
if (result.dryRun) {
|
|
5750
|
+
process.stdout.write(
|
|
5751
|
+
`Dry run: would delete comment #${result.commentId} by ${comment.author ?? "Unknown"} (${comment.content.length} chars) from thread #${result.threadId} on pull request #${result.pullRequestId}.
|
|
5752
|
+
`
|
|
5753
|
+
);
|
|
5754
|
+
return;
|
|
5755
|
+
}
|
|
5756
|
+
process.stdout.write(
|
|
5757
|
+
`Comment #${result.commentId} deleted from thread #${result.threadId} on pull request #${result.pullRequestId}.
|
|
5758
|
+
`
|
|
5759
|
+
);
|
|
5760
|
+
}
|
|
5761
|
+
async function runCommentDelete(threadIdRaw, options) {
|
|
5762
|
+
let context;
|
|
5763
|
+
try {
|
|
5764
|
+
const explicitCommentId = parseExplicitCommentId(options);
|
|
5765
|
+
if (explicitCommentId === "invalid") {
|
|
5766
|
+
return;
|
|
5767
|
+
}
|
|
5768
|
+
const target = await resolveThreadTarget(threadIdRaw, options, {
|
|
5769
|
+
onContextResolved: (resolved) => {
|
|
5770
|
+
context = resolved;
|
|
5771
|
+
}
|
|
5772
|
+
});
|
|
5773
|
+
if (target === null) {
|
|
5774
|
+
return;
|
|
5775
|
+
}
|
|
5776
|
+
const thread = await fetchTargetThread(target);
|
|
5777
|
+
if (thread === null) {
|
|
5778
|
+
return;
|
|
5779
|
+
}
|
|
5780
|
+
const comment = selectDeletableComment(thread, explicitCommentId, target);
|
|
5781
|
+
if (comment === null) {
|
|
5782
|
+
return;
|
|
5783
|
+
}
|
|
5784
|
+
const dryRun = options.dryRun === true;
|
|
5785
|
+
if (!dryRun) {
|
|
5786
|
+
await deleteThreadComment(
|
|
5787
|
+
target.context,
|
|
5788
|
+
target.repo,
|
|
5789
|
+
target.pat,
|
|
5790
|
+
target.pullRequest.id,
|
|
5791
|
+
target.threadId,
|
|
5792
|
+
comment.id
|
|
5793
|
+
);
|
|
5794
|
+
}
|
|
5795
|
+
reportDeleteResult(
|
|
5796
|
+
{
|
|
5797
|
+
pullRequestId: target.pullRequest.id,
|
|
5798
|
+
threadId: target.threadId,
|
|
5799
|
+
commentId: comment.id,
|
|
5800
|
+
deleted: !dryRun,
|
|
5801
|
+
dryRun
|
|
5802
|
+
},
|
|
5803
|
+
options.json === true,
|
|
5804
|
+
comment
|
|
5805
|
+
);
|
|
5806
|
+
} catch (err) {
|
|
5807
|
+
handlePrCommandError(err, context, "write");
|
|
5808
|
+
}
|
|
5809
|
+
}
|
|
5810
|
+
function buildCommentDeleteCommand(name, description) {
|
|
5811
|
+
const command = new Command12(name);
|
|
5812
|
+
withCommonPrOptions(configureUnwrappedHelp(command)).description(description).argument("<threadId>", "numeric id of the thread holding the comment").option("--comment-id <N>", "numeric id of the comment to delete; may be omitted only when the thread holds a single comment").option("--dry-run", "resolve the target comment and print what would be deleted, without deleting anything").option("--pr-number <N>", PR_NUMBER_HELP).option("--json", "output JSON").action(async (threadIdRaw, _options, command2) => {
|
|
5813
|
+
await runCommentDelete(threadIdRaw, mergedPrOptions(command2));
|
|
5814
|
+
});
|
|
5815
|
+
return command;
|
|
5816
|
+
}
|
|
5817
|
+
function createPrCommentsDeleteCommand() {
|
|
5818
|
+
return buildCommentDeleteCommand("delete", "Delete a pull request comment (no confirmation prompt; irreversible)");
|
|
5819
|
+
}
|
|
5820
|
+
function createPrCommentDeleteCommand() {
|
|
5821
|
+
return buildCommentDeleteCommand(
|
|
5822
|
+
"comment-delete",
|
|
5823
|
+
'Delete a pull request comment (alias of "azdo pr comments delete"; no confirmation prompt; irreversible)'
|
|
5824
|
+
);
|
|
5825
|
+
}
|
|
5687
5826
|
var LIST_STATUS_VALUES = ["active", "completed", "abandoned", "all"];
|
|
5688
5827
|
var DEFAULT_LIST_TOP = 25;
|
|
5828
|
+
var WORK_ITEM_LOOKUP_CONCURRENCY = 5;
|
|
5689
5829
|
function formatPullRequestListEntry(pullRequest) {
|
|
5690
|
-
|
|
5691
|
-
|
|
5830
|
+
const state = pullRequest.isDraft ? `${pullRequest.status}, draft` : pullRequest.status;
|
|
5831
|
+
const lines = [
|
|
5832
|
+
`#${pullRequest.id} [${state}] ${pullRequest.title}`,
|
|
5692
5833
|
` ${formatBranchName(pullRequest.sourceRefName)} -> ${formatBranchName(pullRequest.targetRefName)}`,
|
|
5693
|
-
` Author: ${pullRequest.createdBy ?? "Unknown"}
|
|
5694
|
-
|
|
5695
|
-
|
|
5834
|
+
` Author: ${pullRequest.createdBy ?? "Unknown"}`
|
|
5835
|
+
];
|
|
5836
|
+
if ("workItemIds" in pullRequest) {
|
|
5837
|
+
const ids = pullRequest.workItemIds.map((id) => `#${id}`).join(", ");
|
|
5838
|
+
lines.push(` Work items: ${ids || "none"}`);
|
|
5839
|
+
}
|
|
5840
|
+
lines.push(` ${pullRequest.url ?? "\u2014"}`);
|
|
5841
|
+
return lines.join("\n");
|
|
5842
|
+
}
|
|
5843
|
+
function parseListOptions(options) {
|
|
5844
|
+
const status2 = options.status ?? "active";
|
|
5845
|
+
if (!LIST_STATUS_VALUES.includes(status2)) {
|
|
5846
|
+
writeError(`Invalid --status "${status2}"; expected one of ${LIST_STATUS_VALUES.join(", ")}.`);
|
|
5847
|
+
return null;
|
|
5848
|
+
}
|
|
5849
|
+
let top = DEFAULT_LIST_TOP;
|
|
5850
|
+
if (options.top !== void 0) {
|
|
5851
|
+
const parsed = parsePositivePrNumber(options.top);
|
|
5852
|
+
if (parsed === null) {
|
|
5853
|
+
writeError(`Invalid --top "${options.top}"; expected a positive integer.`);
|
|
5854
|
+
return null;
|
|
5855
|
+
}
|
|
5856
|
+
top = parsed;
|
|
5857
|
+
}
|
|
5858
|
+
const branch = options.branch?.trim().replace(/^refs\/heads\//, "") || null;
|
|
5859
|
+
return { status: status2, top, branch };
|
|
5860
|
+
}
|
|
5861
|
+
async function attachWorkItemIds(context, repo, cred, pullRequests) {
|
|
5862
|
+
const result = new Array(pullRequests.length);
|
|
5863
|
+
let next = 0;
|
|
5864
|
+
const worker = async () => {
|
|
5865
|
+
while (next < pullRequests.length) {
|
|
5866
|
+
const index = next;
|
|
5867
|
+
next += 1;
|
|
5868
|
+
const pullRequest = pullRequests[index];
|
|
5869
|
+
const workItemIds = await getPullRequestWorkItemIds(context, repo, cred, pullRequest.id);
|
|
5870
|
+
result[index] = { ...pullRequest, workItemIds };
|
|
5871
|
+
}
|
|
5872
|
+
};
|
|
5873
|
+
await Promise.all(Array.from({ length: Math.min(WORK_ITEM_LOOKUP_CONCURRENCY, pullRequests.length) }, worker));
|
|
5874
|
+
return result;
|
|
5696
5875
|
}
|
|
5697
5876
|
function createPrListCommand() {
|
|
5698
5877
|
const command = new Command12("list");
|
|
5699
|
-
withCommonPrOptions(configureUnwrappedHelp(command)).description("List pull requests in the repository, optionally filtered by source branch").option("--branch <name>", "only pull requests whose source branch is this one (with or without the refs/heads/ prefix)").option("--status <status>", `pull request status filter (${LIST_STATUS_VALUES.join(" | ")})`, "active").option("--top <N>", `maximum number of pull requests to return (default ${DEFAULT_LIST_TOP})`).option("--json", "output JSON").action(async (options) => {
|
|
5878
|
+
withCommonPrOptions(configureUnwrappedHelp(command)).description("List pull requests in the repository, optionally filtered by source branch").option("--branch <name>", "only pull requests whose source branch is this one (with or without the refs/heads/ prefix)").option("--status <status>", `pull request status filter (${LIST_STATUS_VALUES.join(" | ")})`, "active").option("--top <N>", `maximum number of pull requests to return (default ${DEFAULT_LIST_TOP})`).option("--work-items", "also return the ids of each pull request's linked work items (one extra API call per pull request)").option("--json", "output JSON").action(async (options) => {
|
|
5700
5879
|
validateOrgProjectPair(options);
|
|
5701
|
-
const
|
|
5702
|
-
if (
|
|
5703
|
-
writeError(`Invalid --status "${status2}"; expected one of ${LIST_STATUS_VALUES.join(", ")}.`);
|
|
5880
|
+
const parsed = parseListOptions(options);
|
|
5881
|
+
if (parsed === null) {
|
|
5704
5882
|
return;
|
|
5705
5883
|
}
|
|
5706
|
-
|
|
5707
|
-
if (options.top !== void 0) {
|
|
5708
|
-
const parsed = parsePositivePrNumber(options.top);
|
|
5709
|
-
if (parsed === null) {
|
|
5710
|
-
writeError(`Invalid --top "${options.top}"; expected a positive integer.`);
|
|
5711
|
-
return;
|
|
5712
|
-
}
|
|
5713
|
-
top = parsed;
|
|
5714
|
-
}
|
|
5715
|
-
const branch = options.branch?.trim().replace(/^refs\/heads\//, "") || null;
|
|
5884
|
+
const { status: status2, top, branch } = parsed;
|
|
5716
5885
|
let context;
|
|
5717
5886
|
try {
|
|
5718
5887
|
const resolved = await resolvePrCommandContext(options, { requireBranch: false });
|
|
5719
5888
|
context = resolved.context;
|
|
5720
|
-
const
|
|
5889
|
+
const listed = await listRepositoryPullRequests(resolved.context, resolved.repo, resolved.pat, {
|
|
5721
5890
|
sourceBranch: branch ?? void 0,
|
|
5722
5891
|
status: status2,
|
|
5723
5892
|
top
|
|
5724
5893
|
});
|
|
5894
|
+
const pullRequests = options.workItems ? await attachWorkItemIds(resolved.context, resolved.repo, resolved.pat, listed) : listed;
|
|
5725
5895
|
const result = {
|
|
5726
5896
|
repository: resolved.repo,
|
|
5727
5897
|
branch,
|
|
@@ -5949,6 +6119,7 @@ function createPrCommand() {
|
|
|
5949
6119
|
command.addCommand(createPrWorkItemsCommand());
|
|
5950
6120
|
command.addCommand(createPrReviewersCommand());
|
|
5951
6121
|
command.addCommand(createPrCommentEditCommand());
|
|
6122
|
+
command.addCommand(createPrCommentDeleteCommand());
|
|
5952
6123
|
return command;
|
|
5953
6124
|
}
|
|
5954
6125
|
|