Skip to content

refactor: share the AI Gateway retention and test the AI spend period helpers - #32051

Draft
ssncferreira wants to merge 1 commit into
mainfrom
ssncf/ai-spend-period-helpers
Draft

ssncferreira wants to merge 1 commit into
mainfrom
ssncf/ai-spend-period-helpers

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Shares the AI Gateway retention lookup and moves the period validation tests to the period helpers.

Changes

  • Add aiGatewayDataRetention, used by the retention endpoint and aiSpendRetainedPeriod.
  • Add TestAISpendPeriod and TestAISpendRetainedPeriod in aibridge_internal_test.go.
  • Keep one ExplicitPeriodBeforeRetention wiring test on the export, overview, and /ai/spend/users tests, and remove the cases the helper tests cover.
  • Add zero and negative retention cases to TestAIGatewayRetention.

Related to AIGOV-728

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

AIGOV-728

@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-period-helpers branch from 437be74 to 820008f Compare November 12, 2026 10:20
Base automatically changed from ssncf/ai-spend-overview-endpoint to main November 13, 2026 10:03
@ssncferreira
ssncferreira temporarily deployed to main November 13, 2026 10:03 — with GitHub Actions Inactive
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-period-helpers branch from 820008f to 73134c4 Compare November 13, 2026 10:58
@ssncferreira
ssncferreira temporarily deployed to main November 13, 2026 10:58 — with GitHub Actions Inactive
@ssncferreira
ssncferreira temporarily deployed to main November 13, 2026 12:42 — with GitHub Actions Inactive
@ssncferreira ssncferreira changed the title fix(enterprise/coderd): show the retention start when an AI spend period starts too early fix(enterprise/coderd): show the retention start and test the AI spend period helpers Nov 13, 2026
@ssncferreira
ssncferreira temporarily deployed to main November 13, 2026 12:43 — with GitHub Actions Inactive
@ssncferreira ssncferreira changed the title fix(enterprise/coderd): show the retention start and test the AI spend period helpers fix: show the retention start and test the AI spend period helpers Nov 13, 2026
@ssncferreira
ssncferreira temporarily deployed to main November 13, 2026 12:44 — with GitHub Actions Inactive
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-period-helpers branch from 73134c4 to b5bfb05 Compare November 18, 2026 13:48
@ssncferreira
ssncferreira removed this pull request from stack #32171 November 18, 2026 13:49
@ssncferreira
ssncferreira changed the base branch from main to ssncf/ai-spend-user-details November 18, 2026 13:49
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-period-helpers branch 6 times, most recently from ab776e8 to 7103f6c Compare November 19, 2026 11:56
Base automatically changed from ssncf/ai-spend-user-details to main November 19, 2026 14:59
@ssncferreira
ssncferreira force-pushed the ssncf/ai-spend-period-helpers branch from 7103f6c to 5907cd2 Compare November 26, 2026 18:45
@ssncferreira ssncferreira changed the title fix: show the retention start and test the AI spend period helpers refactor: share the AI Gateway retention and test the AI spend period helpers Nov 26, 2026
@ssncferreira
ssncferreira removed this pull request from stack #32389 November 26, 2026 18:49
@ssncferreira
ssncferreira removed this pull request from stack #32792 November 26, 2026 19:42

This branch was previously deployed

1 inactive (outdated) deployment
main — 7103f6c0 Deployed Nov 19, 2026 by ssncferreira via cla #260246
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.

1 participant