← Back to list
01Issue
FeatureTriagedSwamp CLI
AssigneesNone
env var overrides for globalArguments silently change which environment a model targets
Opened by swampadmin · 4/25/2026
Description
When a model is configured with globalArguments for a specific environment (e.g., prod-jenkins with baseUrl: http://10.155.16.20:8080), the resolveConnectionOpts pattern of falling back to env vars like JENKINS_BASE_URL makes it possible to accidentally run a prod-named model against dev infrastructure (or vice versa).
This is risky because:
- Swamp data artifacts are stored under the model name, so
prod-jenkinsdata would contain dev results - It's not obvious from the command invocation which environment is actually being targeted
- Workflows referencing
data.latest("prod-jenkins", ...)would get contaminated data
Expected Behavior
Users should create a separate model per environment (e.g., prod-jenkins, dev-jenkins) rather than overriding globalArguments via env vars. Swamp could help enforce this by:
- Warning when env vars override model globalArguments
- Providing a
--envflag onmodel method runthat selects a pre-configured environment variant - Documenting the one-model-per-environment pattern as a best practice
Steps to Reproduce
- Create a model
prod-jenkinswithbaseUrl: http://prod:8080 - Run
JENKINS_BASE_URL=http://dev:8080 swamp model method run prod-jenkins listPlugins - Data artifacts are stored under
prod-jenkinsbut contain dev data
Environment
- swamp version: 20260318.021802.0-sha.3848499d
- OS: macOS Darwin 25.3.0
02Bog Flow
Triaged
No activity in this phase yet.
03Sludge Pulse
Sign in to post a ripple.