[eas-cli] Add eas env:set, deprecate env:create and env:update#4002
Draft
jonsamp wants to merge 2 commits into
Draft
[eas-cli] Add eas env:set, deprecate env:create and env:update#4002jonsamp wants to merge 2 commits into
eas env:set, deprecate env:create and env:update#4002jonsamp wants to merge 2 commits into
Conversation
Introduce `eas env:set`, which creates or updates an environment variable in a single command (upsert). `env:create` and `env:update` now warn that they are deprecated in favor of `env:set` while keeping their existing behavior for backwards compatibility.
08c524a to
f663abb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4002 +/- ##
==========================================
+ Coverage 59.67% 59.76% +0.09%
==========================================
Files 941 942 +1
Lines 41319 41423 +104
Branches 8675 8713 +38
==========================================
+ Hits 24654 24751 +97
- Misses 16571 16578 +7
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Look up the existing variable before resolving its value so updating a file variable no longer requires re-passing `--type file`, mirroring the behavior that `eas env:update` had. Also fix the `--value` flag description typo.
|
✅ Thank you for adding the changelog entry! |
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.
Why
eas env:createandeas env:updateforce users to know up front whether a variable already exists, and the two commands use inconsistent flags (--namemeans the identifier increatebut the rename target inupdate). This is janky. A singleeas env:setthat figures out create-vs-update is a much simpler mental model and mirrors theeas env:get/env:setverb pair (andgh secret set/gh variable set).Closes ENG-15351.
How
eas env:set, which looks the variable up by name + scope + environment and updates it if it exists, creates it if it doesn't (idempotent upsert). No--force, no "already exists" error, no overwrite prompt. It logsCreated/Updatedso the outcome is clear.--name+ positional environment) soenv:setis consistent with the rest of theenvcommand family. Agh-style positional-name overhaul acrossget/set/deleteis a deliberate follow-up.set(it isn't a "set" operation); it remains available on the deprecatedenv:update.eas env:createandeas env:update: both now print a deprecation notice pointing toenv:setand say so in their descriptions, but keep their exact existing behavior/flags (incl.--force,--variable-name, rename) for backwards compatibility. They are intentionally not oclif aliases ofset, because their flag surfaces are incompatible and a pure alias would break existing usage.Follow-ups (not in this PR): documenting
env:seton the docs site, the eventual removal ofcreate/updateafter a deprecation window, and the positional-name overhaul.Test Plan
EnvSet.test.tscovering create-when-absent, update-when-present without--force(project + account scope), the positionalenvironmentargument, and prompting for missing flags.EnvCreate/EnvUpdatetests still pass with the added deprecation warning.yarn test(env suite) 24/24,yarn typecheckclean,yarn lint0 errors,yarn fmt:checkclean../packages/eas-cli/bin/run env:set --help.