Skip to content

Commit 9566049

Browse files
authored
Nebius cxcli 326 (#96)
* new changes * Prepare release nebius-cxcli-v0.1.6
1 parent 07e1ed8 commit 9566049

File tree

9 files changed

+222
-36
lines changed

9 files changed

+222
-36
lines changed

services/nebius-cxcli/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ All notable changes to this project are tracked here. This changelog follows
66

77
## [Unreleased]
88

9+
## [nebius-cxcli-v0.1.6] - 2026-03-23
10+
11+
- Simplified `bootstrap-ci` so reruns automatically reconcile the CLI-managed customer workflow to the latest generated contract; `--auth-bootstrap` remains enabled by default and workflow-only runs are now the explicit opt-out via `--no-auth-bootstrap`.
12+
- Added regression coverage that `bootstrap-ci --help` and the command surface keep `--auth-bootstrap` enabled by default.
13+
- Fixed customer-side Terraform plan/apply flows for private repos by persisting rendered tfvars in the generated manifest and recreating ignored `generated/infra/terraform.auto.tfvars.json` from that manifest before Terraform runs, both in CLI-generated bundle commands and generated customer workflows.
14+
- Clarified and tested that `deploy <generated-dir>` remains a local/customer-side bundle operation only and does not auto-run `bootstrap-ci` or mutate GitHub CI workflow/environment state.
15+
916
## [nebius-cxcli-v0.1.5] - 2026-03-22
1017

1118
- Added PR-side coverage for `bootstrap-ci` workflow generation across both development (`main`) and stable tagged (`nebius-cxcli-v<version>`) default CLI refs.

services/nebius-cxcli/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ The current implementation is provider-driven and source-configured for Nebius e
4545
- `render` writes deterministic Terraform, Flux, inventory, and `generated/nebius-cxcli-manifest.json`.
4646
- `render` resets the generated bundle by recreating managed files from a clean layout, while preserving bootstrap-owned `generated/flux/flux-system` so rerendering does not tear down an existing Flux GitOps bootstrap.
4747
- `render` warns before overwriting existing generated artifacts, so rerendering is an explicit reset back to the original `config.yaml` contract.
48+
- Customer-side generated-bundle commands recreate ignored `generated/infra/terraform.auto.tfvars.json` from the committed manifest before Terraform runs, so deployable repos do not need to version that sensitive duplicate file.
4849
- `deploy`, `terraform plan/apply/unlock`, `flux apply/bootstrap`, `inventory write`, and `email` all operate on an existing generated bundle instead of reading `config.yaml`.
4950
- `terraform apply`, `flux apply`, and `deploy` are designed for sequential idempotent reruns against the same generated bundle.
5051
- `bootstrap-ci` generates CI workflow and can bootstrap/sync CI environment secrets.
@@ -523,6 +524,7 @@ nebius-cxcli flux bootstrap /path/to/generated
523524
- Uses the generated bundle as the deploy contract; it does not need the original render machine's local module paths.
524525
- `deploy <generated-dir>`
525526
- Full local deploy from the generated bundle: Terraform apply first, then inventory refresh for both infra and apps artifacts, then Flux apply. If GitOps bootstrap is not configured yet, the CLI warns and prints the follow-up `flux bootstrap` command.
527+
- `deploy` does not run `bootstrap-ci` automatically, even when the bundle lives inside a git repository. GitHub workflow/environment bootstrap stays an explicit generator-side step.
526528
- `terraform apply <generated-dir>`
527529
- Infra-only apply from the generated Terraform bundle. Safe to rerun sequentially for convergence, and does not depend on resolving the original source catalog's module paths.
528530
- `flux apply <generated-dir>`
@@ -547,9 +549,12 @@ nebius-cxcli auth --instance-config /path/to/config.yaml --validate-profile
547549
- Scaffolds or reconciles the instance `config.yaml` and generated-folder skeleton.
548550
- `bootstrap-ci <config.yaml>`
549551
- Generates the customer GitHub Actions workflow and can optionally bootstrap/sync CI auth secrets. The generated workflow watches and deploys only `generated/**`.
552+
- The workflow file is CLI-managed. Re-running `bootstrap-ci` automatically reconciles `.github/workflows/nebius-deployments.yml` to the latest generated contract and is idempotent when no drift exists.
550553
- Generated workflows validate changed bundles with `nebius-cxcli validate-generated --portable` before Terraform plan/apply.
554+
- Generated workflows restore ignored `generated/infra/terraform.auto.tfvars.json` from `generated/nebius-cxcli-manifest.json` before Terraform plan/apply.
551555
- Generated workflows also keep the Python version in one env var and emit compact single-line discovery JSON into `GITHUB_OUTPUT` so matrix handoff stays deterministic.
552556
- The target `config.yaml` must already live inside the customer git repository because the workflow is written at that repo root under `.github/workflows/`.
557+
- `--auth-bootstrap` is already enabled by default. Re-running `bootstrap-ci` normally reconciles both the managed workflow and the GitHub Environment/Secrets contract; use `--no-auth-bootstrap` only when you intentionally want workflow-only reconciliation without touching GitHub secrets.
553558
- With default `--auth-bootstrap`, the command auto-detects the target GitHub repo from that checkout's `origin` remote. Use `--github-repo <owner/repo>` only as an explicit override when the remote is missing, non-GitHub, or not the repo you want to manage.
554559
- When `--cli-ref` is omitted, generated workflows default to `main` for development builds and to `nebius-cxcli-v<version>` for stable tagged releases.
555560
- Use `--cli-ref <branch|tag|sha>` when the workflow should install a specific nebius-cxcli ref for PR or branch validation instead of the default release tag or `main`.
@@ -573,7 +578,7 @@ Common command flags:
573578
- `create`:
574579
`--client-name`, `--tenant-id`, `--project-id`, `--region-id`, `--email`, `--infra`, `--app`, `--app-namespace`, `--app-releasename`, `--validate-sources/--no-validate-sources`, `--no-interactive`, `--force`
575580
- `bootstrap-ci`:
576-
`--force`, `--auth-bootstrap/--no-auth-bootstrap`, `--github-repo`, `--github-token-env`, `--cli-ref`
581+
`--auth-bootstrap/--no-auth-bootstrap`, `--github-repo`, `--github-token-env`, `--cli-ref`
577582
- `validate`: `--strict`, `--render-profile`
578583
- `validate-generated`: `--auto-auth-bootstrap/--no-auto-auth-bootstrap`, `--portable`
579584
- `render`: `--force`, `--render-profile`
@@ -617,7 +622,9 @@ Terraform runtime auth behavior:
617622
- GitHub environment name is `<client_name>-<project_id>`.
618623
- Requires existing local runtime auth profile (create first if missing).
619624

620-
`bootstrap-ci <config.yaml>` remains the full CI workflow bootstrap command and can still perform complete CI auth bootstrap/sync for that config. The generated customer workflow is artifact-driven: it watches and deploys only `generated/**`. The command requires the target config to be inside the customer git repository, auto-detects the GitHub repo from that checkout when `--auth-bootstrap` is enabled, and uses `--github-repo` only as an explicit override.
625+
`bootstrap-ci <config.yaml>` remains the full CI workflow bootstrap command and can still perform complete CI auth bootstrap/sync for that config. The generated customer workflow is artifact-driven: it watches and deploys only `generated/**`. Re-running the command automatically reconciles the CLI-managed workflow file to the latest template. The command requires the target config to be inside the customer git repository, auto-detects the GitHub repo from that checkout when `--auth-bootstrap` is enabled by default, and uses `--github-repo` only as an explicit override.
626+
627+
`deploy <generated-dir>` is intentionally separate from `bootstrap-ci <config.yaml>`. Local/customer-side deploy commands operate only on the committed generated bundle and runtime auth material; they do not create or update GitHub workflows, GitHub environments, or CI secrets automatically.
621628

622629
Generated workflow CLI ref:
623630

@@ -749,5 +756,6 @@ Runtime plugin env knobs:
749756
- `generated/` is the deploy contract and should also be versioned, except for ignored runtime/transient files.
750757
- Managed deployments `.gitignore` keeps generated Terraform runtime files and generated tfvars out of git, but does not ignore `config.yaml` or deployable generated manifests.
751758
- Keep `generated/infra/terraform.auto.tfvars.json` ignored even in a private repo: it is a generated, sensitive duplicate of values already present in `config.yaml`.
759+
- Customer-side `validate-generated`, `terraform plan/apply`, and `deploy` recreate `generated/infra/terraform.auto.tfvars.json` from `generated/nebius-cxcli-manifest.json` before Terraform runs.
752760
- GitHub sync requires a token with permission to write GitHub environment secrets.
753761
- Key rotation is explicit with `auth --recreate` and automatic in deploy only when runtime auth bootstrap is needed.

services/nebius-cxcli/docs/design.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ The command boundary is intentional:
322322
### `bootstrap-ci <config.yaml>`
323323

324324
- Generates `.github/workflows/nebius-deployments.yml`.
325+
- Re-running it automatically reconciles that CLI-managed workflow file to the latest template for the target repo/deployments path.
325326
- Generated customer workflow is artifact-driven: it watches and deploys only `generated/**`.
326327
- `config.yaml` remains in the customer repo as a manual render/reset contract and does not trigger customer CI deployment.
327328
- The target `config.yaml` must already live inside the customer git repository because the workflow is written at that repo root.
@@ -366,6 +367,7 @@ The command boundary is intentional:
366367
- `deploy <generated-dir>`
367368
- Full local deployment from the generated bundle: Terraform first, then inventory refresh for infra and apps artifacts, then Flux direct apply.
368369
- `--auto-auth-bootstrap/--no-auto-auth-bootstrap` controls runtime auth creation (default enabled).
370+
- Does not run `bootstrap-ci` automatically, even when the generated bundle is inside a git repository; GitHub workflow/environment bootstrap stays an explicit generator-side action.
369371
- `terraform apply <generated-dir>`
370372
- Infra-only apply from the generated Terraform bundle.
371373
- `--auto-auth-bootstrap/--no-auto-auth-bootstrap` controls runtime auth creation (default enabled).
@@ -381,7 +383,7 @@ The command boundary is intentional:
381383
- `create <target_path>`
382384
- Scaffolds or reconciles the instance `config.yaml` and generated skeleton.
383385
- `bootstrap-ci <config.yaml>`
384-
- Generates the customer workflow. The generated workflow watches and deploys only `generated/**`.
386+
- Generates or reconciles the customer workflow. The generated workflow watches and deploys only `generated/**`.
385387
- `discover <target_path>`
386388
- Returns deployment-instance discovery payload for CI.
387389
- `terraform plan <generated-dir>`
@@ -404,11 +406,12 @@ The command boundary is intentional:
404406
- `validate`/`render`: deterministic and repeatable.
405407
- `validate-generated`: deterministic for a given generated bundle.
406408
- `deploy`: convergent behavior expected from apply/reconcile against a fixed generated bundle.
407-
- `bootstrap-ci`: idempotent workflow file handling; `--force` only for overwrite.
409+
- `bootstrap-ci`: idempotent reconcile; reruns auto-update the CLI-managed customer workflow and re-check GitHub environment secret presence.
408410
- `auth --create`: idempotent create-if-missing.
409411
- `auth --recreate`: explicit rotation path.
410412
- `auth --validate-profile`: read-only profile validation; safe to re-run.
411413
- `auth --bootstrap-ci`: idempotent environment-secret upsert from local cache.
414+
- `deploy` and other customer-side generated-bundle commands do not mutate GitHub CI state as a side effect.
412415

413416
## 10. Validation Model
414417

@@ -525,13 +528,16 @@ Flux render:
525528
`bootstrap-ci`:
526529

527530
- Generates workflow file.
531+
- Treats `.github/workflows/nebius-deployments.yml` as a CLI-managed file and automatically reconciles it to the latest generated contract on every rerun.
528532
- Requires the target config path to be inside the customer git repository so the workflow can be written at the repo root.
529533
- With auth bootstrap enabled, auto-detects the target GitHub repo from the checkout `origin` remote unless `--github-repo` overrides it.
530534
- Fails before writing the workflow if full GitHub bootstrap prerequisites are missing.
531535
- Derives GitHub environment name as `<client_name>-<project_id>`, ensures that environment exists, then checks/syncs missing environment secrets.
532536
- Generated customer workflows validate with `nebius-cxcli validate-generated --portable` before Terraform plan/apply so non-portable local module paths are rejected in PRs and main-branch deploy runs.
537+
- Generated customer workflows restore ignored `generated/infra/terraform.auto.tfvars.json` from `generated/nebius-cxcli-manifest.json` before Terraform plan/apply.
533538
- Generated customer workflows also keep the Python runtime version in one env var and write compact single-line discovery JSON to `GITHUB_OUTPUT` for stable matrix handoff.
534539
- Does not manage GitHub repo/org variables; `NEBIUS_CXCLI_REF` remains an optional manual override consumed by the generated workflow.
540+
- `generated/infra/terraform.auto.tfvars.json` remains ignored in private deployment repos; customer-side generated-bundle commands recreate it from `generated/nebius-cxcli-manifest.json` before Terraform plan/apply so CI does not depend on a committed tfvars file.
535541

536542
`auth`:
537543

0 commit comments

Comments
 (0)