@copado/agentia-cli 1.3.0 → 1.4.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 +28 -0
- package/README.md +436 -427
- 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/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/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 +477 -419
- package/package.json +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
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
|
|
|
21
21
|
## References
|
|
22
22
|
|
|
23
23
|
- User stories, git commits, cloud commits, publish, submit, done, quality gates, and deployment steps: [references/work.md](references/work.md)
|
|
24
|
-
- Promotion lookup, run, resume, merge conflicts, and story-centric promotion: [references/promotions.md](references/promotions.md)
|
|
24
|
+
- Promotion lookup, status (blockers/Manual Task/queue), run, resume, merge conflicts, and story-centric promotion: [references/promotions.md](references/promotions.md)
|
|
25
25
|
- Copado JobExecution lookup, actions, logs, and monitoring: [references/jobs.md](references/jobs.md)
|
|
26
26
|
- Copado Functions lifecycle, remote run/results, and local Docker run: [references/functions.md](references/functions.md)
|
|
27
27
|
- Git-hosted Copado CICD extensions (`cicd extension`, experimental): [references/extensions.md](references/extensions.md)
|
|
@@ -39,13 +39,14 @@ For **Org Intelligence** (read Salesforce metadata against a sandbox/developer o
|
|
|
39
39
|
- User Story subscriber custom fields: read `result.customFields` from `work get` / MCP `agentia_work_get`. Write with CLI `--custom-field ApiName=value` (repeatable) or MCP `customFields: [{ apiName, value }]` on create/update. See [references/work.md](references/work.md#subscriber-custom-fields).
|
|
40
40
|
- Use Salesforce record IDs or generated names read from Copado. Do not invent story names, promotion IDs, job IDs, credential IDs, or pipeline IDs.
|
|
41
41
|
- Keep human output off stdout in JSON workflows. Prefer `--json`, then parse the result object.
|
|
42
|
+
- Cursor-paginated CICD lists (`--cursor` / MCP `cursor`) self-heal on gateway category `SF-014` (expired or invalid cursor): Agentia retries once without the cursor and returns page 1 with a `warnings` entry (also mirrored at the top level of CLI `--json`). Treat that as a reset to the first page, not a hard failure; do not keep replaying the same cursor.
|
|
42
43
|
- For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work publish`, and `work submit`. If `work set` returns `status: "warning"`, show the message and do not assume a feature branch was created; branch keys are cleared and the work item id/name/title are still recorded in config.user.json.
|
|
43
44
|
- Treat `cicd job` as Copado CICD JobExecution. It is different from CRT `testing job`.
|
|
44
45
|
- Treat `cicd function` as Copado Function definitions and runs. It is different from JobExecution (`cicd job`) and Job Templates (`cicd template`).
|
|
45
46
|
- Treat `cicd extension` as experimental git-hosted packaging of Functions/Templates (plus optional `force-app`). It is different from per-asset `cicd function` / `cicd template` upserts.
|
|
46
47
|
- Treat `cicd template` as Copado Job Templates via `/release/jobs/templates`. It is different from Release Data Templates (`cicd data template`).
|
|
47
|
-
- Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing job run`.
|
|
48
|
-
- Treat `cicd work test apex` as the Apex test runner
|
|
48
|
+
- Treat `cicd work test` as local quality gates (`--local` is the default). Use `--gate <id>` / `--list-gates` to run or discover individual gates (apex, lint, lwc, custom). It is different from CRT `testing job run`.
|
|
49
|
+
- Treat `cicd work test --gate apex` as the Apex test runner; the sample local quality gates (`.agentia_quality_gates.*`) call it for their apex gate. Run directly it uploads the result to the work item; inside a script (`AGENTIA_QUALITY_GATES_ACTIVE=1`) it does not, because the outer run reports once. An empty `--apex-test-classes` list skips Salesforce CLI. `cicd work test apex` is the legacy hidden alias. It is different from CRT.
|
|
49
50
|
- Treat `auth` credentials as keychain/API credentials and `cicd credential` records as Copado environment credentials.
|
|
50
51
|
|
|
51
52
|
## Report Back
|
|
@@ -13,8 +13,8 @@ Use this reference for Copado CICD JobExecution commands under `agentia cicd job
|
|
|
13
13
|
| `job list` | Search job executions | Filter by `--status`, `--type`, `--parent`, `--context`, `--mine`, cursor, and page size. |
|
|
14
14
|
| `job get ID` | Inspect a job and ordered steps | Read before action commands or log lookup. |
|
|
15
15
|
| `job log get ID` | Read execution logs | Use `--step <step-id>` when a specific step is needed. |
|
|
16
|
-
| `job result-file list RESULT_ID` | Discover files linked to a job-step Result |
|
|
17
|
-
| `job result-file get RESULT_ID --file-id
|
|
16
|
+
| `job result-file list RESULT_ID` | Discover files linked to a job-step Result | Human table includes FILE ID (`fileId`, 068); JSON returns `fileId` and `contentDocumentId`. |
|
|
17
|
+
| `job result-file get RESULT_ID --file-id FILE_ID` | Retrieve one Result-linked file | Pass `fileId` from list (068). A ContentDocument id (069) is resolved via list before download. |
|
|
18
18
|
| `job run ID` | Run all steps | Use `--restart` only when the user asks to restart from the beginning. |
|
|
19
19
|
| `job resume ID` | Resume outstanding steps | Good after a paused or partially completed job. |
|
|
20
20
|
| `job pause ID` | Pause/cancel resumably | Confirm intent before interrupting active work. |
|
|
@@ -45,5 +45,6 @@ agentia cicd job resume <job-execution-id> --json
|
|
|
45
45
|
- Some job tools require user and organization context at the gateway layer. If the CLI reports missing context, inspect auth and user context before retrying.
|
|
46
46
|
- Logs can be large. Prefer a specific step when available.
|
|
47
47
|
- Result-file commands require the job-step Result ID, not the JobExecution ID. They accept only 15- or 18-character Salesforce IDs and never derive output paths from remote filenames.
|
|
48
|
+
- Use `fileId` (068) from `result-file list` for downloads. The list table shows FILE ID; JSON also includes `contentDocumentId` (069), which must not be used directly in the download path. `result-file get` and MCP `agentia_job_result_file_get` resolve a 069 id when it matches a listed file.
|
|
48
49
|
- `--output-file` can replace an existing file after Base64 validation. Use an explicitly controlled destination; malformed content leaves an existing target unchanged.
|
|
49
50
|
- Do not use CICD job commands for Robot Framework builds; use the `agentia-testing` skill for CRT run status and logs.
|
|
@@ -9,7 +9,7 @@ Use this reference for `agentia cicd promotion ...`, `agentia cicd promotion con
|
|
|
9
9
|
| Command | Starts From | Use When |
|
|
10
10
|
| --- | --- | --- |
|
|
11
11
|
| `agentia cicd promotion run <promotion-id>` | Promotion ID | You already know the Promotion record and want explicit merge or merge-and-deploy control. |
|
|
12
|
-
| `agentia cicd cloud promote [story-id]` | User Story |
|
|
12
|
+
| `agentia cicd cloud promote [story-id]` | User Story | Resolve the story's Promotion before running; creates a forward Draft promotion and adds the story when none exists. |
|
|
13
13
|
| `agentia cicd work submit --done` | Active User Story branch | The story is approved and should move to the next stage (Copado UI Submit promote). |
|
|
14
14
|
|
|
15
15
|
Prefer `cloud promote` when the user talks about a story. Prefer `promotion run` when the user provides a Promotion ID.
|
|
@@ -19,15 +19,27 @@ Prefer `cloud promote` when the user talks about a story. Prefer `promotion run`
|
|
|
19
19
|
| Command | Use For | Notes |
|
|
20
20
|
| --- | --- | --- |
|
|
21
21
|
| `promotion list` | Find promotions | Filter by `--work-id`, status, project, pipeline, source/destination environment, or back-promotion flags. |
|
|
22
|
-
| `promotion
|
|
22
|
+
| `promotion status ID` | Actionable run status | Prefer when the user asks "promotion status", what is running, or what is blocking. Includes user stories, current job step, queue, and Manual Task action-needed. MCP: `agentia_promotion_status`. |
|
|
23
|
+
| `promotion get ID` | Inspect one promotion record | Read this before running, resuming, or resolving conflicts. Does not load job steps; use `promotion status` for blockers. |
|
|
23
24
|
| `promotion run ID` | Preflight and submit a run | Requires `--operation merge` or `--operation merge_and_deploy` unless `--resume` is used. |
|
|
24
25
|
| `promotion open ID` | Open in browser | CLI-only navigation helper. |
|
|
25
|
-
| `cloud promote [ID]` | Story-centric run | Use `--deploy` for merge and deploy; use `--promotion-id` if the story has multiple promotions. |
|
|
26
|
+
| `cloud promote [ID]` | Story-centric run | Use `--deploy` for merge and deploy; use `--promotion-id` if the story has multiple promotions (explicit ID is used as is and never creates one). JSON/MCP return `createdPromotion` when auto-created. |
|
|
27
|
+
|
|
28
|
+
## Status Reports
|
|
29
|
+
|
|
30
|
+
When the user asks about a promotion's progress or blockers, call `agentia cicd promotion status <id> --json` (or MCP `agentia_promotion_status`) and report **all** of:
|
|
31
|
+
|
|
32
|
+
1. Promotion name/id and status (and Salesforce status when present).
|
|
33
|
+
2. User stories involved (name and id).
|
|
34
|
+
3. Current job and current step (name, status, type).
|
|
35
|
+
4. Whether `actionNeeded.kind` is `manual_task` or `queue` — quote `actionNeeded.message` and tell the user they must act; do not say only "In Progress".
|
|
36
|
+
5. Queue summary when present; call `promotion queue list` if they need item-level detail.
|
|
26
37
|
|
|
27
38
|
Example:
|
|
28
39
|
|
|
29
40
|
```sh
|
|
30
41
|
agentia cicd promotion list --work-id <story-id> --json
|
|
42
|
+
agentia cicd promotion status <promotion-id> --json
|
|
31
43
|
agentia cicd promotion run <promotion-id> --operation merge_and_deploy --json
|
|
32
44
|
agentia cicd cloud promote <story-id> --deploy --json
|
|
33
45
|
```
|
|
@@ -61,7 +73,7 @@ List first and take item IDs from the output. Removal is destructive: confirm th
|
|
|
61
73
|
|
|
62
74
|
## Gotchas
|
|
63
75
|
|
|
64
|
-
- Promotion IDs are not User Story IDs. Use `cloud promote` if you only have the story.
|
|
76
|
+
- Promotion IDs are not User Story IDs. Use `cloud promote` if you only have the story; do not create the promotion manually first when none contains the story.
|
|
65
77
|
- `--deploy` on `cloud promote` maps to promotion operation `merge_and_deploy`; without it, the default is merge only.
|
|
66
78
|
- `--recreate-promotion-branch` is a sensitive run option and should be paired with explicit user intent and `--yes` when required.
|
|
67
79
|
- If conflicts exist, resolve them first and then resume the same execution.
|
|
@@ -36,7 +36,7 @@ Use this path when the change exists in the local repository:
|
|
|
36
36
|
1. Discover and inspect: `agentia cicd work list --assigned-to-me --json`, then `agentia cicd work get <id-or-name> --json`.
|
|
37
37
|
2. Activate: `agentia cicd work set <id-or-name> --json`. This fetches the configured base branch, fetches the Story feature branch when it exists on origin, then checks out `feature/<story-name>` from that remote branch when present (otherwise from the base), and records the story, base branch, dev org branch, and pull-request context in `.agentia/config.user.json`. Use `--base-branch <branch>` only when intentionally overriding the Pipeline default. If the JSON result has `status: "warning"` (missing pipeline or credential), show that `message`, do not assume a feature branch was created, and note that branch keys (`lastBaseBranch`, `lastDevOrgBranch`, `lastPullRequestBaseUrl`) were cleared while `lastWorkItemId`/`lastWorkItem`/`lastWorkItemTitle` were recorded — stop until the Story setup is fixed; publish and submit will not work. If the Story source credential differs from the project default, work set warns with the current credential and environment and does not PATCH; use `agentia cicd work update <id> --source-credential <credential-id>` to change it.
|
|
38
38
|
3. Implement with Salesforce CLI, VS Code, or an IDE. Stage and commit with `git add` / `git commit`. Do not use `agentia cicd cloud commit` for local Git work.
|
|
39
|
-
4. Run project-owned gates: `agentia cicd work test --json`. This runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from the repository root when present. If those files are missing, it warns and runs
|
|
39
|
+
4. Run project-owned gates: `agentia cicd work test --json`. This runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from the repository root when present. If those files are missing, it warns and runs the stock sample from a temporary file. Local tests can be slow; pass `--apex-test-classes=MyTest,OtherTest` for faster, earlier Apex checks.
|
|
40
40
|
5. Register and synchronize: `agentia cicd work publish --json`. A plain `git push` does not register a Copado Commit or merge the feature branch into the recorded dev org branch. Pass `--permissions` and `--full-metadata` when nested detection is not enough.
|
|
41
41
|
6. Validate and open the merge-request flow: `agentia cicd work submit --json`. Submit runs the local gates unless `--skip-local-tests` is explicit, pushes ahead commits, waits if the last pending related job is a Commit template, and submits with validate-only behavior. `--skip-pull-request` skips opening the compare URL.
|
|
42
42
|
7. Only with explicit approval to promote and deploy, run `agentia cicd work submit --deploy --json` (or `--done`). `work done` is a compatibility alias.
|
|
@@ -51,7 +51,7 @@ Use this path when Copado should retrieve metadata from a configured source envi
|
|
|
51
51
|
1. Inspect the Story and pass its Salesforce ID explicitly when possible. An active Story from `work set` is optional, not a prerequisite for the cloud operation.
|
|
52
52
|
2. Start a cloud commit with `agentia cicd cloud commit <story-id> ... --json`. Use the simple metadata flags for one change, or `--file`/`--stdin` for a multi-change request. Always pass `--metadata-category` (use `SFDX` for Salesforce metadata). With `--file`/`--stdin`, each change requires `c` (or `category`).
|
|
53
53
|
3. Let the command wait for its Job Execution by default. After a timeout, use the returned execution ID with `agentia cicd job get` and `agentia cicd job log get`; do not immediately submit a duplicate commit.
|
|
54
|
-
4. When explicitly approved to promote
|
|
54
|
+
4. When explicitly approved to promote, use `agentia cicd cloud promote <story-id> --json`; add `--deploy` only for promote-and-deploy. Creates a forward Draft promotion when none contains the story (`createdPromotion` in JSON/MCP). This is independent of local `work submit`.
|
|
55
55
|
|
|
56
56
|
Cloud commit checks Story readiness and source credentials before submission. Avoid concurrent cloud commits to one Story. Treat `--recreate-feature-branch` as destructive because it can overwrite Story-branch work.
|
|
57
57
|
|
|
@@ -60,20 +60,20 @@ Cloud commit checks Story readiness and source credentials before submission. Av
|
|
|
60
60
|
|
|
61
61
|
| Command | Use For | Notes |
|
|
62
62
|
| ------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
-
| `work list` | Find candidate stories | Use `--assigned-to-me`, `--status`, `--project-name`, `--name`, pagination flags.
|
|
63
|
+
| `work list` | Find candidate stories | Use `--assigned-to-me`, `--status`, `--project-name`, `--name`, pagination flags. An expired or invalid `--cursor` (`SF-014`) self-heals to page 1 with a `warnings` entry in human/`--json`/MCP. |
|
|
64
64
|
| `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields including subscriber `customFields` (`apiName`, `label`, `type`, `value`, `displayValue`, `updateable`, optional `options`). `--committed-metadata` also includes the Story committed metadata list as `committedMetadata` in the result. |
|
|
65
65
|
| `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. Write subscriber fields with repeatable `--custom-field ApiName=value` (MCP: `customFields: [{ apiName, value }]`). `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment. |
|
|
66
66
|
| `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. Same `--custom-field` / MCP `customFields` write shape as create; update-only custom fields is allowed. `--source-credential` sends `sourceEnvironment` as null. |
|
|
67
67
|
| `work set ID` | Mark active and prepare branch | Fetches the base branch and, when present, the remote feature branch; creates/checks out `feature/<story-name>` from `origin/feature` when that ref exists, otherwise from the base; stores local context. A gateway warning prints the message, skips git, clears branch keys, and records work-item id/name/title. Warns without PATCHing when the Story credential differs from the project default; use `work update --source-credential` to change it. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
|
|
68
68
|
| `cloud commit` | Copado cloud metadata commit | Prefer `agentia cicd cloud commit`. Requires `--metadata-category` (or `c`/`category` per `--file` change); use `SFDX` for Salesforce metadata. For local Git work, use `git commit` then `work publish`. `cicd work commit` remains a hidden compatibility alias. |
|
|
69
69
|
| `work publish` | Publish local commits and register with Copado | Requires active story context and clean tree. Accepts `--permissions` and `--full-metadata` when nested detection is not enough. `work push` is a compatibility alias. |
|
|
70
|
-
| `work test` | Run local quality gate scripts | `--local` is default. Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. If missing, warns and runs the stock setup sample from a temp file. `--cloud` is not implemented yet. |
|
|
71
|
-
| `work test apex` |
|
|
70
|
+
| `work test` | Run local quality gate scripts | `--local` is default. Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. If missing, warns and runs the stock setup sample from a temp file. `--gate <id>` (repeatable) runs only selected gates, `--all` runs everything (default), `--list-gates` lists gates declared via `# agentia-gate: <id> - <description>` in the script. Standard ids: `apex`, `lint`, `lwc`; custom ids allowed. The selection is exported as `AGENTIA_GATES`. `--gate apex` alone skips the script and runs the Apex tests directly (`--apex-test-classes`, `--rerun-failed-apex-tests`, `--wait`). `--cloud` is not implemented yet. |
|
|
71
|
+
| `work test apex` | Legacy alias of `work test --gate apex` | Optional `--apex-test-classes`. Omit or pass empty to log a skip and exit 0 without calling Salesforce CLI. `--rerun-failed-apex-tests` reruns classes from `.agentia/apex.tests.<user-story>.json`. Optional `--wait` minutes (default 60). Prefer `work test --gate apex`. |
|
|
72
72
|
| `work submit` | Submit for review/validation or promote | Runs local gates unless `--skip-local-tests`; can push ahead commits. Waits up to 5 minutes when the last pending related job template contains `Commit`. `--skip-pull-request` skips opening the MR URL. `--done` and `--deploy` match Copado UI Submit when promoting. |
|
|
73
73
|
| `work done` | Compatibility alias | Prefer `work submit --done`; both promote and deploy rather than validate-only. |
|
|
74
74
|
| `work promote` | Experimental local promotion | Skips Quality Gates. Requires `enableLocalPromote: true` in `.agentia/config.json`. Merges `feature/<name>` into `promotion/<promotionName>`. Use `--backpromote --destination-branch` for back promotions; `--continue` after conflict resolution. |
|
|
75
|
-
| `work environment-sync` | Sync next-env commits onto dest/dev
|
|
76
|
-
| `cloud promote` | Story-centric cloud promotion run | Use `--deploy` for merge and deploy. Prefer this over local `work promote` unless you explicitly enabled local promote.
|
|
75
|
+
| `work environment-sync` | Sync next-env commits onto dest/dev (experimental) | Experimental. Back-promotes every story behind the destination environment onto `promotion/<name>` (from dest org), then merges that branch into dest and pushes both. On a feature branch, unpublished commits stop the command (`work publish` first); after a successful sync, feature files changed vs base are refreshed from dest and you are told to re-check and publish again. On conflict, resolve on `promotion/<name>` (or dest) and `--continue` / `--abort` (`lastEnvironmentSyncName` can omit `--promotion`; cleared on success, abort, and `work set`). Success/abort call `promote-action/complete` with `--deployment` resolved to `none`\|`local`\|`cloud` (`auto` → `local` when every change is Add and `--sf-alias` is set, else `cloud`). Local deploy runs on the dest org branch (before feature refresh) via `sf project deploy start --ignore-conflicts` (Add-only); failures include full `package.xml` and raw `sf` stdout/stderr (human and `--json`). After success with cloud deployment, waits for the JobExecution by default (`--no-wait` / `--wait-timeout`). |
|
|
76
|
+
| `cloud promote` | Story-centric cloud promotion run | Auto-creates a forward Draft promotion when none contains the story. Use `--deploy` for merge and deploy. Prefer this over local `work promote` unless you explicitly enabled local promote. |
|
|
77
77
|
| `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
|
|
78
78
|
| `work open [ID]` | Open story in browser | CLI-only browser helper. |
|
|
79
79
|
|
|
@@ -94,7 +94,7 @@ agentia cicd work submit --json
|
|
|
94
94
|
|
|
95
95
|
`--permissions` on publish names metadata that Copado should treat as Retrieve Only. List the components whose access changed, not the permission set or profile files; naming those parent types is rejected. Use `--full-metadata` only for `Profile`, `PermissionSet`, `MutingPermissionSet`, `CustomObject`, or `CustomObjectTranslation` when that complete file should travel; other types are rejected. Both flags apply to that publish only.
|
|
96
96
|
|
|
97
|
-
`work test` and `work submit` take `--apex-test-classes` when you want the local gate script to receive them as `AGENTIA_APEX_TEST_CLASSES`. Sample quality-gate scripts pass that value to `work test apex
|
|
97
|
+
`work test` and `work submit` take `--apex-test-classes` when you want the local gate script to receive them as `AGENTIA_APEX_TEST_CLASSES`. Sample quality-gate scripts pass that value to the apex gate (`work test --gate apex`). Run one gate with `work test --gate lint` (MCP `gates: ["lint"]`); `work submit` always runs every gate. The sample lint gate scans only branch-changed files (diff vs `AGENTIA_BASE_BRANCH` merge-base, plus uncommitted/untracked); set `LINT_SCOPE=all` for a full scan, which is also the fallback outside git.
|
|
98
98
|
|
|
99
99
|
`work publish` detects nested metadata across the full branch diff from the merge base to `HEAD`, applies Copado environment-variable and YAML replacements, registers every commit in the range, and merges into the recorded dev org branch. Review unexpected Retrieve Only, Full Metadata, or nested-deletion output before continuing.
|
|
100
100
|
|
|
@@ -107,15 +107,29 @@ agentia cicd cloud commit <story-id> --message "Commit AccountService" --metadat
|
|
|
107
107
|
agentia cicd cloud commit <story-id> --file commit-request.json --json
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
Example `commit-request.json` for multiple components:
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"message": "Account service and trigger",
|
|
115
|
+
"changes": [
|
|
116
|
+
{"a": "Add", "c": "SFDX", "n": "AccountService", "t": "ApexClass"},
|
|
117
|
+
{"a": "Add", "c": "SFDX", "n": "AccountTrigger", "t": "ApexTrigger"}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`--metadata-category` is required on simple flag input (one component only). Each `--file`/`--stdin` change requires `c` (or `category`). For Salesforce metadata, use `SFDX`. Without `c:SFDX`, Copado deploy logs can report "Salesforce changes not found."
|
|
123
|
+
|
|
124
|
+
For cloud promotion from a User Story:
|
|
113
125
|
|
|
114
126
|
```sh
|
|
115
127
|
agentia cicd cloud promote <story-id> --json
|
|
116
128
|
agentia cicd cloud promote <story-id> --deploy --json
|
|
117
129
|
```
|
|
118
130
|
|
|
131
|
+
When no Promotion contains the story, `cloud promote` and MCP `agentia_cloud_promote` create one automatically before running.
|
|
132
|
+
|
|
119
133
|
Cloud commit and promotion wait for Job Executions by default and return nonzero on failed or timed-out jobs while preserving diagnostic IDs. If a Promotion reaches Merge Conflict, resolve it and resume the original execution; do not start a replacement run.
|
|
120
134
|
|
|
121
135
|
## Subscriber Custom Fields
|
|
@@ -154,7 +168,7 @@ Prefer explicit flags for standard step types. Use `--config-json`, `--file`, or
|
|
|
154
168
|
## Gotchas
|
|
155
169
|
|
|
156
170
|
- `work test` is not CRT. For Robot Framework execution, use the `agentia-testing` skill.
|
|
157
|
-
- `work test apex` runs named Apex classes.
|
|
171
|
+
- `work test --gate apex` runs named Apex classes directly (the legacy `work test apex` is an alias). Sample local quality gates (`.agentia_quality_gates.*`) call it with `--apex-test-classes="${AGENTIA_APEX_TEST_CLASSES}"` and `${AGENTIA_APEX_RERUN_FAILED}` (empty or `--rerun-failed-apex-tests`); an empty class list skips Apex without failing the script. `--rerun-failed-apex-tests` reruns classes saved in `.agentia/apex.tests.<user-story>.json` after a failure. Run it directly for a targeted rerun without the rest of the gates.
|
|
158
172
|
- Local Git work uses `git commit` then `work publish`. Cloud `cloud commit` is a separate path.
|
|
159
173
|
- `work submit` may push ahead commits, but the local flow still needs story and branch context from `work set`.
|
|
160
174
|
- `work submit --done` (or `--deploy`) promotes/deploys. Do not run it unless the user explicitly asked to promote or finish the story.
|
|
@@ -49,7 +49,6 @@ agentia testing browser stop --project <project-id> --yes --json
|
|
|
49
49
|
| `testing browser execute [job-id]` | Run keywords using `--line "..."` (repeatable), `--keyword <name> --arg <val>`, `--file <path>`, or `--stdin`. Pass `--raw` to skip `.robot` section parsing. |
|
|
50
50
|
| `testing browser inspect [job-id]` | Fetch `GET /api/system-state` (`url`, `timestamp`, `changeOrigin`, `systemState` interactive element annotations). Add `--dom` with `--output <file>` or `--json` to stream and reassemble `document.documentElement.outerHTML` over the terminal WebSocket. |
|
|
51
51
|
| `testing browser screenshot [job-id]` | Save the current viewport PNG (including teal detection bounding boxes) to `--output <path>`. |
|
|
52
|
-
| `testing browser reports [job-id]` | Fetch Robot Framework `log.html`, `report.html`, and `output.xml` metadata, or write them to `--output-dir <dir>`. |
|
|
53
52
|
| `testing browser set-options [job-id]` | Set the full recorder option block (`--[no-]enable`, `--[no-]scroll-text`, `--[no-]healing-context`, `--[no-]hover-text`, `--[no-]system-state`, `--[no-]verify-text`, `--[no-]table-keywords`). Unspecified options default to `false`. |
|
|
54
53
|
| `testing browser view` | Print (`--no-open`, default for agents) or open the CRT browser session URL. Always use `--no-open` unless the user explicitly asks to open the browser. |
|
|
55
54
|
| `testing browser recorder [job-id]` | Connect to the session WebSocket, enable backend recording, and stream captured interactions and executed keywords as Robot Framework lines (or JSON lines with `--json`). Flags: `--output <file.robot>`, `--no-enable`, `--force` (reclaim stale lock), `--debug`. |
|
|
@@ -46,7 +46,7 @@ agentia testing job runs logs <build-id> --project <project-id> --job <job-id> -
|
|
|
46
46
|
| Variables | `testing variable list|get|create|update|delete` |
|
|
47
47
|
| User parameters | `testing user-parameter list|get|create|update|delete` |
|
|
48
48
|
| Data tables | `testing data-table list|get|create|update|delete|export` |
|
|
49
|
-
| Browser testing | `testing browser start|stop|status|execute|inspect|screenshot|
|
|
49
|
+
| Browser testing | `testing browser start|stop|status|execute|inspect|screenshot|set-options|history|view|recorder` |
|
|
50
50
|
|
|
51
51
|
`testing job` is the single namespace for test definitions and their runs. Commands directly under `job` take a job ID; `job runs get|logs|abort` take a build/run ID plus `--job`. On `testing job create` and `testing job update`, `--[no-]show-video-params` (`showVideoParams` in the API/MCP) enables or disables Video Streaming and Recording capabilities when running the test job. The older `testing create|update|status|logs|run`, `testing test ...`, `testing build ...`, and `testing job files|upload|download` forms are deprecated aliases that still execute but warn when used: `create` maps to `job create`, `update` to `job files upload` (file operations, not `job update`), `status`, `build list`, and `build latest` to `job runs list`, `build get` to `job runs get`, and `build search|logs|abort` to `job runs search|logs|abort`.
|
|
52
52
|
|
|
Binary file
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Flags } from '@oclif/core';
|
|
2
|
-
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import { testingBrowserCommonFlags, testingBrowserOptionalJobArg } from '../../../lib/testing-browser-command.js';
|
|
4
|
-
import { getTestingLiveReports } from '../../../lib/testing-browser-operations.js';
|
|
5
|
-
export default class TestingBrowserReports extends AgentiaCommand {
|
|
6
|
-
static args = testingBrowserOptionalJobArg;
|
|
7
|
-
static deprecateAliases = true;
|
|
8
|
-
static description = 'List or save report artifacts from an active CRT browser session';
|
|
9
|
-
static examples = [
|
|
10
|
-
'<%= config.bin %> <%= command.id %> --project <project-id>',
|
|
11
|
-
'<%= config.bin %> <%= command.id %> --project <project-id> --output-dir ./reports',
|
|
12
|
-
];
|
|
13
|
-
static flags = {
|
|
14
|
-
...testingBrowserCommonFlags,
|
|
15
|
-
'output-dir': Flags.string({ description: 'Directory for log.html, report.html, and output.xml.' }),
|
|
16
|
-
};
|
|
17
|
-
static hiddenAliases = ['testing:live:reports'];
|
|
18
|
-
async run() {
|
|
19
|
-
const { args, flags } = await this.parse(TestingBrowserReports);
|
|
20
|
-
const result = await this.withSpinner('Reading CRT browser reports', () => getTestingLiveReports({
|
|
21
|
-
jobId: args['job-id'],
|
|
22
|
-
outputDir: flags['output-dir'],
|
|
23
|
-
projectId: flags.project,
|
|
24
|
-
sessionId: flags['session-id'],
|
|
25
|
-
}));
|
|
26
|
-
this.display(() => {
|
|
27
|
-
for (const file of result.files)
|
|
28
|
-
this.log(`${file.name}: ${file.bytes} bytes${file.path === undefined ? '' : ` -> ${file.path}`}`);
|
|
29
|
-
});
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=reports.js.map
|