Skip to content

fix(billing): low-balance mail subject reads right with any unit word - #4281

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
fix/billing-low-balance-subject
Nov 15, 2026
Merged

PierreBrisorgueil merged 1 commit into
masterfrom
fix/billing-low-balance-subject

Conversation

@PierreBrisorgueil

@PierreBrisorgueil PierreBrisorgueil commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

The low-balance email subject now reads "you are running low on " instead of "your are running low", so it reads right with any unit word, plural or not. Same shape as the out-of-balance subject ("you are out of ").

  • Default subject: <app> — you are running low on credits
  • billing.alerts.balanceUnit no longer has to be a plural word (README + config comment updated)
  • Unit tests updated for the default and a custom unit

The old wording was added in #4279 and never shipped in a tag, so no migration note.

Closes #4280

Summary by CodeRabbit

  • User-Facing Changes
    • Updated low-balance alert email subjects to use phrasing such as “You are running low on credits” or “You are running low on tokens.”
  • Documentation
    • Clarified that the balance-alert unit can be singular or plural.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The low-balance email subject now says “you are running low on [unit]”. The README, development configuration comment, and test expectations reflect the updated wording.

Changes

Billing alert subject

Layer / File(s) Summary
Low-balance subject wording
modules/billing/billing.email.js, modules/billing/tests/billing.init.email-alerts.unit.tests.js, modules/billing/README.md, modules/billing/config/billing.development.config.js
The credit-warning subject uses “you are running low on [unit]”. Test expectations and descriptions of billing.alerts.balanceUnit reflect the updated wording. The configured unit value is unchanged.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: Fix

Merge Risk: Minimal · up to 092db

This updates the low-balance email subject wording and its docs and tests. It carries no identified merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (low-balance mail subject) and the change (it reads correctly with any unit word). It matches the diff, which changes the email subject from "your [unit] are running low" to "y…
Description check Passed The description follows the template's main idea. The "What" section explains the change, the reason it matters, and the default subject. It notes the README, config comment, and unit test updates, an…
Linked Issues check Passed Issue #4280 requires the low-balance subject to change from "your are running low" to "you are running low on ", with default "you are running low on credits". At the reviewed head, modul…
Out of Scope Changes check Passed All changes match issue #4280. The changes cover the email subject in modules/billing/billing.email.js, the expected subjects in the email alert unit tests, the balanceUnit documentation in modules/bi…
Full details: Title check

Explanation

The title names the fix (low-balance mail subject) and the change (it reads correctly with any unit word). It matches the diff, which changes the email subject from "your [unit] are running low" to "you are running low on [unit]" and updates the README, config comment, and tests. It is specific and concise, and it describes the primary change.

Full details: Description check

Explanation

The description follows the template's main idea. The "What" section explains the change, the reason it matters, and the default subject. It notes the README, config comment, and unit test updates, and it links the issue with "Closes #4280". It does not fill in the template's Summary sub-fields ("Why" is implied, not labeled), Scope (module(s) impacted, cross-module impact, risk level), the Validation checklist (npm run lint, npm test), or the Guardrails check. These sections are missing or incomplete, but the core content is present, so the check passes.

Full details: Linked Issues check

Explanation

Issue #4280 requires the low-balance subject to change from "your <unit> are running low" to "you are running low on <unit>", with default "you are running low on credits". At the reviewed head, modules/billing/billing.email.js builds the warning subject as ${appName} — you are running low on ${unit}, with unit defaulting to 'credits' when balanceUnit is unset. This matches the out-of-balance subject form and the issue's requirement. The AI summary reports matching updates to the unit tests (default and custom unit) in billing.init.email-alerts.unit.tests.js and to the README and config comment for billing.alerts.balanceUnit. These are documentation and test updates the issue asks for. The issue has no other coding requirements. Limitation: the repository diff tool could not read the changed blobs, so the test and README changes rest on the AI-generated summary, not on a direct diff read. The head source confirms the core behavior.

Full details: Out of Scope Changes check

Explanation

All changes match issue #4280. The changes cover the email subject in modules/billing/billing.email.js, the expected subjects in the email alert unit tests, the balanceUnit documentation in modules/billing/README.md, and the explanatory comment in modules/billing/config/billing.development.config.js. The config change is comment-only, per the summary. No unrelated behavior changes were reported. The diff tool was unavailable, so this verdict relies on the summary and the head source of billing.email.js.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 25c7080 and 092dbfa.

Files selected for processing: 4

  • modules/billing/README.md
  • modules/billing/billing.email.js
  • modules/billing/config/billing.development.config.js
  • modules/billing/tests/billing.init.email-alerts.unit.tests.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.64%. Comparing base (25c7080) to head (092dbfa).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4281   +/-   ##
=======================================
  Coverage   94.64%   94.64%           
=======================================
  Files         175      175           
  Lines        6221     6221           
  Branches     2019     2021    +2     
=======================================
  Hits         5888     5888           
  Misses        270      270           
  Partials       63       63           
Flag Coverage Δ
integration 64.81% <0.00%> (ø)
unit 80.32% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25c7080...092dbfa. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil
PierreBrisorgueil merged commit 285623a into master Nov 15, 2026
8 checks passed
@PierreBrisorgueil
PierreBrisorgueil deleted the fix/billing-low-balance-subject branch November 15, 2026 13:14
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.

📝 Low-balance mail subject reads right with any unit word

1 participant