Skip to content

fix: resolve environment metadata on profile create with explicit --name - #184

Open
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/profile-create-env-type
Open

fix: resolve environment metadata on profile create with explicit --name#184
zekelinAlex wants to merge 1 commit into
TALXIS:masterfrom
zekelinAlex:users/alexander.zekelin/profile-create-env-type

Conversation

@zekelinAlex

Copy link
Copy Markdown
Contributor

config profile create --url ... --name ... saved the connection without environmentType, displayName, organizationId and environmentId. The catalog lookup only ran when we needed to derive a profile name, so passing --name (or re-creating a profile for an already known connection) skipped it entirely. Worse, since the upsert replaces the whole connection, re-running create actually wiped metadata that profile validate --refresh-env-type had persisted earlier.

The practical fallout: a connection without environmentType is treated as production by the destructive-operation guard, so deletes on a plain devbox started demanding --allow-production. Agents then just pass the flag automatically, which defeats the point of the guard.

The lookup now runs on every create path (still best-effort, failure logs a warning and falls back), and when it fails we carry over whatever metadata the existing connection already had instead of overwriting it with nulls. Two new tests cover the explicit-name case and the don't-wipe-on-failed-lookup case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Case-Validation

Development

Successfully merging this pull request may close these issues.

2 participants