Skip to content

test(cloud): cover dashboard registry with PostgreSQL - #1614

Merged
dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:test/managed-dashboard-postgres-1599
Oct 2, 2026
Merged

dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:test/managed-dashboard-postgres-1599

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked Issue

Closes #1599

Test-only follow-up to merged #1609. Issue #1599 retains status:approved; no production changes are included.

🏷️ PR Type

  • type:bug — Bug fix
  • type:feature — New feature
  • type:question — Tracked question
  • type:docs — Documentation only
  • type:refactor — Refactoring
  • type:chore — Test coverage
  • type:breaking-change — Breaking change

📝 Summary

  • Add four PostgreSQL-backed regressions for empty registered projects, registration cache refresh, registry failure recovery and managed content outside the legacy allowlist.
  • Reuse per-test schema isolation, with no injected dashboard cache/model and no production behavior changes.
  • Keep this follow-up to one file and 169 added lines; fix(cloud): align managed dashboard visibility with project grants #1609 already merged the dashboard fix.

📂 Changes

File Change
internal/cloud/cloudstore/dashboard_registry_integration_test.go Four real-SQL dashboard regressions using existing isolated-store helper

🧪 Test Plan

Current branch (a7d1a277, base 772daf6a)

  • go test ./internal/cloud/cloudstore ./internal/cloud/cloudserver -count=1 — both passed (0.600s / 3.367s).
  • go test ./internal/cloud/cloudstore -run '^TestDashboardRegistryPostgres' -count=1 -v — four intended skips because CLOUDSTORE_TEST_DSN is absent; NOT PostgreSQL execution evidence.
  • git diff --check and git diff --check origin/main...HEAD — clean; one-file scope and clean worktree verified.
  • PostgreSQL rerun on refreshed main — not run; temporary cluster had already been stopped.

Prior SQL execution of the identical test file (31f3774f)

  • PostgreSQL 18.6 disposable localhost cluster, identity checked before writes: CLOUDSTORE_TEST_DSN=<isolated test DSN> go test ./internal/cloud/cloudstore -run '^TestDashboardRegistryPostgres' -count=1 -v — four passed, zero skips.
  • Same focused selector with -count=2 — passed.
  • Same DSN with go test ./internal/cloud/cloudstore ./internal/cloud/cloudserver -count=1 — passed; aggregate skip counts not captured.
  • Independent SQL spot check — four passed, zero skips (1.104s).
  • Owned cluster stopped; pg_ctl reported no server and loopback port was free. Logs retained. Existing schema cleanup ignores DROP errors; residual-schema absence not independently queried.

This is test-only coverage of already-fixed behavior; no production changes were made to manufacture a new RED/GREEN cycle. Initial fixture mistakes were corrected before successful SQL runs.

🤖 Automated Checks

CI is pending until it actually runs for this PR. CI currently provides no PostgreSQL service/DSN, so green CI alone does not prove the gated SQL tests executed. Full unit/E2E/plugin, lint and applicable platform/policy outcomes must be read from this PR's actual checks, not copied from #1609.

✅ Contributor Checklist

💬 Notes for Reviewers

Native review review-7e78cf3375deb7b7 approved the current one-file committed slice and exact acknowledgement completed. No merge is requested by this automation.

Rollback: revert the single test-only commit; production implementation from #1609 is unaffected.

Summary by CodeRabbit

  • Tests
    • Expanded integration coverage for project registration, scoped access, and recovery after registry query failures.
    • Added checks for which project content and statistics are visible under managed grants and legacy access.

Verify empty registrations, cache refresh, registry error recovery and managed scope using isolated SQL-backed stores.
@dnlrsls dnlrsls added the type:chore Maintenance/tooling label Oct 2, 2026
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a024274f-d532-4c11-bee2-c4f3d8b27fd4

📥 Commits

Reviewing files that changed from the base of the PR and between 772daf6 and a7d1a27.

📒 Files selected for processing (1)
  • internal/cloud/cloudstore/dashboard_registry_integration_test.go

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


📝 Walkthrough

Walkthrough

Adds PostgreSQL integration tests for dashboard project registration and access scopes. The tests cover empty registered projects, registration visibility, registry query recovery, managed-project grants, legacy access, and empty grant sets.

Changes

Dashboard registry integration tests

Layer / File(s) Summary
Registry visibility and recovery
internal/cloud/cloudstore/dashboard_registry_integration_test.go
Tests that registered projects without content appear in inventory and detail, that a newly created scoped store sees a newly registered project, and that project listing succeeds after registry query failure is recovered.
Managed-project access scopes
internal/cloud/cloudstore/dashboard_registry_integration_test.go
Tests that a store granted one managed project sees its content and statistics, that unscoped access remains limited to the legacy allowlist, and that an empty grant set exposes no projects or content.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: gentleman-programming

Merge Risk: ⚪ Minimal · up to a7d1a

The added coverage has no identified merge-blocking defect. Run the PostgreSQL-backed tests when the test database is available.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the test-only change and the PostgreSQL dashboard registry coverage added by the pull request.
Linked Issues check ✅ Passed No active directly linked issue targets remain. Issue #1599 is closed and completed, so its acceptance criteria provide historical context only and do not impose coding requirements on this pull reque…
Out of Scope Changes check ✅ Passed The pull request adds only PostgreSQL integration tests in internal/cloud/cloudstore/dashboard_registry_integration_test.go. The tests cover dashboard registry behavior described by historical issue…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@dnlrsls
dnlrsls added this pull request to the merge queue Oct 2, 2026
Merged via the queue into Gentleman-Programming:main with commit cd6fc63 Oct 2, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:chore Maintenance/tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cloud): managed principals see an empty project list in the dashboard

1 participant