@automatify-au/cli 0.1.10 → 0.1.12

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.
Files changed (3) hide show
  1. package/README.md +155 -1
  2. package/dist/automatify.cjs +2365 -275
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -120,6 +120,12 @@ All TestOps commands are invoked as `automatify testops <command>`:
120
120
  - `doctor`
121
121
  - `automatify testops doctor check`
122
122
  - `automatify testops doctor check --json`
123
+ - `allure`
124
+ - `automatify allure doctor`
125
+ - `automatify allure doctor --json`
126
+ - `automatify allure doctor --issue-key ABC-123`
127
+ - `automatify allure open ./allure-report.zip`
128
+ - `automatify allure open ./allure-report.zip --no-open --port 8080`
123
129
 
124
130
  ### Advanced browse commands
125
131
 
@@ -135,6 +141,11 @@ All TestOps commands are invoked as `automatify testops <command>`:
135
141
 
136
142
  ### Setup, ingestion, and CI commands
137
143
 
144
+ - `setup`
145
+ - `automatify testops setup plan ... > testops-setup-plan.json`
146
+ - `automatify testops setup apply --plan testops-setup-plan.json --dry-run`
147
+ - `automatify testops setup apply --plan testops-setup-plan.json --approve all --confirm ...`
148
+ - `automatify testops setup doctor --plan testops-setup-plan.json ...`
138
149
  - `ingest`
139
150
  - `automatify testops ingest feature --file <path>` or `--stdin`
140
151
  - `run`
@@ -143,10 +154,115 @@ All TestOps commands are invoked as `automatify testops <command>`:
143
154
  - `automatify testops allure upload ABC-123 ./allure-report.zip --dry-run`
144
155
  - `automatify testops allure upload ABC-123 ./allure-report.zip`
145
156
  - `automatify testops allure download ABC-123 --output-dir ./downloads`
157
+ - `automatify testops allure open ./allure-report.zip`
146
158
  - `auto`
147
159
  - `automatify testops auto --dry-run`
148
160
  - `automatify testops auto`
149
161
 
