refactor(analytics)!: rename analytics-api service to analytics, drop env-key crutches - #1579
Conversation
… env-key crutches Fixes constructorfabric#1565. The gear name analytics-api produced env override keys with a hyphen (APP__gears__analytics-api__config__*), which dash entrypoints and k8s envFrom silently drop. Renaming gear + service to the dash-free "analytics" fixes this at the root (upstream report: constructorfabric/gears-rust#4175). Scope A — gear rename + crutch removal: - gear name/config key analytics-api -> analytics (gear.rs, insight.yaml, helm configmap) - delete fold_gear_env_alias/deep_merge shim + tests in main.rs - env keys become APP__gears__analytics__config__* in compose, umbrella secrets.yaml, compose-app-secrets.sh; obsolete workaround comments gone Scope B — the gear ConfigMap renders as <fullname>-gears-config, ending the name collision with the config Secret. Scope C — full service rename: - dir services/analytics-api -> services/analytics; crate/binary analytics; Dockerfiles, .dockerignore, entrypoint - compose service/hostname analytics, container insight-analytics, ANALYTICS_IMAGE/ANALYTICS_PORT knobs; api-gateway upstream http://analytics:8081 - helm subchart insight-analytics 0.2.0; umbrella 0.3.0 (BREAKING: values key analyticsApi -> analytics, Secret insight-analytics-api-config -> insight-analytics-config, image ghcr.io/constructorfabric/insight-analytics, k8s names follow fullname) - CI: build-images/ci/e2e workflows + scripts/ci/components.py - e2e: lib/analytics_api.py -> lib/analytics.py, fixtures, compose rig - docs/specs + cypilot registry paths (cpt IDs, GTS namespaces, and OpenAPI operation_ids unchanged) Verified: cargo build/clippy/fmt/test -p analytics green; helm template renders with default + local gitops values; docker compose config -q ok; --print-config confirms APP__gears__analytics__config__database_url lands under gears.analytics.config. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
|
Important Review skippedToo many files! This PR contains 188 files, which is 38 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (188)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
… tests running The rename PR touched api-gateway paths for the first time since the coverage gate landed, which made changed.py schedule its Cobertura producer — and exposed two pre-existing traps: 1. insight-api-gateway has zero unit tests, so its report gates the component at 0/209 = 0% and hard-fails the overall gate. 2. Its report also contains the linked oidc-authn-plugin dependency files at 0 hits (no cover_ignore_regex, unlike analytics), so the UNCHANGED oidc-authn-plugin component got bucketed at 0/125 = 0%. Fix, mirroring the documented identity cover=False decision: - components.py: api-gateway gets cover=False (+ a (libs|plugins) cover_ignore_regex for when coverage is re-enabled). - changed.py: rust entries now honor the registry cover flag (was dotnet-only) and carry a new test flag (true when the crate itself changed) so cover=False crates still run plain cargo test on change; lint-only fanout entries stay lint-only. - ci.yml: new "Test (no coverage)" step for test && !cover entries; refreshed a stale fold_gear_env_alias comment. Verified: python3 scripts/ci/changed.py against origin/main yields analytics lint+cover+test, api-gateway lint+test (no cover), oidc-authn-plugin/insight-clickhouse lint-only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
Fixes #1565.
Why
The gear name
analytics-apiproduced env override keys with a hyphen (APP__gears__analytics-api__config__*), which dash entrypoints and k8senvFromsilently drop — the root cause of the PR #1546 boot failures, worked around with an underscore alias + fold shim. Renaming to the dash-freeanalyticsfixes it at the root. Upstream toolkit report: constructorfabric/gears-rust#4175.What
Scope A — gear rename + crutch removal
analytics-api→analytics(gear.rs, config/insight.yaml, helm configmap)fold_gear_env_alias+deep_merge+ call site + tests in main.rsAPP__gears__analytics__config__*in docker-compose, umbrellasecrets.yaml, andcompose-app-secrets.shScope B — ConfigMap collision
<fullname>-gears-config, no longer colliding with the config Secret nameScope C — full service rename
services/analytics-api→services/analytics; crate + binaryanalyticsanalytics, containerinsight-analytics,ANALYTICS_IMAGE/ANALYTICS_PORTknobs; api-gateway upstreamhttp://analytics:8081insight-analytics0.2.0; umbrella 0.3.0 — BREAKING: values keyanalyticsApi→analytics, config Secretinsight-analytics-api-config→insight-analytics-config, imageghcr.io/constructorfabric/insight-analytics, k8s resource names follow the new fullnamescripts/ci/components.pylib/analytics_api.py→lib/analytics.py, fixtures, compose riggts.cf.insight.analytics_api.*, OpenAPI operation_idsanalytics_api.*(wire format), historical migrationsVerification
cargo build/clippy/fmt/test -p analyticsall greenhelm templaterenders with default + local gitops values; subchart re-vendoreddocker compose config -qpasses--print-configconfirmsAPP__gears__analytics__config__database_urllands undergears.analytics.configDeploy notes
insight-analytics-api-configcarrieshelm.sh/resource-policy: keep— clean it up manually after rollout.insight-versionbump to 0.3.0 once this chart is published — prepared separatelyinsight-analyticsis created on first CI publish from this PR🤖 Generated with Claude Code