eas-cli icon indicating copy to clipboard operation
eas-cli copied to clipboard

Implement `eas env` commands

Open khamilowicz opened this issue 1 year ago • 4 comments

Why

Implements the following commands:

  • eas env:create ENG-11913
  • eas env:get ENG-11915
  • eas env:delete ENG-11914
  • eas env:list ENG-11917
  • eas env:update ENG-11918 (Currently only delegates to env:create)

Also, as discussed on Linear, implements eas env:shared:create/update/get/delete/link/unlink as --scope shared flag on mentioned commands. (ENG-11927, ENG-11926, ENG-11925, ENG-11921, ENG-11922, ENG-11923).

How

Created commands and mutations using updated backend (https://github.com/expo/universe/pull/15153).

Deployment

(We'll wait with merging when everything from https://linear.app/expo/project/eas-environment-variables-2813a6f4c62e is done)

  1. https://github.com/expo/universe/pull/15153
  2. https://github.com/expo/eas-cli/pull/2350

Test Plan

Each command accepts arguments both in interactive mode (user is prompted for input) and non-interactive (arguments are passed inline).

The following flow will create both project and shared variables, then it will link and unlink shared variable from the project, and finally delete both of them. Commands are executed both with inline arguments and prompts. From an existing app directory:

  1. Create project variable interactively - eas env:create and provide name, value and select environment
  2. Create shared variable non-interactively - env:create --scope SHARED --name sharedVariable --value someValue
  3. eas env:list and select environment - displays only project var
  4. eas env:list --format long --scope SHARED - displays only shared var in long format
  5. eas env:link - select shared var and environment
  6. eas env:list - shared variable should be added to selected env
  7. eas env:unlink --environment SELECTEDENV --name sharedVariable
  8. eas env:list - shared variable should be removed
  9. eas env:delete - delete project variable
  10. eas env:delete --scope SHARED - delete shared environment

khamilowicz avatar Apr 29 '24 13:04 khamilowicz

Size Change: +4.33 kB (+0.01%)

Total Size: 52.5 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 52.5 MB +4.33 kB (+0.01%)

compressed-size-action

github-actions[bot] avatar Jun 07 '24 11:06 github-actions[bot]

Codecov Report

Attention: Patch coverage is 34.30962% with 314 lines in your changes missing coverage. Please review.

Project coverage is 52.95%. Comparing base (ce76d4d) to head (eb1efa0).

Files Patch % Lines
packages/eas-cli/src/commands/env/create.ts 18.61% 56 Missing and 14 partials :warning:
packages/eas-cli/src/commands/env/update.ts 25.40% 35 Missing and 12 partials :warning:
packages/eas-cli/src/commands/env/get.ts 26.42% 32 Missing and 7 partials :warning:
packages/eas-cli/src/commands/env/delete.ts 28.85% 28 Missing and 9 partials :warning:
packages/eas-cli/src/utils/prompts.ts 15.00% 28 Missing and 6 partials :warning:
packages/eas-cli/src/commands/env/unlink.ts 43.25% 16 Missing and 5 partials :warning:
packages/eas-cli/src/commands/env/list.ts 39.40% 20 Missing :warning:
packages/eas-cli/src/commands/env/link.ts 46.88% 13 Missing and 4 partials :warning:
...c/graphql/mutations/EnvironmentVariableMutation.ts 25.00% 15 Missing :warning:
...i/src/graphql/queries/EnvironmentVariablesQuery.ts 33.34% 10 Missing :warning:
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2350      +/-   ##
==========================================
- Coverage   53.40%   52.95%   -0.45%     
==========================================
  Files         530      542      +12     
  Lines       19585    20062     +477     
  Branches     3988     4101     +113     
==========================================
+ Hits        10458    10621     +163     
- Misses       8369     8626     +257     
- Partials      758      815      +57     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 07 '24 11:06 codecov[bot]

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

github-actions[bot] avatar Aug 14 '24 12:08 github-actions[bot]