162
+ ## Agent-friendly provider setup
163
+
164
+ `automatify testops setup` provides a GitHub-first, provider-bounded onboarding flow. The CLI remains a thin Forge client: Jira profile reads/writes/default selection use the existing `listScenarioAutomationProfiles`, `upsertScenarioAutomationProfile`, and `setScenarioAutomationDefaultProfile` contracts. Forge continues to own profile validation, tier limits, provider-secret storage, and default-profile rules.
165
+
166
+ ### 1. Generate a deterministic plan
167
+
168
+ Run this from the repository that contains the approved workflow source:
169
+
170
+ ```bash
171
+ automatify testops setup plan \
172
+ --provider github-actions \
173
+ --project-key DEV \
174
+ --owner Automatify-Pty-Ltd \
175
+ --repo customer-tests \
176
+ --ref main \
177
+ --workflow-id scenario-dispatch.yml \
178
+ --workflow-source .github/workflows/scenario-dispatch.yml \
179
+ --workflow-path .github/workflows/scenario-dispatch.yml \
180
+ --profile-label "Customer GitHub Actions" \
181
+ --set-default \
182
+ > testops-setup-plan.json
183
+ ```
184
+
185
+ The command itself writes nothing: it emits one versioned JSON plan to stdout, and the shell redirection above saves it. The plan contains the workflow source path and SHA-256 digest, not workflow contents or secret values. The source must declare `workflow_dispatch` and reference the selected callback secret names. Given the same explicit inputs and unchanged workflow source, the plan and `planId` are deterministic.
186
+
187
+ The GitHub plan covers:
188
+
189
+ - local workflow destination and approved source hash;
190
+ - repository, ref, workflow id, and Jira profile fields;
191
+ - required `TESTOPS_FORGE_ENDPOINT` and `TESTOPS_FORGE_AUTH_TOKEN` repository secret names;
192
+ - profile create/update, optional project-default selection, read-only smoke checks, and rollback guidance;
193
+ - explicit exclusion of account creation, credentials, commits, pull requests, and workflow runs.
194
+
195
+ ### 2. Validate with a mutation-free dry-run
196
+
197
+ ```bash
198
+ automatify testops setup apply \
199
+ --plan testops-setup-plan.json \
200
+ --repo-root /path/to/customer-tests \
201
+ --dry-run
202
+ ```
203
+
204
+ Dry-run previews all plan actions when no `--approve` is supplied. It may call read contracts to describe current state, but it does not write files, Jira profiles/defaults, GitHub secrets, commits, PRs, or workflow runs. Output is stable JSON.
205
+
206
+ ### 3. Apply only explicitly approved scopes
207
+
208
+ Secrets must come from stdin or safe environment references. Secret values are rejected as ordinary command options and are not printed in JSON, logs, diagnostics, snapshots, or child-process arguments.
209
+
210
+ ```bash
211
+ export TESTOPS_GITHUB_PROVIDER_TOKEN="<github-app-installation-or-fine-grained-token>"
212
+ export TESTOPS_GITHUB_ADMIN_TOKEN="<least-privilege-token-allowed-to-manage-actions-secrets>"
213
+ export TESTOPS_FORGE_ENDPOINT="<forge-webtrigger-url>"
214
+ export TESTOPS_FORGE_AUTH_TOKEN="<one-time-project-cli-key>"
215
+
216
+ automatify testops setup apply \
217
+ --plan testops-setup-plan.json \
218
+ --repo-root /path/to/customer-tests \
219
+ --approve all \
220
+ --confirm \
221
+ --secret-ref githubProviderToken=env:TESTOPS_GITHUB_PROVIDER_TOKEN \
222
+ --secret-ref githubAdminToken=env:TESTOPS_GITHUB_ADMIN_TOKEN \
223
+ --secret-ref callbackEndpoint=env:TESTOPS_FORGE_ENDPOINT \
224
+ --secret-ref callbackAuthToken=env:TESTOPS_FORGE_AUTH_TOKEN
225
+ ```
226
+
227
+ Available scopes are `workflow-file`, `github-secrets`, `jira-profile`, and `project-default` when the plan includes the default action. Real mutations require both `--confirm` and one or more `--approve` flags; use repeated flags for a partial apply. `--approve all` approves every action in the content-addressed plan.
228
+
229
+ The `github-secrets` scope uses the installed `gh` CLI, sends each repository secret through stdin, and passes the GitHub admin credential through `GH_TOKEN` in the child environment. Existing secret names are skipped because GitHub does not expose their values. Use `--rotate-secrets` to explicitly overwrite them. An existing matching Jira profile is also skipped; use `--rotate-provider-token` to explicitly replace its stored provider credential.
230
+
231
+ For JSON secret input instead of references, pipe one object with supported keys to `--secrets-stdin`:
232
+
233
+ ```bash
234
+ node -e 'process.stdout.write(JSON.stringify({githubProviderToken:process.env.TESTOPS_GITHUB_PROVIDER_TOKEN,githubAdminToken:process.env.TESTOPS_GITHUB_ADMIN_TOKEN,callbackEndpoint:process.env.TESTOPS_FORGE_ENDPOINT,callbackAuthToken:process.env.TESTOPS_FORGE_AUTH_TOKEN}))' \
235
+ | automatify testops setup apply \
236
+ --plan testops-setup-plan.json \
237
+ --repo-root /path/to/customer-tests \
238
+ --approve all \
239
+ --confirm \
240
+ --secrets-stdin
241
+ ```
242
+
243
+ Prefer a GitHub App installation token. When using fine-grained tokens, grant only the selected repository access plus the minimum Actions/Contents/Secrets permissions needed for the approved scopes. The command never creates or commits the workflow remotely; review and commit the local workflow through the repository's normal change-control process.
244
+
245
+ ### 4. Run read-only provider doctor/smoke validation
246
+
247
+ ```bash
248
+ automatify testops setup doctor \
249
+ --plan testops-setup-plan.json \
250
+ --repo-root /path/to/customer-tests \
251
+ --secret-ref githubProviderToken=env:TESTOPS_GITHUB_PROVIDER_TOKEN \
252
+ --secret-ref githubAdminToken=env:TESTOPS_GITHUB_ADMIN_TOKEN
253
+ ```
254
+
255
+ Doctor verifies the local workflow hash, GitHub workflow metadata/content at the configured ref, required repository secret names, Jira profile fields/provider-secret metadata, and optional project default. It never dispatches a workflow. GitHub secret values cannot be read, so doctor verifies names only and reports that limitation. If the workflow has not been committed to the repository default branch, doctor reports what remains unverifiable without creating a commit or run.
256
+
257
+ Current authentication boundary:
258
+
259
+ - `TESTOPS_FORGE_AUTH_TOKEN` is still a project-scoped, project-admin-created CLI key from Jira `Operations -> CLI access`.
260
+ - The key authorizes the current Forge webtrigger transport for that project; command groups are not separate security scopes.
261
+ - Setup does not turn this into an all-user auth model. Customer-admin packaging and any future user-level authentication remain separate work.
262
+ - The same callback key may be stored as a GitHub Actions repository secret only under the explicit `github-secrets` apply scope.
263
+
264
+ Azure DevOps follow-up is deliberately outside this stage. The next adapter should reuse the same plan/apply/doctor orchestration and mutation scopes, map Azure organization/project/pipeline/ref fields into the existing `azureDevops` Forge profile config, manage callback pipeline variables through stdin/safe references, inspect pipeline metadata without queueing a run, and preserve the same confirmation/idempotency/redaction rules.
265
+
150
266
  ## Allure Evidence for Jira
