Skip to content

fix(api): restore base build - drop removed Session.Role from handler_purchases_test (regression from #528) - #975

Merged
cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/hotfix-session-role-528
Jun 5, 2026
Merged

cristim merged 1 commit into
feat/multicloud-web-frontendfrom
fix/hotfix-session-role-528

Conversation

@cristim

@cristim cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

Changes

  • internal/api/handler_purchases_test.go line 1644: remove Role: "admin" from adminSession literal; add mockAuth.grantAdmin() so HasPermissionAPI is properly stubbed.
  • internal/api/handler_purchases_guards_test.go: gofmt formatting only (semicolons split to newlines, caught by pre-commit hook).

Verification

  • go vet ./internal/api/: no issues
  • gofmt -l: clean
  • go build ./...: success
  • go test ./internal/api/ -count=1: 1458 passed
  • SKIP=terraform_validate pre-commit run --all-files: all passed

Test plan

…_purchases_test (regression from #528)

PR #528 introduced TestHandler_getPurchaseDetails_NotFound_IsClientError
using Role:"admin" in a Session literal, but Session.Role was removed in
#940/#907. This caused go vet to fail on internal/api, breaking the base
build. Replace the stale Role field with mockAuth.grantAdmin() following
the established pattern used throughout handler_purchases_test.go.

Also includes gofmt whitespace fixes to handler_purchases_guards_test.go
caught by the pre-commit hook (semicolons split to newlines).
@cristim cristim added triaged Item has been triaged priority/p1 Next up; this sprint severity/high Significant harm urgency/now Drop other things impact/all-users Affects every user effort/xs Trivial / one-liner type/bug Defect labels Jun 5, 2026
@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 796b4cf4-ad48-443f-aa43-4ef404e8a8f4

📥 Commits

Reviewing files that changed from the base of the PR and between 62c8f63 and 898d581.

📒 Files selected for processing (2)
  • internal/api/handler_purchases_guards_test.go
  • internal/api/handler_purchases_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hotfix-session-role-528

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

@cristim

cristim commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

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 20ce559 into feat/multicloud-web-frontend Jun 5, 2026
4 checks passed
@cristim
cristim deleted the fix/hotfix-session-role-528 branch July 27, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/all-users Affects every user priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/now Drop other things

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant