[eas-cli] Add tiered build-credit usage warnings (approaching/at/over)#3882
Open
sarahlane8 wants to merge 2 commits into
Open
[eas-cli] Add tiered build-credit usage warnings (approaching/at/over)#3882sarahlane8 wants to merge 2 commits into
sarahlane8 wants to merge 2 commits into
Conversation
Lowers the warning threshold from 85% to 80% to match email notifications. Adds two new tiers beyond the existing "approaching": one when the user has reached their included credits, and one when they've exceeded them on a paid plan. Free plans collapse the "over" case into the "at" message since Free is blocked at the limit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Subscribed to pull request
Generated by CodeMention |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3882 +/- ##
==========================================
+ Coverage 58.91% 58.94% +0.03%
==========================================
Files 932 932
Lines 40744 40772 +28
Branches 8593 8601 +8
==========================================
+ Hits 24002 24029 +27
- Misses 16646 16647 +1
Partials 96 96 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
✅ Thank you for adding the changelog entry! |
sarahlane8
commented
Jun 18, 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.
Why
The existing pre-build warning fires at a single 85% threshold and gives Free vs paid plan messaging but doesn't distinguish between approaching the limit, reaching it, and exceeding it. As users move through those states, the message they need to see changes — and the current single-tier message is technically inaccurate once they hit 100%.
This PR splits the warning into three tiers, lowers the threshold to 80% to match Expo's email warning cadence, and standardizes the wording across the existing dashboard's "billing period" language.
How
AccountUsageForOverageWarning) to also returnoverageMetrics { value }andtotalCost. These already exist on the schema; the query just wasn't asking for them.classifyUsageTier: returns'approaching' | 'at' | 'over' | nullbased on plan value, limit, and overage count.overwins if any overage is recorded;atifplanValue >= limitwith no overage;approachingif>= 80%.displayOverageWarningwith tier-specific messaging:atmessage since Free can't accumulate overage (blocked at the limit). Kept as a safety net for data inconsistencies.eas account:usagedashboard.runBuildAndSubmit.ts— the warning still fires once pereas buildinvocation, before the first build, and is skipped for--localbuilds.Test Plan
26 unit tests pass, covering every (tier × plan) combination plus the classifier, progress bar, and account-name billing URL.
Local preview script (not committed; lives in gitignored
packages/eas-cli/tmp/) renders every variant for visual inspection. Sample output:Not yet verified end-to-end against a real account on staging — the GraphQL fields already exist on the schema, but it would be good to confirm the query returns expected data against a real over-limit account before merging.
Copy review
Public-facing customer warning copy. Would appreciate eyes from PM / customer success / growth before merging.