← Back to Pull requests

[18.0][IMP] cetmix_tower_server: environments #514

Closed
unknown closed this pull request without merging on Nov 09, 2026 16:33 UTC
View on GitHub
unknown unknown commented on Nov 04, 2026 15:37 UTC
Author

A Jet could not use a separate set of variable values for production and development: each Server, Jet Template and the global level held one value per variable.

Add Environments (Settings → Variables → Environments) with Production, Pre-production, Staging and Development by default. Root can edit them; an environment in use can't be deleted.
Tag Server, Jet Template and global variable values with environments; empty means all. A Jet uses the value tagged with its environment, else the untagged one. Values of one variable on one record must have disjoint environments, also when a value is unarchived.
Add Environment on Jets (tracked) and in the Create and Clone wizards. A Jet Template can require an environment, with a default one used by jet requests.
get_variable_value / set_variable_value take a tower_env reference; tower.jet.environment is available in templates. Server get_variable_value now honours no_fallback.
YAML: export and import environment_ids and the Jet Template environment fields as references.
Git wizards pass the environment to the new Jet.
cetmix_tower_base: records created together in one batch get unique references.

Migration: migrations/18.0.4.0.0/pre-migration.py drops cx_tower_variable_value_unique_variable_value_jet_template. Checked by hand on a database installed from origin/18.0 with the manifest set to 18.0.4.0.0 locally: the constraint was dropped, and two Jet Template values of one variable with prod and dev were saved. If the post-merge bump is not 18.0.4.0.0, rename the folder to the assigned version.

Tests: 971 of 973 pass. The 2 errors in TestTowerBaseHooks fail the same way on origin/18.0.

Task 5708

🤖 Generated with Claude Code

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

New Features
Added configurable environments for Jets, including selection during creation and cloning. Templates can require an environment and set a default for Jets created from requests.
Variable values can be assigned to environments. Matching environment-specific values take precedence, with untagged values used as a fallback.
Environment assignments and template settings are supported in YAML export and import.
Bug Fixes
* Records created together now receive unique references, even when their names or explicitly assigned references match.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 321 lines (+240 / -81) across 4 files Reviewer: Aldeigja Review duration: 7256m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 321 lines diff across 4 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.345
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #514"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 41.9% (MEDIUM) · Higher = larger blast radius
41.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.6% · Safe to merge
16.6%