151
267
 
152
268
  Purpose:
@@ -234,6 +350,43 @@ Download dry run / JSON:
234
350
  automatify testops allure download ABC-123 --dry-run --json
235
351
  ```
236
352
 
353
+ Allure preflight:
354
+ ```bash
355
+ automatify allure doctor
356
+ ```
357
+
358
+ `automatify allure doctor` checks:
359
+ - Jira site/email/API token resolution for direct Allure upload/download.
360
+ - optional Jira issue access only when `--issue-key` is passed.
361
+ - `unzip` availability for manual local ZIP inspection.
362
+ - Java availability as a warning-only optional check for future raw `allure-results` workflows.
363
+ - Allure CLI availability as a warning-only optional check.
364
+
365
+ Generated Allure HTML ZIP upload/download/open does not require Java or the Allure CLI.
366
+
367
+ Optional live Jira issue check:
368
+ ```bash
369
+ automatify allure doctor --issue-key ABC-123
370
+ ```
371
+
372
+ ### Open a generated Allure HTML report locally
373
+
374
+ ```bash
375
+ automatify allure open ./allure-report.zip
376
+ ```
377
+
378
+ `automatify allure open <zipPath>` and `automatify testops allure open <zipPath>` extract the report into a temporary directory, start a Java-free Node static HTTP server on an ephemeral port, and open the URL in your default browser. This is useful after downloading an Allure ZIP from Jira.
379
+
380
+ Options:
381
+ - `--port <n>` fixed port (default `0` for an OS-assigned free port).
382
+ - `--host <h>` bind host (default `127.0.0.1`).
383
+ - `--extract-to <dir>` extract into a chosen directory; the directory is preserved on shutdown.
384
+ - `--keep` preserves the auto-created temp extract directory on shutdown.
385
+ - `--no-open` skips browser launch for CI/headless checks.
386
+ - `--json`, `--dry-run`, `--verbose`.
387
+
388
+ The server stays alive until Ctrl+C / `SIGTERM`. URL path traversal and malformed paths are rejected.
389
+
237
390
  ### Optional gated maintenance commands
238
391
 
239
392
  - `sync`
@@ -387,6 +540,7 @@ automatify testops bdd features export --project-key DEV --output-dir ./artifact
387
540
  automatify testops runs show --project-key DEV --id <RUN_ID> --json
388
541
  automatify testops config validate
389
542
  automatify testops doctor check --json
543
+ automatify allure doctor --json
390
544
  ```
391
545
 
392
546
  Advanced browse examples:
@@ -506,7 +660,7 @@ Recommended CI sequence:
506
660
  - `0` success
507
661
  - `1` internal/runtime error
508
662
  - `2` usage/argument errors
509
- - `3` local validation errors
663
+ - `3` local/plan validation errors, doctor failures, or post-apply smoke validation failures
510
664
  - `4` Forge service errors (`ok: false` payload)
511
665
  - `5` Forge transport/connectivity errors
512
666