Skip to content

Commit 9518392

Browse files
authored
Merge pull request #514 from salesforcecli/ashreya/command-enhancements
@W-22503184 - Add and restructure devops commands
2 parents 5cccde5 + cd3667a commit 9518392

34 files changed

Lines changed: 843 additions & 575 deletions

command-snapshot.json

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,15 @@
77
"flags": ["api-version", "flags-dir", "json", "pipeline-id", "target-org"],
88
"plugin": "@salesforce/plugin-devops-center"
99
},
10-
{
11-
"alias": [],
12-
"command": "devops:pipeline:attach-project",
13-
"flagAliases": [],
14-
"flagChars": ["o"],
15-
"flags": ["api-version", "flags-dir", "json", "pipeline-id", "project-id", "target-org"],
16-
"plugin": "@salesforce/plugin-devops-center"
17-
},
1810
{
1911
"alias": [],
2012
"command": "devops:pipeline:create",
2113
"flagAliases": [],
2214
"flagChars": ["d", "n", "o", "r"],
2315
"flags": [
2416
"api-version",
25-
"bitbucket-project",
17+
"bitbucket-project-key",
18+
"bitbucket-workspace",
2619
"create-repo",
2720
"description",
2821
"flags-dir",
@@ -35,6 +28,14 @@
3528
],
3629
"plugin": "@salesforce/plugin-devops-center"
3730
},
31+
{
32+
"alias": [],
33+
"command": "devops:pipeline:project:add",
34+
"flagAliases": [],
35+
"flagChars": ["o"],
36+
"flags": ["api-version", "flags-dir", "json", "pipeline-id", "project-id", "target-org"],
37+
"plugin": "@salesforce/plugin-devops-center"
38+
},
3839
{
3940
"alias": [],
4041
"command": "devops:pipeline:stage:add",
@@ -64,12 +65,12 @@
6465
"command": "devops:pull-request:create",
6566
"flagAliases": [],
6667
"flagChars": ["n", "o", "w"],
67-
"flags": ["api-version", "body", "flags-dir", "json", "target-org", "title", "work-item-id", "work-item-name"],
68+
"flags": ["api-version", "flags-dir", "json", "target-org", "work-item-id", "work-item-name"],
6869
"plugin": "@salesforce/plugin-devops-center"
6970
},
7071
{
7172
"alias": [],
72-
"command": "devops:stage:add-branch",
73+
"command": "devops:stage:branch:add",
7374
"flagAliases": [],
7475
"flagChars": ["b", "o"],
7576
"flags": [
@@ -86,7 +87,7 @@
8687
},
8788
{
8889
"alias": [],
89-
"command": "devops:stage:add-environment",
90+
"command": "devops:stage:environment:add",
9091
"flagAliases": [],
9192
"flagChars": ["e", "o"],
9293
"flags": [
@@ -120,10 +121,20 @@
120121
},
121122
{
122123
"alias": [],
123-
"command": "devops:work-item:status:update",
124+
"command": "devops:work-item:update",
124125
"flagAliases": [],
125126
"flagChars": ["n", "o", "w"],
126-
"flags": ["api-version", "flags-dir", "json", "status", "target-org", "work-item-id", "work-item-name"],
127+
"flags": [
128+
"api-version",
129+
"description",
130+
"flags-dir",
131+
"json",
132+
"status",
133+
"subject",
134+
"target-org",
135+
"work-item-id",
136+
"work-item-name"
137+
],
127138
"plugin": "@salesforce/plugin-devops-center"
128139
},
129140
{

messages/devops.pipeline.create.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ Create a repository if it doesn't exist.
2828

2929
# flags.repo-owner.summary
3030

31-
Owner (organization or user) of the repository. Required when creating a repository using '--create-repo'.
31+
Owner (organization or user) of the GitHub repository. Required when creating a GitHub repository using '--create-repo'.
3232

33-
# flags.bitbucket-project.summary
33+
# flags.bitbucket-workspace.summary
3434

35-
Bitbucket project key for the repository. Used when creating a Bitbucket repository with '--create-repo'.
35+
Bitbucket workspace that will own the repository. Required when creating a Bitbucket repository using '--create-repo'.
36+
37+
# flags.bitbucket-project-key.summary
38+
39+
Bitbucket project key to associate with the repository. Optional when creating a Bitbucket repository using '--create-repo'.
3640

3741
# flags.description.summary
3842

@@ -48,14 +52,26 @@ Description of the pipeline.
4852

4953
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type github --repo-owner myorg --create-repo
5054

51-
- Create a pipeline with a description and associate it with a Bitbucket repository.
55+
- Create a pipeline and create a new Bitbucket repository.
56+
57+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type bitbucket --bitbucket-workspace myworkspace --bitbucket-project-key PROJ --create-repo
5258

53-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://bitbucket.org/myorg/myrepo --description "Main CI/CD pipeline for production releases"
59+
- Create a pipeline with a description and associate it with an existing Bitbucket repository.
60+
61+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://bitbucket.org/myworkspace/myrepo --description "Main CI/CD pipeline for production releases"
5462

5563
# error.RepoTypeRequired
5664

5765
The --repo-type flag is required when using --create-repo. Specify --repo-type github or --repo-type bitbucket.
5866

67+
# error.RepoOwnerNotFound
68+
69+
The repository "%s" could not be initialized because the --repo-owner does not exist or is not accessible on GitHub. Verify the --repo-owner value is a valid GitHub organization or user.
70+
71+
# error.RepoNameAlreadyExists
72+
73+
A repository named "%s" already exists on this account. Choose a different name or use the existing repository URL with --repo instead of --create-repo.
74+
5975
# error.RepoCreationFailed
6076

6177
Failed to create repository "%s". Verify the --repo-owner has permission to create repositories and the repository name is available. Details: %s
@@ -70,7 +86,11 @@ Failed to validate repository "%s". When using an existing repository, provide t
7086

7187
# error.RepoOwnerRequired
7288

73-
The --repo-owner flag is required when using --create-repo. Specify the GitHub or Bitbucket organization or user that will own the repository.
89+
The --repo-owner flag is required when creating a GitHub repository with --create-repo. Specify the GitHub organization or user that will own the repository.
90+
91+
# error.BitbucketWorkspaceRequired
92+
93+
The --bitbucket-workspace flag is required when creating a Bitbucket repository with --create-repo. Specify the Bitbucket workspace that will own the repository.
7494

7595
# error.VcsCredentialsMissing
7696

File renamed without changes.

messages/devops.pull-request.create.md

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Create a pull request for a work item branch.
44

55
# description
66

7-
The pull request title defaults to the work item subject. The work item must have an associated branch and repository. Requires VCS authentication: set GITHUB_TOKEN (or use `gh auth login`) for GitHub, or set BITBUCKET_TOKEN for Bitbucket.
7+
Creates a pull request via the Salesforce DevOps Center API, using the VCS credentials stored in the org. Works with GitHub and Bitbucket without requiring local VCS authentication.
88

99
# flags.work-item-name.summary
1010

@@ -14,44 +14,20 @@ Name of the work item, such as WI-000001.
1414

1515
ID of the work item.
1616

17-
# flags.title.summary
18-
19-
Title of the pull request.
20-
21-
# flags.body.summary
17+
# flags.target-org.summary
2218

23-
Description of the pull request.
19+
Username or alias of the DevOps Center org.
2420

2521
# examples
2622

27-
- Create a pull request for a work item using the default title.
23+
- Create a pull request for a work item.
2824

2925
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-name WI-000001
3026

31-
- Create a pull request with a custom title and description.
27+
- Create a pull request using the work item ID.
3228

33-
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-id 0Wx000000000001 --title "Fix: Login timeout" --body "Resolves the 30s timeout on the login page"
29+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-id 0Wx000000000001
3430

3531
# error.NoBranch
3632

3733
Work item %s doesn't have an associated branch. Mark the work item as In Progress to create a branch, then try again.
38-
39-
# error.NoRepo
40-
41-
Work item %s doesn't have an associated repository. Verify the project is connected to a source control repository and try again.
42-
43-
# error.NoTargetBranch
44-
45-
Unable to determine the target branch for work item %s. Verify the pipeline stages are configured correctly.
46-
47-
# error.NoProvider
48-
49-
Unable to determine the VCS provider for work item %s. Verify the project is connected to a supported source control provider (GitHub or Bitbucket).
50-
51-
# flags.target-org.summary
52-
53-
Username or alias of the DevOps Center org.
54-
55-
# error.NoToken
56-
57-
No authentication token found for %s. For GitHub, set the GITHUB_TOKEN environment variable or run "gh auth login". For Bitbucket, set the BITBUCKET_TOKEN environment variable.
File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Waiting for authentication to complete...
4848

4949
Successfully added environment to the stage.
5050

51+
# error.PipelineAlreadyActive
52+
53+
Pipeline %s is already active. Environments can only be added to inactive pipelines.
54+
5155
# error.StageNotFound
5256

5357
Pipeline stage "%s" doesn't exist in pipeline "%s". Check the stage ID and try again.

messages/devops.work-item.status.update.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# summary
2+
3+
Update a work item in DevOps Center.
4+
5+
# description
6+
7+
Update the subject, description, or status of a work item. At least one of --subject, --description, or --status must be provided.
8+
9+
# flags.work-item-name.summary
10+
11+
Name of the work item, such as WI-000001.
12+
13+
# flags.work-item-id.summary
14+
15+
ID of the work item.
16+
17+
# flags.subject.summary
18+
19+
New subject for the work item.
20+
21+
# flags.description.summary
22+
23+
New description for the work item.
24+
25+
# flags.status.summary
26+
27+
New status for the work item. Allowed values: "In Progress", "Ready to Promote".
28+
29+
# examples
30+
31+
- Update the subject of a work item by name:
32+
33+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-name WI-000001 --subject "Fix login bug"
34+
35+
- Update the status of a work item by ID:
36+
37+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-id 0Wx000000000001 --status "In Progress"
38+
39+
- Update multiple fields at once:
40+
41+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-name WI-000001 --subject "Fix login bug" --description "Users can't log in on mobile" --status "In Progress"
42+
43+
# error.NoFieldsProvided
44+
45+
Provide at least one of --subject, --description, or --status.
File renamed without changes.

schemas/devops-pull__request-create.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
"workItemName": {
1212
"type": "string"
1313
},
14-
"title": {
15-
"type": "string"
16-
},
1714
"url": {
1815
"type": "string"
1916
},

0 commit comments

Comments
 (0)