Skip to content

Commit c7d8cd3

Browse files
committed
chore: review fixes
1 parent 93bd6d1 commit c7d8cd3

8 files changed

Lines changed: 19 additions & 18 deletions

File tree

.git2gus/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"productTag": "a1aAH00000004MRYAY",
2+
"productTag": "a1aEE000001E5C9YAK",
33
"defaultBuild": "DOCe-Git2Gus",
44
"issueTypeLabels": {
55
"feature": "USER STORY",
66
"regression": "BUG P1",
77
"bug": "BUG P3"
88
},
99
"statusWhenClosed": "FIXED"
10-
}
10+
}

CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Techical writers will be added as reviewers on markdown changes.
2+
*.md @salesforcecli/cli-docs
3+
4+
# Comment line immediately above ownership line is reserved for related other information. Please be careful while editing.
5+
#ECCN:Open Source

messages/commonErrors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Connection is required
4444

4545
# error.query-string-required
4646

47-
Query string is required and must be a non-empty string
47+
The query string is empty or missing. Specify a query string and try again.
4848

4949
# error.DevopsCenterNotEnabled
5050

51-
DevOps Center is not enabled in this org. Enable DevOps Center in Setup before using this command.
51+
We couldn't run this command because DevOps Center isn't enabled in this org. Enable DevOps Center in Setup, and try again.

messages/devops.work-item.create.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Description of the new work item; if not specified, the description is blank.
2222

2323
- Create a work item for the project with the specified ID and give the work item the specified subject (title); use the DevOps Center org with alias "my-devops-org":
2424

25-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 0Hn000000000001 --subject "Fix login bug"
25+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --subject "Fix login bug"
2626

2727
- Create a work item with a subject and description:
2828

29-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 0Hn000000000001 --subject "Add dark mode" --description "Implement dark mode toggle in settings page"
29+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --subject "Add dark mode" --description "Implement dark mode toggle in settings page"

messages/devops.work-item.list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ID of the DevOps Center project to list work items for.
1414

1515
- List work items for a specific project in the DevOps org with alias "my-devops-org":
1616

17-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 0Hn000000000001
17+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001
1818

1919
- List work items using JSON output:
2020

21-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 0Hn000000000001 --json
21+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --json

src/commands/devops/work-item/create.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export default class DevopsWorkItemCreate extends SfCommand<CreateWorkItemResult
6060
}
6161

6262
if (result.success) {
63-
this.log(`Successfully created work item: ${result.workItemName ?? result.workItemId}`);
64-
this.log(` ID: ${result.workItemId}`);
65-
this.log(` Subject: ${result.subject}`);
63+
this.log(`Successfully created work item: ${result.workItemName ?? result.workItemId ?? ''}`);
64+
this.log(` ID: ${result.workItemId ?? ''}`);
65+
this.log(` Subject: ${result.subject ?? ''}`);
6666
} else {
67-
this.error(`Failed to create work item: ${result.error}`);
67+
this.error(`Failed to create work item: ${result.error ?? ''}`);
6868
}
6969

7070
return result;

src/utils/createWorkItem.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
import { Connection } from '@salesforce/core';
99

10-
const API_VERSION = 'v65.0';
11-
1210
export type CreateWorkItemParams = {
1311
connection: Connection;
1412
projectId: string;
@@ -31,7 +29,7 @@ export type CreateWorkItemResult = {
3129
export async function createWorkItem(params: CreateWorkItemParams): Promise<CreateWorkItemResult> {
3230
const { connection, projectId, subject, description } = params;
3331

34-
const path = `/services/data/${API_VERSION}/connect/devops/projects/${projectId}/workitem`;
32+
const path = `/services/data/v${connection.getApiVersion()}/connect/devops/projects/${projectId}/workitem`;
3533
const body = JSON.stringify({ subject, description: description ?? '' });
3634

3735
try {

src/utils/workItems.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import {
1616
} from './pipelineUtils';
1717
import { WorkItem, ProjectStagesContext, VcsType, WorkItemQueryRecord } from './types';
1818

19-
const API_VERSION = 'v65.0';
20-
2119
function normalizeProvider(provider: unknown): string | undefined {
2220
if (!provider) return undefined;
2321
const normalized = String(provider).toLowerCase();
@@ -57,7 +55,7 @@ function extractOwnerFromVcsPayload(payload: unknown): string | undefined {
5755
}
5856

5957
async function fetchOwnerByVcsType(connection: Connection, vcsType: VcsType): Promise<string | undefined> {
60-
const path = `/services/data/${API_VERSION}/connect/devops/vcs/${vcsType}`;
58+
const path = `/services/data/v${connection.getApiVersion()}/connect/devops/vcs/${vcsType}`;
6159
const response: unknown = await connection.request({ method: 'GET', url: path });
6260
return extractOwnerFromVcsPayload(response);
6361
}

0 commit comments

Comments
 (0)