Skip to content

feature(eas-cli): add worker:alias|promote --prod flag to promote existing deployments#2563

Merged
byCedric merged 7 commits intomainfrom
@bycedric/eas-cli/worker-alias-prod
Sep 14, 2024
Merged

feature(eas-cli): add worker:alias|promote --prod flag to promote existing deployments#2563
byCedric merged 7 commits intomainfrom
@bycedric/eas-cli/worker-alias-prod

Conversation

@byCedric
Copy link
Copy Markdown
Member

@byCedric byCedric commented Sep 13, 2024

Why

This adds worker:alias --prod and supports worker:promote --prod (we can document either one) to promote existing deployments to production. We could split the command later, if people ask for this use case a lot.

How

  • Added --prod(uction) to worker:alias
  • Added worker:promote alias of worker:alias
  • Pulled both table and json output format into src/worker/utils/logs.ts
  • Re-implemented table/json output in both worker and worker:alias
  • Updated the dashboard URL from serverless to hosting

Test Plan

  • $ eas worker
  • $ eas worker:alias --id <deployment> --alias test-alias
  • $ eas worker:alias --id <deployment> --alias test-alias --json --non-interactive | jq
  • $ eas worker:promote --prod --id <deployment> --json --non-interactive | jq

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 13, 2024

Size Change: +680 B (0%)

Total Size: 52.9 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 52.9 MB +680 B (0%)

compressed-size-action

Copy link
Copy Markdown
Contributor

@kadikraman kadikraman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eas deploy:promote works, but I think eas worker:promote has been added, I'm getting a Error: command worker:promote not found.

Copy link
Copy Markdown
Contributor

@kadikraman kadikraman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@byCedric
Copy link
Copy Markdown
Member Author

eas deploy:promote works, but I think eas worker:promote has been added, I'm getting a Error: command worker:promote not found.

As discussed, the command itself is called eas worker. Probably because it's hidden/beta, it likely disabled. But, besides that, we discussed that we are going for eas deploy for now.

@byCedric byCedric force-pushed the @bycedric/eas-cli/worker-alias-prod branch from c73d90f to a1611f1 Compare September 14, 2024 08:15
@github-actions
Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 14, 2024

Codecov Report

Attention: Patch coverage is 40.81633% with 58 lines in your changes missing coverage. Please review.

Project coverage is 52.16%. Comparing base (47e1989) to head (a1611f1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/worker/alias.ts 10.00% 24 Missing and 3 partials ⚠️
packages/eas-cli/src/commands/worker/deploy.ts 5.89% 14 Missing and 2 partials ⚠️
packages/eas-cli/src/worker/utils/logs.ts 31.82% 13 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2563      +/-   ##
==========================================
- Coverage   52.19%   52.16%   -0.02%     
==========================================
  Files         557      559       +2     
  Lines       21035    21062      +27     
  Branches     4304     4308       +4     
==========================================
+ Hits        10977    10985       +8     
- Misses       9187     9203      +16     
- Partials      871      874       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@byCedric
Copy link
Copy Markdown
Member Author

I added a fix for the typing issue from the updates test, mostly to get this PR mergable. No idea what's going on there, but it seems that the UpdateBranch type was updated to include deployments, which caused some issues in the mockUpdateBranch test function. I added an existing fix for similar properties.

I'll go ahead and merge this PR, but do ping me if the fix I added is incorrect.

@byCedric byCedric merged commit 819259a into main Sep 14, 2024
@byCedric byCedric deleted the @bycedric/eas-cli/worker-alias-prod branch September 14, 2024 08:20
@wschurman wschurman removed their request for review September 16, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants