Skip to content

fix(credits): use shared tax code helper in custom currency test - #5364

Merged
turip merged 1 commit into
mainfrom
fix/custom-currency-tax-code-helper
Oct 26, 2026
Merged

turip merged 1 commit into
mainfrom
fix/custom-currency-tax-code-helper

Conversation

@chrisgacsal

@chrisgacsal chrisgacsal commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Fix the credits test compilation error at test/credits/customcurrency_test.go:763: s.ProvisionDefaultTaxCodes undefined.

#5354 (a55cf5116) removed billing.BaseSuite.ProvisionDefaultTaxCodes and migrated existing callers to the shared TaxCodeEnv helper. Later, #5294 (7b4c2c76c) added TestFlatFeeCreditThenInvoiceSelectsCreditsAtServiceStart with a call to the removed method. The combined changes on main therefore fail typechecking. A source-based Git bisect identified 7b4c2c76c as the first commit containing this stale call after the method was removed.

Replace that call with s.TaxCodeEnv.ProvisionDefaultTaxCodes(s.T(), ns), matching the other tests in the suite.

Notes for reviewer

This is a one-line test setup fix with no production behavior changes.

Validation:

  • git diff --check passed.
  • The local compile attempt was blocked by Homebrew librdkafka 2.15.1; the Go client requires 2.16.0 or later.
  • nix develop --impure .#ci -c go test -tags=dynamic -run '^$' ./test/credits passed (exit 0). This compiles and vets the package and its tests; integration tests were not executed.

RetriggerView in GreptileConfidence Score: 5/5

This one-line test fix appears safe to merge.

Summary

Replaces the removed suite helper with TaxCodeEnv.ProvisionDefaultTaxCodes in the custom currency test.

  • The credit-allocation test gets its default tax codes from the shared test environment.

Reviews (1) · Last reviewed commit: "fix(credits): use shared tax code helper..." · Reviewed by Greptile

Summary by CodeRabbit

  • Tests
    • Updated the setup for the mid-period flat-fee credit-selection test.

@chrisgacsal
chrisgacsal requested a review from a team as a code owner October 26, 2026 13:49
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5e1a709 and 1fdc698.

Files selected for processing: 1
  • test/credits/customcurrency_test.go

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

Walkthrough

The mid-period flat-fee credit-selection test now provisions default tax codes through TaxCodeEnv.ProvisionDefaultTaxCodes.

Changes: Tax code test helper migration

Layer / File(s) Summary
Update tax code provisioning call
test/credits/customcurrency_test.go
The test now calls TaxCodeEnv.ProvisionDefaultTaxCodes with the test instance and namespace.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Possibly related PRs

  • openmeterio/openmeter#5354: Removes BaseSuite.ProvisionDefaultTaxCodes and introduces TaxCodeEnv.ProvisionDefaultTaxCodes; this change updates the remaining test call.

Suggested reviewers: galexihu

Merge Risk: Minimal · up to 1fdc6

No actionable merge-blocking risk remains; the change is limited to test setup.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the custom currency test now calls the shared tax code helper, which matches the raw summary and PR objectives. The fix(credits) prefix fits a test-setup change that r…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the custom currency test now calls the shared tax code helper, which matches the raw summary and PR objectives. The fix(credits) prefix fits a test-setup change that repairs a compile error from a removed BaseSuite call. The title is 64 characters, which is within a normal length, and it contains no noise or vague terms.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 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

Comment @coderabbitai help to get the list of available commands.

@turip turip added the release-note/bug-fix Release note: Bug Fixes label Oct 26, 2026
@turip
turip enabled auto-merge (squash) October 26, 2026 13:50
@turip
turip disabled auto-merge October 26, 2026 13:54
@turip
turip merged commit cba0a66 into main Oct 26, 2026
33 of 34 checks passed
@turip
turip deleted the fix/custom-currency-tax-code-helper branch October 26, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/bug-fix Release note: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants