Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-9828][eas-cli] rollouts: view action for CI #2040

Merged
merged 3 commits into from
Sep 5, 2023
Merged

Conversation

quinlanj
Copy link
Member

@quinlanj quinlanj commented Sep 1, 2023

Why

Support CI better by adding a 'view' action to print rollout details

Test Plan

  • manually tested

@linear
Copy link

linear bot commented Sep 1, 2023

ENG-9828 CI Support

# get rollout information for production channel
# in this example we've rolled out 20% of users to hotfix-branch
> eas channel:rollout —non-interactive —action view production
{
  defaultBranch: ‘production’,
  rolledOutBranch: ‘hotfix-branch’,
  percentRolledOut: 20,
  updatedAt: ‘2023-11-24T09:53:01.155Z’
}

Then your CI could have any kind of customizable logic. In this example, there is a cron job, and if the last update was more than 1 day ago, we edit the rollout to 40%:

// Assume we load the rollout information into obj.
const lastUpdated = new Date(obj.updatedAt);

// Get the current date and time.
const now = new Date();

// Check if the difference is more than 1 day.
const differenceInDays = getDifference(lastUpdated, now);
if (differenceInDays > 1) {
  // Edit the rollout to 40%
  spawnAsync(`eas channel:rollout --non-interactive —-action edit --percent 40 production`);
}

@quinlanj
Copy link
Member Author

quinlanj commented Sep 1, 2023

/changelog-entry chore rollouts: view action for CI

@quinlanj quinlanj marked this pull request as ready for review September 1, 2023 21:59
Base automatically changed from @quin/jsonCi to main September 5, 2023 20:01
@quinlanj
Copy link
Member Author

quinlanj commented Sep 5, 2023

/changelog-entry chore rollouts: view action for CI

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

✅ Thank you for adding the changelog entry!

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Size Change: -985 B (0%)

Total Size: 42.3 MB

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

compressed-size-action

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Merging #2040 (3ba7c9d) into main (9097ab2) will decrease coverage by 0.03%.
The diff coverage is 16.00%.

@@            Coverage Diff             @@
##             main    #2040      +/-   ##
==========================================
- Coverage   54.02%   53.99%   -0.03%     
==========================================
  Files         508      508              
  Lines       18571    18590      +19     
  Branches     3901     3908       +7     
==========================================
+ Hits        10032    10036       +4     
- Misses       8519     8534      +15     
  Partials       20       20              
Files Changed Coverage Δ
...ges/eas-cli/src/rollout/actions/RolloutMainMenu.ts 16.89% <0.00%> (-0.68%) ⬇️
...s-cli/src/rollout/actions/NonInteractiveRollout.ts 16.93% <14.29%> (+0.86%) ⬆️
...kages/eas-cli/src/rollout/actions/ManageRollout.ts 27.46% <25.00%> (-0.20%) ⬇️
packages/eas-cli/src/commands/channel/rollout.ts 33.34% <33.34%> (ø)

@quinlanj quinlanj merged commit 54127c4 into main Sep 5, 2023
9 checks passed
@quinlanj quinlanj deleted the @quin/viewCi branch September 5, 2023 20:49
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.

2 participants