Skip to content

docs(schema): document recommendations cloud_account_id filter semantics + add tests#236

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
docs/issue-211-cloud-account-id-filter
May 3, 2026
Merged

docs(schema): document recommendations cloud_account_id filter semantics + add tests#236
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
docs/issue-211-cloud-account-id-filter

Conversation

@cristim
Copy link
Copy Markdown
Member

@cristim cristim commented May 3, 2026

Summary

Quirk surfaced

The fifth case (disabled-account exclusion) is enforced by the session-layer filterRecommendationsByAllowedAccounts after the SQL filter, not by SQL. The comment tables document this explicitly.

Test plan

  • go test ./internal/api/... -run TestGetRecommendations_AccountIDFilter -v — 7 subtests pass
  • go test ./internal/api/... -count=1 — 1016 tests pass
  • go test ./internal/config/... -count=1 — 476 tests pass

Closes #211

…ics + add tests (closes #211)

Add inline comment tables at the two code sites that implement the
account_ids → cloud_account_id SQL filter:

- internal/config/store_postgres_recommendations.go::buildRecommendationFilter
  documents the four SQL-layer cases (absent/NULL/match/no-match) and
  calls out the NULL = ANY(array) → NULL PostgreSQL semantic that
  silently excludes legacy ambient rows.

- internal/api/handler_recommendations.go::getRecommendations documents
  all five cases including the disabled-account case, which is enforced
  by the session-layer filterRecommendationsByAllowedAccounts (not the
  SQL filter), so future maintainers understand the two-layer design.

Add TestGetRecommendations_AccountIDFilter (6 subtests) in
handler_recommendations_test.go to pin each filter-case contract
end-to-end via the handler mock.

No production logic changed.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@cristim has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 33 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 980ea4e5-fc52-4805-8822-f031147083d4

📥 Commits

Reviewing files that changed from the base of the PR and between c84fd02 and e0ecad6.

📒 Files selected for processing (3)
  • internal/api/handler_recommendations.go
  • internal/api/handler_recommendations_test.go
  • internal/config/store_postgres_recommendations.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/issue-211-cloud-account-id-filter

Review rate limit: 0/5 reviews remaining, refill in 2 minutes and 33 seconds.

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

@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim cristim added priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-quarter Within the quarter impact/few Limited audience effort/s Hours type/docs Documentation triaged Item has been triaged labels May 3, 2026
@cristim
Copy link
Copy Markdown
Member Author

cristim commented May 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim cristim merged commit 6e1f9b5 into feat/multicloud-web-frontend May 3, 2026
4 checks passed
@cristim cristim deleted the docs/issue-211-cloud-account-id-filter branch May 3, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/few Limited audience priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/docs Documentation urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant