fix(variable:create): forward --level when handing off to variable:update - #199
Merged
Merged
Conversation
…date With --update, an existing variable is handed to variable:update, but --level was dropped from the forwarded options, so update looked the variable up with no level. A name present at both project and environment level then failed with "Variable found at both project and environment levels", and --level project without --environment failed with "No environment specified", although create had already resolved the variable. The exclusion was introduced in c0c6774 (#1247) next to --prefix and carried through f5b7f32 (#1426), with no rationale given in either. variable:update has accepted --level throughout.
pjcdawkins
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
variable:create --update --level <level>loses the level when the variable already exists.createresolves the variable at the requested level, then hands off tovariable:update, but excludes--levelfrom the forwarded options (VariableCreateCommand.php, the handoff loop). Soupdatelooks the name up with no level, and two cases fail:--levelgiven.--level projectwithout--environmentfails with "No environment specified", becauseupdateonly waives the environment requirement for an explicit project level.The fix removes
--levelfrom the exclusion list.variable:updatehas accepted--levelsince the handoff was added in #1247, so the exclusion appears to have been grouped with--prefixby mistake.TestVariableCreateUpdateWithLevelcovers both failures, plus the no-level path as a guard. Before the fix, the first three cases fail with the messages above; after it, all four pass. Putting--levelback in the list makes them fail again.make integration-test,make lintand the legacy tests pass.CLI-194