@sequenceholdings/studio-cli 0.4.6 → 0.4.7
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/README.md +97 -19
- package/dist/app/readme.js +6 -2
- package/dist/command-contract.d.ts +3 -3
- package/dist/command-contract.js +1 -1
- package/dist/command-help.d.ts +1 -1
- package/dist/command-help.js +5 -3
- package/dist/main.js +1 -1
- package/dist/repos/ci-config.d.ts +5 -0
- package/dist/repos/ci-config.js +29 -0
- package/dist/repos/ci-init.d.ts +4 -0
- package/dist/repos/ci-init.js +35 -0
- package/dist/repos/ci-status.d.ts +9 -0
- package/dist/repos/ci-status.js +49 -0
- package/dist/repos/commands.d.ts +6 -9
- package/dist/repos/commands.js +112 -77
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1350,6 +1350,36 @@ manifest declarations. Never put a secret in `build.public_env` or `NEXT_PUBLIC_
|
|
|
1350
1350
|
Local execution runs as your OS user; Atlas does not sandbox your laptop's
|
|
1351
1351
|
filesystem or arbitrary outbound connections.
|
|
1352
1352
|
|
|
1353
|
+
Browser ORM admission controls are planned for Studio CLI 0.4.7 and Artifact
|
|
1354
|
+
Studio 0.6.7, together with matching platform support. Confirm package
|
|
1355
|
+
publication and environment rollout before using them; this remains part of
|
|
1356
|
+
the internal Next.js pilot. In a schema-v2 manifest, browser
|
|
1357
|
+
`capabilities.data.operations` optionally lists up to 256 exact
|
|
1358
|
+
`namespace/ops/Operation` references. Omission retains table-based admission;
|
|
1359
|
+
an explicit empty list denies all browser ORM operations. Browser `data.read`
|
|
1360
|
+
and `data.write` declarations still bound table and mutation reach.
|
|
1361
|
+
|
|
1362
|
+
Only registered persisted operations qualify; autogenerated `DatasetPreview_*`
|
|
1363
|
+
hashes remain excluded even when a registered operation has the same name.
|
|
1364
|
+
The allowlist selects names, retaining active and previous operation-set
|
|
1365
|
+
fallback. A security-tightened replacement query needs a fresh name with the
|
|
1366
|
+
old name removed from the allowlist, or the older retained hash may still run.
|
|
1367
|
+
|
|
1368
|
+
`capabilities.data.required_capabilities` optionally maps source namespace names
|
|
1369
|
+
to nonempty lists of artifact capability pins. Each pin must be declared in
|
|
1370
|
+
`capabilities.uses` or, for a local bare key, defined under
|
|
1371
|
+
`capabilities.roles.capabilities`. All listed pins are required; accepted forms
|
|
1372
|
+
are `<key>`, `org/<key>`, and `app/<application-id>/<key>`. Namespaces in either
|
|
1373
|
+
control must be reached by
|
|
1374
|
+
browser `data.read` or `data.write`. Keep source namespace names when preview
|
|
1375
|
+
bindings map them to other resources. Atlas checks these requirements against
|
|
1376
|
+
the authenticated user's current artifact claims before delegation, alongside
|
|
1377
|
+
the existing namespace grants and row/write policies. Manifest declarations
|
|
1378
|
+
do not grant access, and browser-provided claims cannot satisfy these checks.
|
|
1379
|
+
These controls apply to direct browser ORM calls. Server SDK, external ingress,
|
|
1380
|
+
and ORM work inside Managed Functions or general API calls retain their own
|
|
1381
|
+
permission contracts. The `createArtifactOrmExecutor` API is unchanged.
|
|
1382
|
+
|
|
1353
1383
|
For hosted applications, bind an existing managed secret by its name in the
|
|
1354
1384
|
target deployment's organization and pin the exact numeric version:
|
|
1355
1385
|
|
|
@@ -1537,33 +1567,70 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
|
|
|
1537
1567
|
| `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force] [--full] [--transport auto\|git\|json]` | smart-HTTP `git clone --depth 1` when `ATLAS_GIT_PAT` is set (`--full` fetches history; a commit SHA stays full). `--url`/`--id` need no seqapi. Otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
|
|
1538
1568
|
| `seq-studio repos pull <ns>/<name> -e <env> [--ref <r>] [--out <dir>] [--force]` | always materialize via JSON API (no `.git` dir); refuses a non-empty destination unless `--force` |
|
|
1539
1569
|
| `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
|
|
1540
|
-
| `seq-studio repos ci
|
|
1541
|
-
| `seq-studio repos ci
|
|
1542
|
-
| `seq-studio repos ci
|
|
1570
|
+
| `seq-studio repos ci init [--dir <repository>]` | create `.seq/pipeline.yml` with native defaults; offline, preserves existing configuration |
|
|
1571
|
+
| `seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json]` | inspect the server's discovered pipeline, exact plan and recent runs; JSON retains the complete status response |
|
|
1572
|
+
| `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview pipeline discovery or legacy checks at a ref |
|
|
1573
|
+
| `seq-studio repos ci require <ns>/<name> --check <name> -e <env>` | disabled legacy required-check control; use native pipeline discovery |
|
|
1574
|
+
| `seq-studio repos ci import <ns>/<name> -e <env> [--ref <r>]` | disabled legacy required-check control; use native pipeline discovery |
|
|
1543
1575
|
|
|
1544
1576
|
`show` prints the smart-HTTP clone URL (`…/repos/<id>/git`). Basic auth:
|
|
1545
1577
|
any username, PAT as password. Prefer `repos clone` over hand-rolling the
|
|
1546
1578
|
tree API.
|
|
1547
1579
|
|
|
1548
|
-
|
|
1549
|
-
`
|
|
1550
|
-
|
|
1580
|
+
To enable native repository checks, run this from the checkout containing your
|
|
1581
|
+
`sequence.app.yml` or supported standalone resource manifest:
|
|
1582
|
+
|
|
1583
|
+
```bash
|
|
1584
|
+
seq-studio repos ci init
|
|
1585
|
+
git add .seq/pipeline.yml
|
|
1586
|
+
git commit -m "Enable repository CI"
|
|
1587
|
+
git push
|
|
1588
|
+
# Open a pull request using Atlas or seq-studio repos pulls create, then inspect it:
|
|
1589
|
+
seq-studio repos ci show artifacts/my-app -e staging --pr 4
|
|
1590
|
+
```
|
|
1551
1591
|
|
|
1552
|
-
|
|
1592
|
+
The generated file selects the platform's native lint, type-check, test and build
|
|
1593
|
+
defaults for the repository inventory:
|
|
1553
1594
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1595
|
+
```yaml
|
|
1596
|
+
schema_version: 2
|
|
1597
|
+
targets: []
|
|
1598
|
+
```
|
|
1558
1599
|
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1600
|
+
Atlas discovers the file on the pull request's head or base and runs checks on
|
|
1601
|
+
PR creation and updates to its head or base. Repository CI and deployment jobs
|
|
1602
|
+
use Buildkite, including for local destinations. Next.js resources may explicitly
|
|
1603
|
+
select Modal for compilation. Each run uses the platform
|
|
1604
|
+
image defaults; no image digest or manual branch-policy setup is
|
|
1605
|
+
needed from the repository author. This is a PR workflow; arbitrary GitHub
|
|
1606
|
+
Actions `on:` triggers and standalone push runs are not supported. Missing
|
|
1607
|
+
platform CI setup appears as unavailable with a reason; it is not a passing or
|
|
1608
|
+
absent pipeline. `ci show --pr` exits 1 for unavailable setup or planning errors.
|
|
1609
|
+
|
|
1610
|
+
Discovery does not change the repository's review or required-check policy.
|
|
1611
|
+
The file enables checks only. Deployment still requires separately authorized
|
|
1612
|
+
resource bindings and current native permissions. Platform administrators retain
|
|
1613
|
+
advanced branch policies for those bindings and approved execution overrides.
|
|
1614
|
+
An existing explicit policy takes precedence over automatic defaults.
|
|
1615
|
+
|
|
1616
|
+
Local development requires an explicitly configured public HTTPS tunnel to Atlas
|
|
1617
|
+
for Buildkite worker requests and signed completion webhooks. Keep the tunnel
|
|
1618
|
+
running; a missing runner or unreachable callback never falls back to laptop
|
|
1619
|
+
execution. Hosted environments use their own HTTPS server URL. Repository
|
|
1620
|
+
Settings → CI shows setup guidance and configured callback URLs; those checks
|
|
1621
|
+
do not prove a worker or webhook can reach the server.
|
|
1622
|
+
|
|
1623
|
+
`ci init` refuses to replace an existing `.seq/pipeline.yml` or create a second
|
|
1624
|
+
file beside legacy `.seq/ci.json`. Migrate a legacy JSON configuration and remove
|
|
1625
|
+
the old file in one commit. Both files together, invalid syntax and duplicate
|
|
1626
|
+
YAML keys fail planning. Empty native `targets` means use discovered inventory
|
|
1627
|
+
defaults; it does not disable required checks.
|
|
1628
|
+
|
|
1629
|
+
Without `--pr`, `ci show` previews the selected ref. For native schema version 2
|
|
1630
|
+
it reports discovery and points to the authoritative PR plan. Legacy `checks`
|
|
1631
|
+
declarations and package-script discovery remain preview-only: they post neutral
|
|
1632
|
+
check-runs and cannot satisfy required merge gates. The legacy `require` and
|
|
1633
|
+
`import` commands remain disabled.
|
|
1567
1634
|
|
|
1568
1635
|
## Pipeline commands
|
|
1569
1636
|
|
|
@@ -1962,6 +2029,17 @@ Compiled Databricks assets use stable, environment-qualified identities: display
|
|
|
1962
2029
|
|
|
1963
2030
|
Changing a DAB resource key is a delete-and-create operation. Treat these identities as the existing-resource contract when planning, adopting, unbinding, or inspecting a Managed Pipeline; Unity Catalog catalogs, volumes, tables, and synced tables are not renamed by this convention.
|
|
1964
2031
|
|
|
2032
|
+
To preserve an existing service-principal owner, a stage can opt into
|
|
2033
|
+
[`retained_resource_owners`](../pipeline-spec/README.md#retain-an-existing-native-resource-owner).
|
|
2034
|
+
Pin the exact target, compiled resource key, workspace, native ID and principal.
|
|
2035
|
+
Planning verifies the existing binding, sole direct owner and expected manager
|
|
2036
|
+
ACL; each deployment pass rechecks live ownership and applies only the checked
|
|
2037
|
+
in-place Databricks plan. This does not transfer ownership or authorize resource
|
|
2038
|
+
creation/replacement. Missing evidence and identity/permission drift remain
|
|
2039
|
+
non-overridable blockers. The supporting pipeline-spec and Atlas/worker releases
|
|
2040
|
+
must be installed first; older clients reject the new YAML field. Pipelines
|
|
2041
|
+
without these declarations keep their existing behavior.
|
|
2042
|
+
|
|
1965
2043
|
Deletion and recreation remain blocked by default. For an intentional,
|
|
1966
2044
|
reviewed migration, repeat `--allow-destructive <resource-key>` for every
|
|
1967
2045
|
eligible finding printed by the plan. Only authenticated `@seqholdings.com`
|
package/dist/app/readme.js
CHANGED
|
@@ -115,8 +115,12 @@ Its Next.js artifact uses Node.js 24 and a separate install root: run \`pnpm ins
|
|
|
115
115
|
inside \`artifact/\` and commit \`artifact/pnpm-lock.yaml\` as well. Keep its generated
|
|
116
116
|
\`lint\`, \`type-check\`, \`test\` and \`build\` scripts. Repository CI runs these checks
|
|
117
117
|
and an SSR/API smoke test on Buildkite before packaging the validated standalone
|
|
118
|
-
output for the managed runtime.
|
|
119
|
-
|
|
118
|
+
output for the managed runtime. Run \`seq-studio repos ci init\`, commit the generated
|
|
119
|
+
\`.seq/pipeline.yml\`, and open or update a pull request to run checks with the
|
|
120
|
+
platform's managed defaults. \`sequence.app.yml\` supplies the resource inventory;
|
|
121
|
+
the pipeline needs no image digest or manual branch policy. Inspect the plan with
|
|
122
|
+
\`seq-studio repos ci show <namespace>/<repo> -e <environment> --pr <number>\`.
|
|
123
|
+
Deployment still needs authorized resource bindings and native permissions.
|
|
120
124
|
Build-time values belong in \`build.public_env\` and must use \`NEXT_PUBLIC_*\` names.
|
|
121
125
|
Server secrets and resource credentials are attached only at runtime.
|
|
122
126
|
|
|
@@ -49,10 +49,10 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
49
49
|
readonly subcommands: readonly ["create", "set", "list", "attach", "detach", "apply"];
|
|
50
50
|
}, {
|
|
51
51
|
readonly name: "repos";
|
|
52
|
-
readonly description: "Manage
|
|
52
|
+
readonly description: "Manage repositories and native CI; ci init is offline";
|
|
53
53
|
readonly lifecycle: "stable";
|
|
54
|
-
readonly access: "
|
|
55
|
-
readonly subcommands: readonly ["list", "namespaces", "show", "create", "clone", "pull", "pulls", "delete"];
|
|
54
|
+
readonly access: "mixed";
|
|
55
|
+
readonly subcommands: readonly ["list", "namespaces", "show", "create", "clone", "pull", "pulls", "delete", "ci"];
|
|
56
56
|
}, {
|
|
57
57
|
readonly name: "pipeline";
|
|
58
58
|
readonly description: "Discover and operate Data Pipelines";
|
package/dist/command-contract.js
CHANGED
|
@@ -8,7 +8,7 @@ export const COMMAND_CONTRACT = [
|
|
|
8
8
|
{ name: 'functions', description: 'Build and operate Managed Functions', lifecycle: 'stable', access: 'authenticated', subcommands: ['init', 'build', 'deploy', 'list', 'show', 'limits', 'invoke', 'logs', 'promote', 'rollback', 'delete'] },
|
|
9
9
|
{ name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'plan', 'apply', 'list', 'show'] },
|
|
10
10
|
{ name: 'secrets', description: 'Manage organization-owned secrets', lifecycle: 'stable', access: 'authenticated', subcommands: ['create', 'set', 'list', 'attach', 'detach', 'apply'] },
|
|
11
|
-
{ name: 'repos', description: 'Manage
|
|
11
|
+
{ name: 'repos', description: 'Manage repositories and native CI; ci init is offline', lifecycle: 'stable', access: 'mixed', subcommands: ['list', 'namespaces', 'show', 'create', 'clone', 'pull', 'pulls', 'delete', 'ci'] },
|
|
12
12
|
{ name: 'pipeline', description: 'Discover and operate Data Pipelines', lifecycle: 'preview', access: 'staff', subcommands: ['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'run-now', 'promote', 'rollback'] },
|
|
13
13
|
{ name: 'auth', description: 'Manage Git Service personal access tokens', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'pat'] },
|
|
14
14
|
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'diff', 'migrate-from-yaml', 'import'] },
|
package/dist/command-help.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-stud
|
|
|
3
3
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n";
|
|
4
4
|
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
5
5
|
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a function shell without deploying\n seq-studio functions deploy -e <env> [-m msg] preflight deployed capabilities, then upload and deploy\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP and require a repo:read git\n PAT in ATLAS_GIT_PAT (`seq-studio auth pat create --scopes repo:read`, or\n Atlas \u2192 Settings \u2192 Tokens). Headless M2M builds use JSON materialize and\n accept only platform-managed --repo sources. Interactive builds also need\n --env + seq-studio login to resolve the repo and deploy.\n";
|
|
6
|
-
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview
|
|
6
|
+
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone prefers real git clone (PAT via askpass \u2014 never written into the remote\n URL). --transport auto (default) uses Git when ATLAS_GIT_PAT is set and JSON\n materialization otherwise; --transport git requires a repo:read PAT; --transport\n json ignores ATLAS_GIT_PAT and uses the signed-in Atlas identity (<ns>/<name>\n only; no .git directory). Authentication failures explain this retry path.\n JSON materialization requires repo read access and prints how to create a PAT.\n PAT without Auth0 login: use --id from Repositories \u2192 Clone\n (or --url with the environment's canonical HTTPS origin).\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: ATLAS_GIT_PAT (from Atlas Settings \u2192 Tokens)\n";
|
|
7
7
|
export declare function staticHelp({ namespace, sub }: {
|
|
8
8
|
namespace: string;
|
|
9
9
|
sub?: string;
|
package/dist/command-help.js
CHANGED
|
@@ -118,9 +118,11 @@ export const REPOS_USAGE = `usage:
|
|
|
118
118
|
materialize the tree at a ref (JSON API)
|
|
119
119
|
seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)
|
|
120
120
|
seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
|
|
121
|
-
seq-studio repos ci
|
|
122
|
-
seq-studio repos ci
|
|
123
|
-
seq-studio repos ci
|
|
121
|
+
seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults
|
|
122
|
+
seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs
|
|
123
|
+
seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks
|
|
124
|
+
seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control
|
|
125
|
+
seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control
|
|
124
126
|
|
|
125
127
|
Flags: -e/--env <env> (required; see: seq-studio envs list)
|
|
126
128
|
|
package/dist/main.js
CHANGED
|
@@ -36,7 +36,7 @@ const TOP_LEVEL_USAGE = `usage:
|
|
|
36
36
|
seq-studio storage <sub> [args] init | validate | apply | list | show | mkdir | upload | download | access | trash | restore | purge | operations | abort | delete
|
|
37
37
|
seq-studio agents <sub> [args] init | validate | plan | apply | list | show | voice (internal)
|
|
38
38
|
seq-studio secrets <sub> [args] create | set | list | attach | detach | apply
|
|
39
|
-
seq-studio repos <sub> [args] list | namespaces | show | create | clone | pull | pulls | delete
|
|
39
|
+
seq-studio repos <sub> [args] list | namespaces | show | create | clone | pull | pulls | delete | ci
|
|
40
40
|
seq-studio pipeline <sub> [args] list | assets | search | describe | schema | sample | query | init | validate | repin-orm | codegen | plan | adopt | unbind | deploy | status | migrate | promote | rollback | run-now
|
|
41
41
|
seq-studio auth <sub> [args] whoami | pat create | pat list | pat revoke
|
|
42
42
|
seq-studio orm <sub> [args] init | generate | validate | plan | apply | execute | diff | migrate-from-yaml | import
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Keep the bounded data-only parser aligned with Atlas git-service/ci-config.ts.
|
|
2
|
+
import { JSON_SCHEMA, load } from 'js-yaml';
|
|
3
|
+
/** Data-only configuration: duplicate keys fail and aliases cannot expand without bound. */
|
|
4
|
+
export function parseCiConfigText({ text, path }) {
|
|
5
|
+
if (Buffer.byteLength(text, 'utf8') > 1024 * 1024)
|
|
6
|
+
throw new Error('CI configuration exceeds the 1 MiB limit');
|
|
7
|
+
const value = path.endsWith('.json') ? JSON.parse(text) : load(text, { schema: JSON_SCHEMA });
|
|
8
|
+
const seen = new Set();
|
|
9
|
+
const active = new Set();
|
|
10
|
+
let aliases = 0;
|
|
11
|
+
let nodes = 0;
|
|
12
|
+
const visit = (entry, depth) => {
|
|
13
|
+
if (++nodes > 10000 || depth > 64)
|
|
14
|
+
throw new Error('CI configuration exceeds the expanded node or depth limit');
|
|
15
|
+
if (entry === null || typeof entry !== 'object')
|
|
16
|
+
return;
|
|
17
|
+
if (active.has(entry))
|
|
18
|
+
throw new Error('Recursive YAML aliases are not supported in CI configuration');
|
|
19
|
+
if (seen.has(entry) && ++aliases > 100)
|
|
20
|
+
throw new Error('CI configuration exceeds the YAML alias limit');
|
|
21
|
+
seen.add(entry);
|
|
22
|
+
active.add(entry);
|
|
23
|
+
for (const child of Object.values(entry))
|
|
24
|
+
visit(child, depth + 1);
|
|
25
|
+
active.delete(entry);
|
|
26
|
+
};
|
|
27
|
+
visit(value, 0);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { lstat, mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
const defaultPipeline = `# Native checks use platform-managed tools and the repository's resource manifests.
|
|
4
|
+
# Add target overrides here when a resource needs different commands or inputs.
|
|
5
|
+
schema_version: 2
|
|
6
|
+
targets: []
|
|
7
|
+
`;
|
|
8
|
+
/** Create the opt-in file without replacing authored configuration or following .seq symlinks. */
|
|
9
|
+
export async function initializeRepositoryPipeline({ directory }) {
|
|
10
|
+
const root = resolve(directory);
|
|
11
|
+
if (!(await lstat(root)).isDirectory())
|
|
12
|
+
throw new Error('CI initialization requires an existing repository directory');
|
|
13
|
+
const configurationDirectory = join(root, '.seq');
|
|
14
|
+
await mkdir(configurationDirectory, { recursive: true });
|
|
15
|
+
if (!(await lstat(configurationDirectory)).isDirectory())
|
|
16
|
+
throw new Error('CI initialization requires .seq to be a regular directory');
|
|
17
|
+
try {
|
|
18
|
+
await lstat(join(configurationDirectory, 'ci.json'));
|
|
19
|
+
throw new Error('Legacy .seq/ci.json already exists; migrate it to .seq/pipeline.yml instead of creating both files');
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
if (!(error instanceof Error && 'code' in error && error.code === 'ENOENT'))
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
const filename = join(configurationDirectory, 'pipeline.yml');
|
|
26
|
+
try {
|
|
27
|
+
await writeFile(filename, defaultPipeline, { flag: 'wx' });
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error instanceof Error && 'code' in error && error.code === 'EEXIST')
|
|
31
|
+
throw new Error('.seq/pipeline.yml already exists; edit the existing pipeline');
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
return filename;
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CommandContext } from '../functions/commands.js';
|
|
2
|
+
/** Read the authoritative server plan; the CLI never infers execution or deployment authority. */
|
|
3
|
+
export declare function showRepositoryPrCi({ ctx, repoId, repoPath, number, json }: {
|
|
4
|
+
ctx: CommandContext;
|
|
5
|
+
repoId: string;
|
|
6
|
+
repoPath: string;
|
|
7
|
+
number: number;
|
|
8
|
+
json: boolean;
|
|
9
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getJson } from '../atlas-client.js';
|
|
3
|
+
import { clientOptions } from '../functions/commands.js';
|
|
4
|
+
const actionSchema = z.object({ name: z.string(), phase: z.string(), cwd: z.string(), command: z.array(z.string()) });
|
|
5
|
+
const statusSchema = z.object({
|
|
6
|
+
discovery: z.object({ source: z.enum(['pipeline', 'policy', 'none']), state: z.enum(['ready', 'not-configured', 'unavailable']), message: z.string().optional() }).optional(),
|
|
7
|
+
planningIssue: z.object({ code: z.string(), message: z.string() }).nullable(),
|
|
8
|
+
plan: z.object({
|
|
9
|
+
planHash: z.string(), headSha: z.string(),
|
|
10
|
+
targets: z.array(z.object({ key: z.string(), kind: z.string(), root: z.string(), affected: z.boolean(), checks: z.array(actionSchema), build: actionSchema.nullable() })),
|
|
11
|
+
findings: z.array(z.object({ severity: z.string(), code: z.string(), message: z.string() })),
|
|
12
|
+
}).nullable(),
|
|
13
|
+
currentRunId: z.string().nullable(),
|
|
14
|
+
runs: z.array(z.object({ id: z.string(), state: z.string(), error: z.string().nullable().optional() })),
|
|
15
|
+
});
|
|
16
|
+
function printPlan({ plan }) {
|
|
17
|
+
console.log(` Head: ${plan.headSha}; plan: ${plan.planHash}`);
|
|
18
|
+
for (const target of plan.targets) {
|
|
19
|
+
console.log(` ${target.key} (${target.kind}, ${target.root}): ${target.affected ? 'affected' : 'unchanged'}`);
|
|
20
|
+
for (const action of [...target.checks, ...(target.build ? [target.build] : [])])
|
|
21
|
+
console.log(` ${action.phase}: ${JSON.stringify(action.command)} (cwd ${action.cwd})`);
|
|
22
|
+
}
|
|
23
|
+
for (const finding of plan.findings)
|
|
24
|
+
console.log(` ${finding.severity} ${finding.code}: ${finding.message}`);
|
|
25
|
+
}
|
|
26
|
+
/** Read the authoritative server plan; the CLI never infers execution or deployment authority. */
|
|
27
|
+
export async function showRepositoryPrCi({ ctx, repoId, repoPath, number, json }) {
|
|
28
|
+
const response = await getJson({ ...clientOptions(ctx), path: `/api/git-service/repos/${repoId}/pulls/${number}/ci` });
|
|
29
|
+
const status = statusSchema.parse(response);
|
|
30
|
+
const blocked = status.discovery?.state === 'unavailable' || status.planningIssue !== null || status.plan?.findings.some((finding) => finding.severity === 'error');
|
|
31
|
+
if (json) {
|
|
32
|
+
console.log(JSON.stringify(response, null, 2));
|
|
33
|
+
return blocked ? 1 : 0;
|
|
34
|
+
}
|
|
35
|
+
console.log(`CI for ${repoPath} pull request #${number} on ${ctx.env.name}:`);
|
|
36
|
+
if (status.discovery)
|
|
37
|
+
console.log(` Discovery: ${status.discovery.state} (${status.discovery.source})${status.discovery.message ? ` — ${status.discovery.message}` : ''}`);
|
|
38
|
+
if (status.planningIssue)
|
|
39
|
+
console.log(` ${status.planningIssue.code}: ${status.planningIssue.message}`);
|
|
40
|
+
if (status.plan) {
|
|
41
|
+
printPlan({ plan: status.plan });
|
|
42
|
+
}
|
|
43
|
+
else if (!status.planningIssue && status.discovery?.state !== 'unavailable') {
|
|
44
|
+
console.log(' No native plan yet. Commit .seq/pipeline.yml with your resource manifests and open or update a pull request.');
|
|
45
|
+
}
|
|
46
|
+
for (const run of status.runs.slice(0, 5))
|
|
47
|
+
console.log(` ${run.id === status.currentRunId ? 'Current' : 'Previous'} run ${run.id}: ${run.state}${run.error ? ` — ${run.error}` : ''}`);
|
|
48
|
+
return blocked ? 1 : 0;
|
|
49
|
+
}
|
package/dist/repos/commands.d.ts
CHANGED
|
@@ -67,35 +67,32 @@ type DiscoveredCliCheck = {
|
|
|
67
67
|
name: string;
|
|
68
68
|
script?: string;
|
|
69
69
|
command?: string[];
|
|
70
|
-
source: 'autodiscover' | 'ci.json';
|
|
70
|
+
source: 'autodiscover' | 'ci.json' | 'pipeline.yml';
|
|
71
71
|
};
|
|
72
72
|
/**
|
|
73
73
|
* Pure discovery shared by `repos ci show` / `import`. Mirrors atlas
|
|
74
74
|
* `discoverCiChecks` / `parseCiJson` so CLI preview matches execution.
|
|
75
75
|
*/
|
|
76
|
-
export declare function discoverCliChecks({ ciJson, packageScripts, }: {
|
|
76
|
+
export declare function discoverCliChecks({ ciYaml, ciJson, packageScripts, }: {
|
|
77
|
+
ciYaml?: unknown;
|
|
77
78
|
ciJson?: unknown;
|
|
78
79
|
packageScripts?: Record<string, string>;
|
|
79
80
|
}): {
|
|
80
81
|
ok: true;
|
|
81
82
|
checks: DiscoveredCliCheck[];
|
|
83
|
+
native?: boolean;
|
|
82
84
|
} | {
|
|
83
85
|
ok: false;
|
|
84
86
|
error: string;
|
|
85
87
|
};
|
|
86
|
-
/**
|
|
87
|
-
* Load `.seq/ci.json` / `package.json` for CI preview.
|
|
88
|
-
*
|
|
89
|
-
* Matches the runner: only a true 404 means "file absent". Invalid JSON and
|
|
90
|
-
* non-404 API errors fail closed (no silent package.json fallback over a bad
|
|
91
|
-
* `.seq/ci.json`).
|
|
92
|
-
*/
|
|
88
|
+
/** Load YAML or legacy JSON; only a true 404 means configuration is absent. */
|
|
93
89
|
export declare function loadRemoteCiSources({ ctx, repoId, ref, }: {
|
|
94
90
|
ctx: CommandContext;
|
|
95
91
|
repoId: string;
|
|
96
92
|
ref: string;
|
|
97
93
|
}): Promise<{
|
|
98
94
|
ok: true;
|
|
95
|
+
ciYaml?: unknown;
|
|
99
96
|
ciJson?: unknown;
|
|
100
97
|
packageScripts?: Record<string, string>;
|
|
101
98
|
} | {
|
package/dist/repos/commands.js
CHANGED
|
@@ -18,6 +18,9 @@ import { homedir } from 'node:os';
|
|
|
18
18
|
import { resolve, sep } from 'node:path';
|
|
19
19
|
import { materializeRepo, resolveCommitSha, resolveRepo, } from '@sequenceholdings/artifact-studio/git-service-client';
|
|
20
20
|
import { z } from 'zod';
|
|
21
|
+
import { parseCiConfigText } from './ci-config.js';
|
|
22
|
+
import { initializeRepositoryPipeline } from './ci-init.js';
|
|
23
|
+
import { showRepositoryPrCi } from './ci-status.js';
|
|
21
24
|
import { AtlasApiError, deleteNoContent, getJson, getJsonOr404, postJson, } from '../atlas-client.js';
|
|
22
25
|
import { printCliError } from '../cli-errors.js';
|
|
23
26
|
import { PREVIEW_DOMAIN } from '../preview.js';
|
|
@@ -547,7 +550,7 @@ function defaultOutFromCloneTarget({ url, id, }) {
|
|
|
547
550
|
}
|
|
548
551
|
/**
|
|
549
552
|
* Mirror of atlas `ci-discover` Zod contract so `repos ci show` fails closed
|
|
550
|
-
* on the same invalid `.seq/
|
|
553
|
+
* on the same invalid `.seq/pipeline.yml` / legacy JSON shapes the runner rejects (`ci/config`).
|
|
551
554
|
* Keep in sync with `atlas/src/server/services/git-service/ci-discover.ts`.
|
|
552
555
|
*/
|
|
553
556
|
const CiPhaseSchema = z.enum(['check', 'test']);
|
|
@@ -583,45 +586,55 @@ function defaultNameForPhase(phase, indexInPhase) {
|
|
|
583
586
|
return `ci/${phase}`;
|
|
584
587
|
return `ci/${phase}-${indexInPhase + 1}`;
|
|
585
588
|
}
|
|
589
|
+
function discoverConfiguredCliChecks({ configuration, source }) {
|
|
590
|
+
if (configuration !== null && typeof configuration === 'object' && Reflect.get(configuration, 'schema_version') === 2) {
|
|
591
|
+
return { ok: true, checks: [], native: true };
|
|
592
|
+
}
|
|
593
|
+
const parsed = CiJsonSchema.safeParse(configuration);
|
|
594
|
+
if (!parsed.success) {
|
|
595
|
+
const detail = parsed.error.issues
|
|
596
|
+
.map((i) => `${i.path.join('.') || '(root)'}: ${i.message}`)
|
|
597
|
+
.slice(0, 3)
|
|
598
|
+
.join('; ');
|
|
599
|
+
return { ok: false, error: `Invalid .seq/${source}: ${detail}` };
|
|
600
|
+
}
|
|
601
|
+
const phaseCounts = new Map();
|
|
602
|
+
const seenNames = new Set();
|
|
603
|
+
const checks = [];
|
|
604
|
+
for (const entry of parsed.data.checks) {
|
|
605
|
+
const indexInPhase = phaseCounts.get(entry.phase) ?? 0;
|
|
606
|
+
phaseCounts.set(entry.phase, indexInPhase + 1);
|
|
607
|
+
const name = entry.name ?? defaultNameForPhase(entry.phase, indexInPhase);
|
|
608
|
+
if (seenNames.has(name)) {
|
|
609
|
+
return {
|
|
610
|
+
ok: false,
|
|
611
|
+
error: `Invalid .seq/${source}: duplicate check name "${name}"`,
|
|
612
|
+
};
|
|
613
|
+
}
|
|
614
|
+
seenNames.add(name);
|
|
615
|
+
const check = {
|
|
616
|
+
name,
|
|
617
|
+
source,
|
|
618
|
+
};
|
|
619
|
+
if (entry.script != null)
|
|
620
|
+
check.script = entry.script;
|
|
621
|
+
if (entry.command != null)
|
|
622
|
+
check.command = entry.command;
|
|
623
|
+
checks.push(check);
|
|
624
|
+
}
|
|
625
|
+
return { ok: true, checks };
|
|
626
|
+
}
|
|
586
627
|
/**
|
|
587
628
|
* Pure discovery shared by `repos ci show` / `import`. Mirrors atlas
|
|
588
629
|
* `discoverCiChecks` / `parseCiJson` so CLI preview matches execution.
|
|
589
630
|
*/
|
|
590
|
-
export function discoverCliChecks({ ciJson, packageScripts, }) {
|
|
591
|
-
if (ciJson !== undefined)
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
.join('; ');
|
|
598
|
-
return { ok: false, error: `Invalid .seq/ci.json: ${detail}` };
|
|
599
|
-
}
|
|
600
|
-
const phaseCounts = new Map();
|
|
601
|
-
const seenNames = new Set();
|
|
602
|
-
const checks = [];
|
|
603
|
-
for (const entry of parsed.data.checks) {
|
|
604
|
-
const indexInPhase = phaseCounts.get(entry.phase) ?? 0;
|
|
605
|
-
phaseCounts.set(entry.phase, indexInPhase + 1);
|
|
606
|
-
const name = entry.name ?? defaultNameForPhase(entry.phase, indexInPhase);
|
|
607
|
-
if (seenNames.has(name)) {
|
|
608
|
-
return {
|
|
609
|
-
ok: false,
|
|
610
|
-
error: `Invalid .seq/ci.json: duplicate check name "${name}"`,
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
seenNames.add(name);
|
|
614
|
-
const check = {
|
|
615
|
-
name,
|
|
616
|
-
source: 'ci.json',
|
|
617
|
-
};
|
|
618
|
-
if (entry.script != null)
|
|
619
|
-
check.script = entry.script;
|
|
620
|
-
if (entry.command != null)
|
|
621
|
-
check.command = entry.command;
|
|
622
|
-
checks.push(check);
|
|
623
|
-
}
|
|
624
|
-
return { ok: true, checks };
|
|
631
|
+
export function discoverCliChecks({ ciYaml, ciJson, packageScripts, }) {
|
|
632
|
+
if (ciYaml !== undefined && ciJson !== undefined)
|
|
633
|
+
return { ok: false, error: 'Both .seq/pipeline.yml and .seq/ci.json exist; remove one to make CI configuration unambiguous' };
|
|
634
|
+
if (ciYaml !== undefined || ciJson !== undefined) {
|
|
635
|
+
const source = ciYaml !== undefined ? 'pipeline.yml' : 'ci.json';
|
|
636
|
+
const configuration = ciYaml !== undefined ? ciYaml : ciJson;
|
|
637
|
+
return discoverConfiguredCliChecks({ configuration, source });
|
|
625
638
|
}
|
|
626
639
|
const checks = [];
|
|
627
640
|
if (packageScripts) {
|
|
@@ -642,39 +655,36 @@ function decodeFileContent(file) {
|
|
|
642
655
|
? Buffer.from(file.content, 'base64').toString('utf8')
|
|
643
656
|
: file.content;
|
|
644
657
|
}
|
|
645
|
-
/**
|
|
646
|
-
* Load `.seq/ci.json` / `package.json` for CI preview.
|
|
647
|
-
*
|
|
648
|
-
* Matches the runner: only a true 404 means "file absent". Invalid JSON and
|
|
649
|
-
* non-404 API errors fail closed (no silent package.json fallback over a bad
|
|
650
|
-
* `.seq/ci.json`).
|
|
651
|
-
*/
|
|
658
|
+
/** Load YAML or legacy JSON; only a true 404 means configuration is absent. */
|
|
652
659
|
export async function loadRemoteCiSources({ ctx, repoId, ref, }) {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
catch {
|
|
664
|
-
return { ok: false, error: 'invalid .seq/ci.json: not valid JSON' };
|
|
665
|
-
}
|
|
660
|
+
const configurations = [];
|
|
661
|
+
for (const path of ['.seq/pipeline.yml', '.seq/ci.json']) {
|
|
662
|
+
try {
|
|
663
|
+
const file = await getJsonOr404({
|
|
664
|
+
...clientOptions(ctx),
|
|
665
|
+
path: `/api/git-service/repos/${repoId}/contents/${path}?ref=${encodeURIComponent(ref)}`,
|
|
666
|
+
});
|
|
667
|
+
if (file != null)
|
|
668
|
+
configurations.push({ path, text: decodeFileContent(file) });
|
|
666
669
|
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
670
|
+
catch (err) {
|
|
671
|
+
if (err instanceof AtlasApiError)
|
|
672
|
+
return { ok: false, error: `failed to fetch ${path}: ${err.message}` };
|
|
673
|
+
throw err;
|
|
671
674
|
}
|
|
672
|
-
throw err;
|
|
673
675
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
676
|
+
if (configurations.length > 1)
|
|
677
|
+
return { ok: false, error: 'Both .seq/pipeline.yml and .seq/ci.json exist; remove one to make CI configuration unambiguous' };
|
|
678
|
+
const configuration = configurations[0];
|
|
679
|
+
if (configuration) {
|
|
680
|
+
try {
|
|
681
|
+
const parsed = parseCiConfigText(configuration) ?? null;
|
|
682
|
+
return configuration.path.endsWith('.yml') ? { ok: true, ciYaml: parsed } : { ok: true, ciJson: parsed };
|
|
683
|
+
}
|
|
684
|
+
catch (error) {
|
|
685
|
+
const detail = configuration.path.endsWith('.json') ? 'not valid JSON' : error instanceof Error ? error.message : 'invalid YAML';
|
|
686
|
+
return { ok: false, error: `invalid ${configuration.path}: ${detail}` };
|
|
687
|
+
}
|
|
678
688
|
}
|
|
679
689
|
let packageScripts;
|
|
680
690
|
try {
|
|
@@ -691,11 +701,7 @@ export async function loadRemoteCiSources({ ctx, repoId, ref, }) {
|
|
|
691
701
|
return { ok: false, error: 'invalid package.json: not valid JSON' };
|
|
692
702
|
}
|
|
693
703
|
if (pkg.scripts && typeof pkg.scripts === 'object') {
|
|
694
|
-
packageScripts =
|
|
695
|
-
for (const [key, value] of Object.entries(pkg.scripts)) {
|
|
696
|
-
if (typeof value === 'string')
|
|
697
|
-
packageScripts[key] = value;
|
|
698
|
-
}
|
|
704
|
+
packageScripts = Object.fromEntries(Object.entries(pkg.scripts).filter((entry) => typeof entry[1] === 'string'));
|
|
699
705
|
}
|
|
700
706
|
}
|
|
701
707
|
}
|
|
@@ -713,8 +719,17 @@ export async function loadRemoteCiSources({ ctx, repoId, ref, }) {
|
|
|
713
719
|
*/
|
|
714
720
|
export async function reposCiShowCommand(args) {
|
|
715
721
|
const { namespace, name } = parseRepoPath(args.positional[0]);
|
|
722
|
+
const pr = stringFlag(args.flags, 'pr');
|
|
723
|
+
if (pr !== undefined && (!/^[1-9]\d*$/.test(pr) || !Number.isSafeInteger(Number(pr))))
|
|
724
|
+
throw new Error('--pr requires a positive pull request number');
|
|
725
|
+
if (pr !== undefined && args.flags.ref !== undefined)
|
|
726
|
+
throw new Error('Choose --pr for the authoritative PR plan or --ref for a configuration preview');
|
|
727
|
+
if (pr === undefined && flagBool(args.flags, 'json'))
|
|
728
|
+
throw new Error('--json requires --pr for the authoritative CI status');
|
|
716
729
|
const ctx = await reposContext(args);
|
|
717
730
|
const resolved = await resolveRepo({ ...clientOptions(ctx), namespace, name });
|
|
731
|
+
if (pr !== undefined)
|
|
732
|
+
return showRepositoryPrCi({ ctx, repoId: resolved.id, repoPath: `${namespace}/${name}`, number: Number(pr), json: flagBool(args.flags, 'json') });
|
|
718
733
|
const repo = await getJson({
|
|
719
734
|
...clientOptions(ctx),
|
|
720
735
|
path: `/api/git-service/repos/${resolved.id}`,
|
|
@@ -732,6 +747,11 @@ export async function reposCiShowCommand(args) {
|
|
|
732
747
|
return 1;
|
|
733
748
|
}
|
|
734
749
|
console.log(`${LOG} CI for ${namespace}/${name}@${ref} on ${ctx.env.name}:`);
|
|
750
|
+
if (discovered.native) {
|
|
751
|
+
console.log(' Native repository pipeline discovered; the server validates and plans it when a pull request is opened or updated.');
|
|
752
|
+
console.log(` Inspect the plan with: seq-studio repos ci show ${namespace}/${name} -e ${ctx.env.name} --pr <number>`);
|
|
753
|
+
return 0;
|
|
754
|
+
}
|
|
735
755
|
if (discovered.checks.length === 0) {
|
|
736
756
|
console.log(' (no checks discovered)');
|
|
737
757
|
return 0;
|
|
@@ -746,9 +766,9 @@ export async function reposCiShowCommand(args) {
|
|
|
746
766
|
}
|
|
747
767
|
return 0;
|
|
748
768
|
}
|
|
749
|
-
const REQUIRED_CHECKS_WRITE_DISABLED = `${LOG}
|
|
750
|
-
`
|
|
751
|
-
`Use \`seq-studio repos ci show
|
|
769
|
+
const REQUIRED_CHECKS_WRITE_DISABLED = `${LOG} these legacy requiredChecks controls are disabled; legacy discovery posts neutral check-runs. ` +
|
|
770
|
+
`Use \`seq-studio repos ci init\`, commit .seq/pipeline.yml, and open or update a pull request for native CI. ` +
|
|
771
|
+
`Use \`seq-studio repos ci show <repo> -e <env> --pr <number>\` to inspect its plan.`;
|
|
752
772
|
/** Add a check-run name to Settings `requiredChecks` (merge-blocking). */
|
|
753
773
|
export async function reposCiRequireCommand(args) {
|
|
754
774
|
const check = stringFlag(args.flags, 'check');
|
|
@@ -771,12 +791,21 @@ export async function reposCiImportCommand(args) {
|
|
|
771
791
|
return 1;
|
|
772
792
|
}
|
|
773
793
|
export async function reposCiCommand(args) {
|
|
774
|
-
const [
|
|
794
|
+
const [requestedAction] = args.positional;
|
|
795
|
+
const action = flagBool(args.flags, 'help') || flagBool(args.flags, 'h') ? 'help' : requestedAction;
|
|
775
796
|
const rest = {
|
|
776
797
|
...args,
|
|
777
798
|
positional: args.positional.slice(1),
|
|
778
799
|
};
|
|
779
800
|
switch (action) {
|
|
801
|
+
case 'init': {
|
|
802
|
+
if (rest.positional.length)
|
|
803
|
+
throw new Error('usage: seq-studio repos ci init [--dir <repository>]');
|
|
804
|
+
const filename = await initializeRepositoryPipeline({ directory: stringFlag(rest.flags, 'dir') ?? process.cwd() });
|
|
805
|
+
console.log(`${LOG} Created ${filename}`);
|
|
806
|
+
console.log('Commit and push this file with your resource manifests, then open or update a pull request. Atlas discovers the pipeline and uses platform-managed CI defaults.');
|
|
807
|
+
return 0;
|
|
808
|
+
}
|
|
780
809
|
case 'show':
|
|
781
810
|
return reposCiShowCommand(rest);
|
|
782
811
|
case 'require':
|
|
@@ -786,9 +815,15 @@ export async function reposCiCommand(args) {
|
|
|
786
815
|
case 'help':
|
|
787
816
|
case undefined:
|
|
788
817
|
console.log(`usage:
|
|
789
|
-
seq-studio repos ci
|
|
790
|
-
seq-studio repos ci
|
|
791
|
-
seq-studio repos ci
|
|
818
|
+
seq-studio repos ci init [--dir <repository>] create .seq/pipeline.yml; no login needed
|
|
819
|
+
seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs
|
|
820
|
+
seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks
|
|
821
|
+
seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control; use native pipeline discovery
|
|
822
|
+
seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control; use native pipeline discovery
|
|
823
|
+
|
|
824
|
+
Commit and push .seq/pipeline.yml with your native resource manifests, then
|
|
825
|
+
open or update a pull request. Atlas selects the managed executor and image.
|
|
826
|
+
Native checks do not require a branch policy or image digest in the repository.
|
|
792
827
|
`);
|
|
793
828
|
return action ? 0 : 1;
|
|
794
829
|
default:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequenceholdings/studio-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth pat`. Includes Auth0 browser login shared with seqapi.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"smol-toml": "^1.9.0",
|
|
42
42
|
"tsx": "^4.20.3",
|
|
43
43
|
"zod": "^4.1.13",
|
|
44
|
-
"@sequenceholdings/lattice": "0.1.5",
|
|
45
|
-
"@sequenceholdings/artifact-studio": "0.6.6",
|
|
46
44
|
"@sequenceholdings/agent-spec": "0.1.3",
|
|
45
|
+
"@sequenceholdings/artifact-studio": "0.6.7",
|
|
46
|
+
"@sequenceholdings/managed-functions": "0.3.5",
|
|
47
47
|
"@sequenceholdings/storage": "0.1.1",
|
|
48
|
-
"@sequenceholdings/
|
|
48
|
+
"@sequenceholdings/lattice": "0.1.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sequenceholdings/orm": "2.5.0",
|