Skip to content

move credit alerts to trial start time#9498

Merged
pjain1 merged 1 commit into
mainfrom
handle_existing_orgs_without_trial_started
May 26, 2026
Merged

move credit alerts to trial start time#9498
pjain1 merged 1 commit into
mainfrom
handle_existing_orgs_without_trial_started

Conversation

@pjain1
Copy link
Copy Markdown
Member

@pjain1 pjain1 commented May 24, 2026

This ensures that alert creation is not missed on existing orgs whose trial not started yet but org has already been created.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@pjain1 pjain1 added the blocker A release blocker issue that should be resolved before a new release label May 24, 2026
Comment thread admin/server/billing.go
Copy link
Copy Markdown
Member Author

@pjain1 pjain1 May 24, 2026

Choose a reason for hiding this comment

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

Changes in this file are just some cleanup.

Comment thread admin/billing/orb.go
return fmt.Errorf("creating credit_balance_dropped alert: %w", err)
for iter.Next() {
a := iter.Current()
if a.Currency == currency {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This doesnt feel right. Can we instead catch the error thrown by orb? Also will this ever have floating point errors on their side?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is string comparison, for example for credit trial currency is credits not USD so its just comparing currency string not actual credit value. Do you mean anything else here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah got it. The variable name confused me.

Comment thread admin/billing/orb.go
return fmt.Errorf("creating credit_balance_dropped alert: %w", err)
for iter.Next() {
a := iter.Current()
if a.Currency == currency {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah got it. The variable name confused me.

Copy link
Copy Markdown
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

LGTM

@pjain1 pjain1 merged commit 5295c94 into main May 26, 2026
25 of 26 checks passed
@pjain1 pjain1 deleted the handle_existing_orgs_without_trial_started branch May 26, 2026 11:51
pjain1 added a commit that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker A release blocker issue that should be resolved before a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants