@copado/agentia-cli 1.3.0 → 1.5.0-rc.0
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/CHANGELOG.md +35 -0
- package/README.md +437 -428
- package/dist/commands/cicd/cloud/commit.js +4 -3
- package/dist/commands/cicd/cloud/promote.js +40 -18
- package/dist/commands/cicd/credential/list.js +2 -1
- package/dist/commands/cicd/environment/list.js +2 -1
- package/dist/commands/cicd/extension-configuration/list.js +2 -1
- package/dist/commands/cicd/function/list.js +10 -13
- package/dist/commands/cicd/job/list.js +2 -1
- package/dist/commands/cicd/job/result-file/get.js +11 -6
- package/dist/commands/cicd/pipeline/automation/list.js +2 -1
- package/dist/commands/cicd/pipeline/list.js +2 -1
- package/dist/commands/cicd/pipeline/quality-gate/list.js +2 -1
- package/dist/commands/cicd/project/list.js +2 -1
- package/dist/commands/cicd/promotion/list.js +2 -1
- package/dist/commands/cicd/promotion/status.js +29 -0
- package/dist/commands/cicd/repository/list.js +5 -8
- package/dist/commands/cicd/stage/list.js +2 -1
- package/dist/commands/cicd/template/list.js +9 -12
- package/dist/commands/cicd/work/delete.js +2 -2
- package/dist/commands/cicd/work/environment-sync.js +138 -62
- package/dist/commands/cicd/work/get.js +2 -2
- package/dist/commands/cicd/work/list.js +2 -1
- package/dist/commands/cicd/work/test/apex.js +18 -33
- package/dist/commands/cicd/work/test.js +114 -9
- package/dist/commands/cicd/work/update.js +2 -2
- package/dist/lib/defaults-store.js +3 -1
- package/dist/lib/function-list.js +3 -0
- package/dist/lib/git-worktree.js +4 -1
- package/dist/lib/job-get.js +2 -1
- package/dist/lib/job-types.js +2 -1
- package/dist/lib/list-pagination.js +6 -1
- package/dist/lib/local-quality-gates.js +4 -1
- package/dist/lib/mcp/result.js +18 -2
- package/dist/lib/mcp/testing-browser-tools.js +1 -16
- package/dist/lib/mcp/tool-annotations.js +0 -1
- package/dist/lib/mcp/tools.js +30 -25
- package/dist/lib/mcp/work-tools.js +100 -47
- package/dist/lib/promotion-run.js +3 -1
- package/dist/lib/promotion-status.js +12 -0
- package/dist/lib/quality-gates.js +13 -0
- package/dist/lib/repository-list.js +3 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/stock-quality-gates.js +2 -1
- package/dist/lib/support-ai.js +1 -2
- package/dist/lib/template-list.js +3 -0
- package/dist/lib/testing-browser-operations.js +1 -2
- package/dist/lib/testing-browser-session.js +1 -2
- package/dist/lib/work-apex-test-failures.js +2 -1
- package/dist/lib/work-environment-sync-ready.js +7 -1
- package/dist/lib/work-environment-sync.js +8 -1
- package/dist/lib/work-local-run-tests.js +2 -1
- package/dist/lib/work-promote-deploy.js +3 -1
- package/dist/lib/work-types.js +3 -1
- package/oclif.manifest.json +151 -93
- package/package.json +1 -1
- package/templates/skills/agentia-ai/references/ai-agents.md +1 -1
- package/templates/skills/agentia-cicd/SKILL.md +4 -3
- package/templates/skills/agentia-cicd/references/jobs.md +3 -2
- package/templates/skills/agentia-cicd/references/promotions.md +16 -4
- package/templates/skills/agentia-cicd/references/work.md +25 -11
- package/templates/skills/agentia-testing/references/browser-testing.md +0 -1
- package/templates/skills/agentia-testing/references/tests.md +1 -1
- package/vendor/java/var-replace-command.jar +0 -0
- package/dist/commands/testing/browser/reports.js +0 -33
|
@@ -107,6 +107,7 @@ export default class CloudCommit extends CicdCommand {
|
|
|
107
107
|
static description = [
|
|
108
108
|
'Create a Copado cloud metadata commit for a user story.',
|
|
109
109
|
'Preflights the story, submits POST /release/commit, and polls the job monitor by default.',
|
|
110
|
+
'Simple --metadata-* flags commit exactly one component. Use --file or --stdin with a changes[] array for multiple components.',
|
|
110
111
|
'For local Git work, use git add/commit then `cicd work publish`. Permission and full-metadata selections belong on `cicd work publish`.',
|
|
111
112
|
'',
|
|
112
113
|
'NOTE: Do not use this command along with local development (git operations, cicd work push/submit).',
|
|
@@ -114,7 +115,7 @@ export default class CloudCommit extends CicdCommand {
|
|
|
114
115
|
static examples = [
|
|
115
116
|
'<%= config.bin %> <%= command.id %> --message "Commit AccountService" --metadata-name AccountService --metadata-type ApexClass --metadata-category SFDX --action Add',
|
|
116
117
|
'<%= config.bin %> <%= command.id %> a07XXXXXXXXXXXXXXX --message "Update Aura files" --metadata-name accountEditor --metadata-type AuraDefinitionBundle --metadata-category SFDX --action SelectiveCommit --selection accountEditor/accountEditor.cmp --selection accountEditor/accountEditorController.js',
|
|
117
|
-
'<%= config.bin %> <%= command.id %> --file commit-request.json # {"message":"Commit
|
|
118
|
+
'<%= config.bin %> <%= command.id %> --file commit-request.json # {"message":"Commit metadata","changes":[{"a":"Add","c":"SFDX","n":"AccountService","t":"ApexClass"},{"a":"Add","c":"SFDX","n":"AccountTrigger","t":"ApexTrigger"}]}',
|
|
118
119
|
'cat commit-request.json | <%= config.bin %> <%= command.id %> --stdin --json',
|
|
119
120
|
];
|
|
120
121
|
static flags = {
|
|
@@ -140,7 +141,7 @@ export default class CloudCommit extends CicdCommand {
|
|
|
140
141
|
}),
|
|
141
142
|
file: Flags.string({
|
|
142
143
|
char: 'f',
|
|
143
|
-
description: 'Path to a JSON commit request
|
|
144
|
+
description: 'Path to a JSON commit request with message and changes[] (one object per metadata component).',
|
|
144
145
|
}),
|
|
145
146
|
message: Flags.string({
|
|
146
147
|
char: 'm',
|
|
@@ -171,7 +172,7 @@ export default class CloudCommit extends CicdCommand {
|
|
|
171
172
|
}),
|
|
172
173
|
stdin: Flags.boolean({
|
|
173
174
|
default: false,
|
|
174
|
-
description: 'Read a JSON commit request
|
|
175
|
+
description: 'Read a JSON commit request with message and changes[] from stdin.',
|
|
175
176
|
}),
|
|
176
177
|
wait: Flags.boolean({
|
|
177
178
|
allowNo: true,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { confirm } from '@inquirer/prompts';
|
|
2
2
|
import { Args, Flags } from '@oclif/core';
|
|
3
3
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
4
|
-
import { formatPromotionRunResult, isPromotionRunExecutionError,
|
|
4
|
+
import { formatPromotionRunResult, isPromotionRunExecutionError, parseIgnoredMetadataJson, performPromotionRun, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, promotionRunErrorJson, PromotionRunValidationError, resolveOrCreatePromotionForWorkItem, } from '../../../lib/promotion-run.js';
|
|
5
5
|
import { resolveWorkItemId, WorkActiveResolutionError } from '../../../lib/work-active.js';
|
|
6
|
-
import {
|
|
6
|
+
import { WorkPromoteValidationError } from '../../../lib/work-promote.js';
|
|
7
7
|
export default class CloudPromote extends CicdCommand {
|
|
8
|
+
promoteErrorContext;
|
|
8
9
|
static args = {
|
|
9
10
|
id: Args.string({
|
|
10
11
|
description: 'User Story ID (defaults to the active work item from `work set`)',
|
|
@@ -39,7 +40,7 @@ export default class CloudPromote extends CicdCommand {
|
|
|
39
40
|
description: 'JSON array to persist through ignored-metadata before starting the promotion.',
|
|
40
41
|
}),
|
|
41
42
|
'promotion-id': Flags.string({
|
|
42
|
-
description: 'Explicit 18-character Promotion ID when the User Story belongs to multiple promotions.',
|
|
43
|
+
description: 'Explicit 18-character Promotion ID when the User Story belongs to multiple promotions. Used as is; never creates a promotion.',
|
|
43
44
|
}),
|
|
44
45
|
'recreate-promotion-branch': Flags.boolean({
|
|
45
46
|
description: 'Recreate the promotion branch before execution. Requires confirmation or --yes.',
|
|
@@ -81,20 +82,17 @@ export default class CloudPromote extends CicdCommand {
|
|
|
81
82
|
}
|
|
82
83
|
throw error;
|
|
83
84
|
}
|
|
85
|
+
let createdPromotion;
|
|
86
|
+
this.promoteErrorContext = { workItemId };
|
|
84
87
|
try {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const created = await createForwardPromotionForUserStory(workItemId);
|
|
94
|
-
this.display(() => this.log(`Created promotion ${created.name ?? created.id} for ${workItemId}.`));
|
|
95
|
-
return created.id;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
88
|
+
const resolved = await this.withSpinner('Resolving User Story promotion', () => resolveOrCreatePromotionForWorkItem(workItemId, promoteFlags['promotion-id']));
|
|
89
|
+
const promotionId = resolved.promotionId;
|
|
90
|
+
createdPromotion = resolved.createdPromotion;
|
|
91
|
+
if (createdPromotion !== undefined) {
|
|
92
|
+
const promotionCreated = createdPromotion;
|
|
93
|
+
this.promoteErrorContext = { createdPromotion: promotionCreated, workItemId };
|
|
94
|
+
this.display(() => this.log(`Created promotion ${promotionCreated.name ?? promotionCreated.id} for ${workItemId}.`));
|
|
95
|
+
}
|
|
98
96
|
if (promoteFlags['recreate-promotion-branch'] === true && !promoteFlags.yes) {
|
|
99
97
|
if (this.jsonEnabled() || !process.stdin.isTTY) {
|
|
100
98
|
this.error('Promotion branch recreation requires confirmation. Pass --yes for headless or JSON execution.', {
|
|
@@ -122,7 +120,11 @@ export default class CloudPromote extends CicdCommand {
|
|
|
122
120
|
timeoutSeconds: promoteFlags['wait-timeout'],
|
|
123
121
|
wait: promoteFlags.wait,
|
|
124
122
|
});
|
|
125
|
-
const workResult = {
|
|
123
|
+
const workResult = {
|
|
124
|
+
...result,
|
|
125
|
+
...(createdPromotion === undefined ? {} : { createdPromotion }),
|
|
126
|
+
workItemId,
|
|
127
|
+
};
|
|
126
128
|
this.display(() => {
|
|
127
129
|
this.log(`User Story: ${workItemId}`);
|
|
128
130
|
this.log(formatPromotionRunResult(result));
|
|
@@ -147,7 +149,27 @@ export default class CloudPromote extends CicdCommand {
|
|
|
147
149
|
}
|
|
148
150
|
toErrorJson(err) {
|
|
149
151
|
const base = super.toErrorJson(err);
|
|
150
|
-
|
|
152
|
+
const json = promotionRunErrorJson(base, err);
|
|
153
|
+
if (!isPromotionRunExecutionError(err) ||
|
|
154
|
+
err.result === undefined ||
|
|
155
|
+
this.promoteErrorContext?.createdPromotion === undefined) {
|
|
156
|
+
return json;
|
|
157
|
+
}
|
|
158
|
+
const errorBlock = json.error && typeof json.error === 'object' ? json.error : {};
|
|
159
|
+
const resultBlock = errorBlock.result && typeof errorBlock.result === 'object'
|
|
160
|
+
? errorBlock.result
|
|
161
|
+
: { ...err.result };
|
|
162
|
+
return {
|
|
163
|
+
...json,
|
|
164
|
+
error: {
|
|
165
|
+
...errorBlock,
|
|
166
|
+
result: {
|
|
167
|
+
...resultBlock,
|
|
168
|
+
createdPromotion: this.promoteErrorContext.createdPromotion,
|
|
169
|
+
workItemId: this.promoteErrorContext.workItemId,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
151
173
|
}
|
|
152
174
|
}
|
|
153
175
|
//# sourceMappingURL=promote.js.map
|
|
@@ -2,7 +2,7 @@ import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
|
2
2
|
import { buildCredentialListFilters, credentialListFlags } from '../../../lib/environment-credential-flags.js';
|
|
3
3
|
import { listCredentials } from '../../../lib/environment-credential-operations.js';
|
|
4
4
|
import { cellValue, table } from '../../../lib/format.js';
|
|
5
|
-
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
5
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../lib/list-pagination.js';
|
|
6
6
|
export function formatCredentialTable(credentials) {
|
|
7
7
|
const header = [
|
|
8
8
|
{ alias: 'ID', value: 'id' },
|
|
@@ -40,6 +40,7 @@ export default class CredentialList extends CicdCommand {
|
|
|
40
40
|
async run() {
|
|
41
41
|
const { flags } = await this.parse(CredentialList);
|
|
42
42
|
const page = await this.withSpinner('Fetching credentials', () => listCredentials(buildCredentialListFilters(flags)));
|
|
43
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
43
44
|
this.display(() => {
|
|
44
45
|
if (page.data.length === 0) {
|
|
45
46
|
this.log('No credentials found.');
|
|
@@ -2,7 +2,7 @@ import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
|
2
2
|
import { buildEnvironmentListFilters, environmentListFilterFlags } from '../../../lib/environment-flags.js';
|
|
3
3
|
import { fetchEnvironments } from '../../../lib/environment-get.js';
|
|
4
4
|
import { cellValue, table } from '../../../lib/format.js';
|
|
5
|
-
import { buildPaginatedListResult, displayListPagination, pickCursorPageMeta, } from '../../../lib/list-pagination.js';
|
|
5
|
+
import { buildPaginatedListResult, displayListPagination, emitPaginatedListWarnings, pickCursorPageMeta, } from '../../../lib/list-pagination.js';
|
|
6
6
|
export function normalizeEnvironmentsListPage(response) {
|
|
7
7
|
return buildPaginatedListResult(Array.isArray(response.data) ? response.data : [], pickCursorPageMeta(response));
|
|
8
8
|
}
|
|
@@ -53,6 +53,7 @@ export default class EnvironmentList extends CicdCommand {
|
|
|
53
53
|
const { flags } = await this.parse(EnvironmentList);
|
|
54
54
|
const filters = buildEnvironmentListFilters(flags);
|
|
55
55
|
const page = await this.withSpinner('Fetching environments', () => fetchEnvironments(filters));
|
|
56
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
56
57
|
this.display(() => {
|
|
57
58
|
if (page.data.length === 0) {
|
|
58
59
|
this.log('No environments found.');
|
|
@@ -2,7 +2,7 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
3
|
import { fetchExtensionConfigurations } from '../../../lib/extension-configuration-ops.js';
|
|
4
4
|
import { formatExtensionConfigurationTable, } from '../../../lib/extension-configuration-types.js';
|
|
5
|
-
import { displayListPagination, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
5
|
+
import { displayListPagination, emitPaginatedListWarnings, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
6
6
|
export default class ExtensionConfigurationList extends CicdCommand {
|
|
7
7
|
static description = 'List Copado extension configurations';
|
|
8
8
|
static examples = [
|
|
@@ -35,6 +35,7 @@ export default class ExtensionConfigurationList extends CicdCommand {
|
|
|
35
35
|
testType: flags['test-type'],
|
|
36
36
|
tool: flags.tool,
|
|
37
37
|
}));
|
|
38
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
38
39
|
this.display(() => {
|
|
39
40
|
if (page.data.length === 0) {
|
|
40
41
|
this.log('No extension configurations found.');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatFunctionTable, FUNCTION_LIST_TYPES,
|
|
5
|
-
import { buildListPaginationQuery, displayListPagination, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
3
|
+
import { fetchFunctions } from '../../../lib/function-list.js';
|
|
4
|
+
import { formatFunctionTable, FUNCTION_LIST_TYPES, } from '../../../lib/function-types.js';
|
|
5
|
+
import { buildListPaginationQuery, displayListPagination, emitPaginatedListWarnings, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
6
6
|
export default class FunctionList extends CicdCommand {
|
|
7
7
|
static description = 'List Copado Functions';
|
|
8
8
|
static examples = [
|
|
@@ -34,17 +34,14 @@ export default class FunctionList extends CicdCommand {
|
|
|
34
34
|
async run() {
|
|
35
35
|
const { flags } = await this.parse(FunctionList);
|
|
36
36
|
const pagination = buildListPaginationQuery(flags);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: flags.type,
|
|
44
|
-
}),
|
|
45
|
-
method: 'GET',
|
|
37
|
+
const page = await this.withSpinner('Fetching functions', () => fetchFunctions({
|
|
38
|
+
...pagination,
|
|
39
|
+
imageName: flags['image-name'],
|
|
40
|
+
name: flags.name,
|
|
41
|
+
size: flags.size,
|
|
42
|
+
type: flags.type,
|
|
46
43
|
}));
|
|
47
|
-
|
|
44
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
48
45
|
this.display(() => {
|
|
49
46
|
if (page.data.length === 0) {
|
|
50
47
|
this.log('No functions found.');
|
|
@@ -2,7 +2,7 @@ import { Flags } from '@oclif/core';
|
|
|
2
2
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
3
|
import { fetchJobs } from '../../../lib/job-get.js';
|
|
4
4
|
import { formatJobTable } from '../../../lib/job-types.js';
|
|
5
|
-
import { buildListPaginationQuery, displayListPagination, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
5
|
+
import { buildListPaginationQuery, displayListPagination, emitPaginatedListWarnings, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
6
6
|
import { getUserContext } from '../../../lib/user-context.js';
|
|
7
7
|
export default class JobList extends CicdCommand {
|
|
8
8
|
static description = 'List Copado job executions';
|
|
@@ -57,6 +57,7 @@ export default class JobList extends CicdCommand {
|
|
|
57
57
|
filters.ownerId = userId;
|
|
58
58
|
}
|
|
59
59
|
const page = await this.withSpinner('Fetching jobs', () => fetchJobs(filters));
|
|
60
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
60
61
|
this.display(() => {
|
|
61
62
|
if (page.data.length === 0) {
|
|
62
63
|
this.log('No jobs found.');
|
|
@@ -2,6 +2,7 @@ import { Args, Flags } from '@oclif/core';
|
|
|
2
2
|
import { writeFileSync } from 'node:fs';
|
|
3
3
|
import { CicdCommand } from '../../../../lib/cicd-command.js';
|
|
4
4
|
import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
5
|
+
import { resolveJobResultFileId } from '../../../../lib/job-get.js';
|
|
5
6
|
import { decodeJobResultFileBase64, jobResultFileContentEndpoint, normalizeJobResultFileContent, } from '../../../../lib/job-types.js';
|
|
6
7
|
export default class JobResultFileGet extends CicdCommand {
|
|
7
8
|
static args = {
|
|
@@ -18,7 +19,7 @@ export default class JobResultFileGet extends CicdCommand {
|
|
|
18
19
|
];
|
|
19
20
|
static flags = {
|
|
20
21
|
'file-id': Flags.string({
|
|
21
|
-
description: '
|
|
22
|
+
description: 'fileId (068...) returned by result-file list; a contentDocumentId (069...) is resolved automatically',
|
|
22
23
|
required: true,
|
|
23
24
|
}),
|
|
24
25
|
'output-file': Flags.string({
|
|
@@ -27,10 +28,14 @@ export default class JobResultFileGet extends CicdCommand {
|
|
|
27
28
|
};
|
|
28
29
|
async run() {
|
|
29
30
|
const { args, flags } = await this.parse(JobResultFileGet);
|
|
30
|
-
const response = await this.withSpinner('Fetching result file', () =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const { fileId, response } = await this.withSpinner('Fetching result file', async () => {
|
|
32
|
+
const resolvedFileId = await resolveJobResultFileId(args.resultId, flags['file-id']);
|
|
33
|
+
const gatewayResponse = await CicdGateway.call({
|
|
34
|
+
endpoint: jobResultFileContentEndpoint(args.resultId, resolvedFileId),
|
|
35
|
+
method: 'GET',
|
|
36
|
+
});
|
|
37
|
+
return { fileId: resolvedFileId, response: gatewayResponse };
|
|
38
|
+
});
|
|
34
39
|
const file = {
|
|
35
40
|
...normalizeJobResultFileContent(response),
|
|
36
41
|
resultId: args.resultId,
|
|
@@ -42,7 +47,7 @@ export default class JobResultFileGet extends CicdCommand {
|
|
|
42
47
|
}
|
|
43
48
|
this.display(() => {
|
|
44
49
|
this.log(`File name: ${file.fileName ?? file.title ?? '—'}`);
|
|
45
|
-
this.log(`File ID: ${file.fileId ??
|
|
50
|
+
this.log(`File ID: ${file.fileId ?? fileId}`);
|
|
46
51
|
this.log(`Size: ${file.contentSize ?? '—'}`);
|
|
47
52
|
});
|
|
48
53
|
return file;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../../lib/cicd-command.js';
|
|
2
2
|
import { assertRequired } from '../../../../lib/assert.js';
|
|
3
|
-
import { displayListPagination } from '../../../../lib/list-pagination.js';
|
|
3
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../../lib/list-pagination.js';
|
|
4
4
|
import { pipelineAutomationListFlags } from '../../../../lib/pipeline-automation-flags.js';
|
|
5
5
|
import { fetchPipelineAutomationRules } from '../../../../lib/pipeline-automation-ops.js';
|
|
6
6
|
import { formatPipelineAutomationRuleTable, } from '../../../../lib/pipeline-automation-types.js';
|
|
@@ -24,6 +24,7 @@ export default class PipelineAutomationList extends CicdCommand {
|
|
|
24
24
|
pageSize: flags['page-size'],
|
|
25
25
|
sourceAction: flags['source-action'],
|
|
26
26
|
}));
|
|
27
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
27
28
|
this.display(() => {
|
|
28
29
|
if (page.data.length === 0) {
|
|
29
30
|
this.log('No pipeline automation rules found.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
2
|
-
import { displayListPagination, } from '../../../lib/list-pagination.js';
|
|
2
|
+
import { displayListPagination, emitPaginatedListWarnings, } from '../../../lib/list-pagination.js';
|
|
3
3
|
import { buildPipelineListFilters, pipelineListFlags } from '../../../lib/pipeline-flags.js';
|
|
4
4
|
import { fetchPipelines } from '../../../lib/pipeline-get.js';
|
|
5
5
|
import { formatPipelineTable } from '../../../lib/pipeline-types.js';
|
|
@@ -14,6 +14,7 @@ export default class PipelineList extends CicdCommand {
|
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(PipelineList);
|
|
16
16
|
const page = await this.withSpinner('Fetching pipelines', () => fetchPipelines(buildPipelineListFilters(flags)));
|
|
17
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
17
18
|
this.display(() => {
|
|
18
19
|
if (page.data.length === 0) {
|
|
19
20
|
this.log('No pipelines found.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../../lib/cicd-command.js';
|
|
2
2
|
import { assertRequired } from '../../../../lib/assert.js';
|
|
3
|
-
import { displayListPagination } from '../../../../lib/list-pagination.js';
|
|
3
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../../lib/list-pagination.js';
|
|
4
4
|
import { pipelineQualityGateListFlags } from '../../../../lib/pipeline-quality-gate-flags.js';
|
|
5
5
|
import { fetchPipelineQualityGates } from '../../../../lib/pipeline-quality-gate-ops.js';
|
|
6
6
|
import { formatPipelineQualityGateTable, } from '../../../../lib/pipeline-quality-gate-types.js';
|
|
@@ -20,6 +20,7 @@ export default class PipelineQualityGateList extends CicdCommand {
|
|
|
20
20
|
pageSize: flags['page-size'],
|
|
21
21
|
tool: flags.tool,
|
|
22
22
|
}));
|
|
23
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
23
24
|
this.display(() => {
|
|
24
25
|
if (page.data.length === 0) {
|
|
25
26
|
this.log('No pipeline quality gates found.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
2
|
-
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
2
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../lib/list-pagination.js';
|
|
3
3
|
import { buildProjectListFilters, projectListFlags, validateProjectListFilters, } from '../../../lib/project-flags.js';
|
|
4
4
|
import { fetchProjects } from '../../../lib/project-get.js';
|
|
5
5
|
import { formatProjectTable } from '../../../lib/project-types.js';
|
|
@@ -20,6 +20,7 @@ export default class ProjectList extends CicdCommand {
|
|
|
20
20
|
this.error(validationError, { exit: 2 });
|
|
21
21
|
}
|
|
22
22
|
const page = await this.withSpinner('Fetching projects', () => fetchProjects(filters));
|
|
23
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
23
24
|
this.display(() => {
|
|
24
25
|
if (page.data.length === 0) {
|
|
25
26
|
this.log('No projects found.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
2
|
-
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
2
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../lib/list-pagination.js';
|
|
3
3
|
import { buildPromotionListFilters, promotionListFilterFlags } from '../../../lib/promotion-flags.js';
|
|
4
4
|
import { fetchPromotions } from '../../../lib/promotion-get.js';
|
|
5
5
|
import { formatPromotionTable } from '../../../lib/promotion-types.js';
|
|
@@ -28,6 +28,7 @@ export default class PromotionList extends CicdCommand {
|
|
|
28
28
|
const { flags } = await this.parse(PromotionList);
|
|
29
29
|
const filters = buildPromotionListFilters(flags);
|
|
30
30
|
const page = await this.withSpinner('Fetching promotions', () => fetchPromotions(filters));
|
|
31
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
31
32
|
this.display(() => {
|
|
32
33
|
if (page.data.length === 0) {
|
|
33
34
|
this.log('No promotions found.');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
|
+
import { fetchPromotionStatus, formatPromotionStatus, } from '../../../lib/promotion-status.js';
|
|
4
|
+
export default class PromotionStatus extends CicdCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
id: Args.string({
|
|
7
|
+
description: 'Copado promotion ID',
|
|
8
|
+
name: 'id',
|
|
9
|
+
required: true,
|
|
10
|
+
}),
|
|
11
|
+
};
|
|
12
|
+
static description = [
|
|
13
|
+
'Show actionable status for a Copado promotion: user stories, current job step,',
|
|
14
|
+
'queue summary, and whether a Manual Task or queue item needs attention.',
|
|
15
|
+
].join(' ');
|
|
16
|
+
static examples = [
|
|
17
|
+
'<%= config.bin %> <%= command.id %> <promotion-id>',
|
|
18
|
+
'<%= config.bin %> <%= command.id %> <promotion-id> --json',
|
|
19
|
+
];
|
|
20
|
+
async run() {
|
|
21
|
+
const { args } = await this.parse(PromotionStatus);
|
|
22
|
+
const snapshot = await this.withSpinner('Fetching promotion status', () => fetchPromotionStatus(args.id));
|
|
23
|
+
this.display(() => {
|
|
24
|
+
this.log(formatPromotionStatus(snapshot));
|
|
25
|
+
});
|
|
26
|
+
return snapshot;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
2
|
-
import {
|
|
3
|
-
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
2
|
+
import { displayListPagination, emitPaginatedListWarnings } from '../../../lib/list-pagination.js';
|
|
4
3
|
import { buildRepositoryListFilters, repositoryListFlags } from '../../../lib/repository-flags.js';
|
|
5
|
-
import {
|
|
4
|
+
import { fetchRepositories } from '../../../lib/repository-list.js';
|
|
5
|
+
import { formatRepositoryTable } from '../../../lib/repository-types.js';
|
|
6
6
|
export default class RepositoryList extends CicdCommand {
|
|
7
7
|
static description = 'List Copado Git repositories';
|
|
8
8
|
static examples = [
|
|
@@ -15,11 +15,8 @@ export default class RepositoryList extends CicdCommand {
|
|
|
15
15
|
static flags = repositoryListFlags;
|
|
16
16
|
async run() {
|
|
17
17
|
const { flags } = await this.parse(RepositoryList);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
method: 'GET',
|
|
21
|
-
}));
|
|
22
|
-
const page = normalizeRepositoriesListPage(response);
|
|
18
|
+
const page = await this.withSpinner('Fetching repositories', () => fetchRepositories(buildRepositoryListFilters(flags)));
|
|
19
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
23
20
|
this.display(() => {
|
|
24
21
|
if (page.data.length === 0) {
|
|
25
22
|
this.log('No repositories found.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
2
|
-
import { displayListPagination, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
2
|
+
import { displayListPagination, emitPaginatedListWarnings, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
3
3
|
import { fetchStages } from '../../../lib/stage-list.js';
|
|
4
4
|
import { formatStageTable } from '../../../lib/stage-types.js';
|
|
5
5
|
export default class StageList extends CicdCommand {
|
|
@@ -12,6 +12,7 @@ export default class StageList extends CicdCommand {
|
|
|
12
12
|
cursor: flags.cursor,
|
|
13
13
|
pageSize: flags['page-size'],
|
|
14
14
|
}));
|
|
15
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
15
16
|
this.display(() => {
|
|
16
17
|
if (page.data.length === 0) {
|
|
17
18
|
this.log('No stages found.');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { CicdCommand } from '../../../lib/cicd-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { formatTemplateTable,
|
|
3
|
+
import { buildListPaginationQuery, displayListPagination, emitPaginatedListWarnings, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
4
|
+
import { fetchTemplates } from '../../../lib/template-list.js';
|
|
5
|
+
import { formatTemplateTable, TEMPLATE_LIST_TYPES, } from '../../../lib/template-types.js';
|
|
6
6
|
export default class TemplateList extends CicdCommand {
|
|
7
7
|
static description = 'List Copado Job Templates';
|
|
8
8
|
static examples = [
|
|
@@ -29,16 +29,13 @@ export default class TemplateList extends CicdCommand {
|
|
|
29
29
|
async run() {
|
|
30
30
|
const { flags } = await this.parse(TemplateList);
|
|
31
31
|
const pagination = buildListPaginationQuery(flags);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type: flags.type,
|
|
38
|
-
}),
|
|
39
|
-
method: 'GET',
|
|
32
|
+
const page = await this.withSpinner('Fetching templates', () => fetchTemplates({
|
|
33
|
+
...pagination,
|
|
34
|
+
fetchAll: flags['fetch-all'] === true ? true : undefined,
|
|
35
|
+
name: flags.name,
|
|
36
|
+
type: flags.type,
|
|
40
37
|
}));
|
|
41
|
-
|
|
38
|
+
emitPaginatedListWarnings(this.warn.bind(this), page);
|
|
42
39
|
this.display(() => {
|
|
43
40
|
if (page.data.length === 0) {
|
|
44
41
|
this.log('No templates found.');
|
|
@@ -5,11 +5,11 @@ import { workEndpoint } from '../../../lib/work-types.js';
|
|
|
5
5
|
export default class WorkDelete extends CicdCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
id: Args.string({
|
|
8
|
-
description: 'User story ID',
|
|
8
|
+
description: 'User story ID or name',
|
|
9
9
|
required: true,
|
|
10
10
|
}),
|
|
11
11
|
};
|
|
12
|
-
static description = 'Delete a Copado user story by ID';
|
|
12
|
+
static description = 'Delete a Copado user story by ID or name';
|
|
13
13
|
static examples = [
|
|
14
14
|
'<%= config.bin %> <%= command.id %> a0SKC000000CmZ2AU',
|
|
15
15
|
'<%= config.bin %> <%= command.id %> a0SKC000000CmZ2AU --json',
|