fix(gitops): ignore wizard/make-generated artifacts in local env - #1378
Conversation
`make deploy ENV=local`'s sync-clean step aborts on a fresh wizard run because the chain writes per-developer artifacts that aren't yet gitignored: - environments/local/pub-cert.pem (`make fetch-cert`) - environments/local/sealed-secrets/<ns>/*-sealedsecret.yaml (`make seal`) For real envs these are the gitops source of truth and must be committed; for the `local` sandbox they're regenerated by the wizard per-developer (same pattern as the already-gitignored `environments/local/inventory.yaml`). Narrow the ignore to `environments/local/` only — other envs' sealed-secrets stay tracked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesLocal environment .gitignore expansion
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…rtifact `make deploy ENV=local`'s sync-clean step aborted whenever the wizard re-injected `.global.tenantDefaultId` into the committed `environments/local/values.yaml` via `yq -i`. Same root cause as the inventory.yaml issue (constructorfabric#1378): a committed file mutated per developer. Convert to the same pattern that already works for inventory.yaml: - rename committed `environments/local/values.yaml` → `environments/local/values.yaml.template` - wizard cp's the template to the live `values.yaml` on first run, then `yq -i` injects the tenant id collected from the operator - live `environments/local/values.yaml` is gitignored - "Adding a new env" walkthrough copies from the template - CONTRIBUTING + README updated for the new artifact list `make deploy ENV=local` re-runs cleanly without sync-clean noise; the template stays a stable, committed sandbox config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
#1379) * fix(gitops): make environments/local/values.yaml a wizard-generated artifact `make deploy ENV=local`'s sync-clean step aborted whenever the wizard re-injected `.global.tenantDefaultId` into the committed `environments/local/values.yaml` via `yq -i`. Same root cause as the inventory.yaml issue (#1378): a committed file mutated per developer. Convert to the same pattern that already works for inventory.yaml: - rename committed `environments/local/values.yaml` → `environments/local/values.yaml.template` - wizard cp's the template to the live `values.yaml` on first run, then `yq -i` injects the tenant id collected from the operator - live `environments/local/values.yaml` is gitignored - "Adding a new env" walkthrough copies from the template - CONTRIBUTING + README updated for the new artifact list `make deploy ENV=local` re-runs cleanly without sync-clean noise; the template stays a stable, committed sandbox config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * docs(gitops): manual non-interactive k8s deploy walkthrough Adds a "Non-interactive deploy (CI, scripted, headless)" subsection to CONTRIBUTING.md under "Beyond compose". The wizard refuses to run without a TTY, so CI and any automation needs the explicit "what to copy from each template, what to edit, what to do for airbyte" recipe. The chain itself is unchanged — `make deploy ENV=local` already skips the wizard whenever inventory.yaml exists. This just documents the pre-population steps so operators don't have to reverse-engineer the wizard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * docs(contributing): restructure with TOC, tighter sections Rewrites CONTRIBUTING.md end-to-end: - Adds a contents list at the top so readers jump straight to the section they need (compose vs k8s, non-interactive CI, daily edit loop, troubleshooting). - Promotes the k8s + non-interactive CI paths from a sub-section of "Beyond compose" to first-class deployment paths alongside compose, with a single comparison table at the top. - Collapses the editing prose ("Edit Rust → build → watchexec") into a compact "what triggers what" table. - Drops repeated prose from "Auto-reload", "External MariaDB / ClickHouse", "Frontend modes" — kept tables and bullets, removed the surrounding setup paragraphs that paraphrased them. - Merges "Common tasks" / "Wipe everything" / "Prune" / "Run a one-off Rust build" into one "Common operations" code block + a paragraph on prune's interactive contract. 725 → 488 lines (−237, ~33%). No technical content removed; the file now reads top-to-bottom as a single linear walkthrough. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * docs(contributing): clarify frontend repo is optional The Prerequisites section overstated the requirement — the frontend checkout is only needed for compose with `FRONTEND_MODE=dev` (Vite HMR) or `built`. The default wizard mode (`ghcr`) and the entire k8s path both pull the published `insight-front` image from GHCR, no local clone required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * chore(gitops): bump .insight-version 0.1.78 → 0.1.79 0.1.79 is the first published chart that contains the identity wait-for-mariadb fix (envFrom → `{release}-platform` ConfigMap + `$MARIADB_HOST` env-var resolution instead of the hardcoded `{release}-mariadb` template). On 0.1.78 the init container blocks forever when `mariadb.deploy=false` because `insight-mariadb` does not resolve in the cluster. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * chore(gitops): enable api-gateway + frontend Ingress in local overlay Without an Ingress the deployed FE returns 404 on /api/* because the chart's frontend nginx only serves the SPA bundle — the chart relies on ingress-nginx to path-route `/api/*` → api-gateway and `/*` → frontend on the same host. Enable both Ingress objects in the local sandbox overlay (template). Host left empty so the Ingress matches any Host header — on OrbStack/k3d/kind the ingress-nginx LoadBalancer takes a host-reachable IP, so `http://<that-ip>/` lands on the FE and `/api/*` on the gateway without any /etc/hosts gymnastics. Real envs set `ingress.host:` to an FQDN + add TLS via cert-manager. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * feat(chart): frontend.devUserEmail value + apiGateway.authDisabled mutex The FE container's `docker-entrypoint.sh` writes a runtime `oidc-config.js` with `window.__DEV_CONFIG__={devUserEmail}` when `DEV_USER_EMAIL` env is set, so the browser builds an unsigned-JWT bearer per /api/* call. The compose path drives this via `.env.compose`; on k8s the chart had no path to wire it in — operators had to `kubectl set env deployment/insight-frontend` by hand. Add `frontend.devUserEmail` to the umbrella + subchart values; the subchart's Deployment template emits `DEV_USER_EMAIL` when set, in the same env block that handles OIDC. Mutually exclusive with OIDC at two layers: - The umbrella's `insight.validate` template fails the install when `frontend.devUserEmail` is set together with `apiGateway.authDisabled=false` (forgotten in a prod overlay = every visitor silently impersonated as that email). - The subchart fails the install when `devUserEmail` is set together with `oidc.{issuer,clientId}` directly under `frontend.*`. - The entrypoint still has its own runtime check as the last line of defence. Wizard `compose/insight-init.sh` injects the collected `DEV_USER_EMAIL` into `environments/local/values.yaml` under `.frontend.devUserEmail`. Sandbox template default is `dev@company.nonpresent` matching the wizard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * docs(contributing): add k8s seeding recipe The Seeding section was compose-centric; the k8s path got a one-liner "port-forward and run from the host" with no actual commands. Replaced with two subsections — Compose and Kubernetes — sharing the content-overview prose (identity / silver contents) at the top. The k8s recipe spells out: 1. port-forward MariaDB + ClickHouse from insight-infra, 2. invoke compose/seed/seed.py with cluster creds in env, 3. roll analytics-api to refresh its schema validator (the cf/insight#1307 gotcha applies here too). TOC gets the two new sub-section links. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * feat(seed): PLACEHOLDERS_SQL + MIGRATIONS_DIR env overrides The seed package hardcoded `/app/sql/placeholders.sql` and `/migrations` — the compose seed-sample container's bind-mount paths. Running `seed.py` from the host (the k8s deploy path) crashed at startup because those paths don't exist outside the container. Read both from env; defaults stay the compose container paths so the compose seed-sample service keeps working unchanged. CONTRIBUTING.md k8s recipe now sets: PLACEHOLDERS_SQL=./sql/placeholders.sql MIGRATIONS_DIR=../../src/ingestion/scripts/migrations Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * fix(seed): add silver.class_support_activity placeholder The 20260611000000_support-bullet-rows.sql gold migration reads from silver.class_support_activity, but the seed package's placeholders.sql was extracted before that table existed. `seed.py all` against a fresh ClickHouse crashed at the support migration with `UNKNOWN_TABLE`. Add the placeholder matching the migration's column references (person_key, date, updates, public_comments, private_comments, solved, csat_good, csat_total) using the same shape as the other class_collab_*_activity placeholders. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * feat(seed): generate silver.class_support_activity rows for the support team Added the placeholder table in 7dab3dc0 but left it empty — the 20260611000000_support-bullet-rows.sql gold view rendered with 0 rows, so the FE's support bullets showed "no peer data" for the seeded support team even though the persons existed. New generators/support.py mirrors the crm/hr generator shape: filter roster by team_profile.weights[zendesk-placeholder] > 0 (only the support team), emit one row per person per day with poisson-distributed updates / public_comments / private_comments / solved counters and a ~30%-of-solved CSAT (75% good). Wired into silver.run() after task. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> * fix(seed): cwd-agnostic wording in PLACEHOLDERS_SQL/MIGRATIONS_DIR error messages Per CodeRabbit on #1379: the hints embedded one relative-path example that only worked when CWD was compose/seed, mismatching anything run from a different directory. Reword to "set to an existing X path, e.g. <path> when running from compose/seed" — the example is now explicitly anchored to the doc'd CWD instead of being presented as a universally-correct fragment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech> --------- Signed-off-by: Anton Zelenov <antonz@constructor.tech> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
make deploy ENV=local's sync-clean step aborts on a fresh wizard run because the chain writes per-developer artifacts that aren't yet gitignored:make fetch-cert)make seal)For real envs these are the gitops source of truth and must be committed; for the
localsandbox they're regenerated by the wizard per-developer (same pattern as the already-gitignoredenvironments/local/inventory.yaml). Narrow the ignore toenvironments/local/only — other envs' sealed-secrets stay tracked.Summary by CodeRabbit