Skip to content

fix(lakebase): follow next_page_token when listing Postgres projects - #161

Open
karen-amaya wants to merge 1 commit into
databrickslabs:masterfrom
karen-amaya:fix/lakebase-postgres-projects-pagination
Open

fix(lakebase): follow next_page_token when listing Postgres projects#161
karen-amaya wants to merge 1 commit into
databrickslabs:masterfrom
karen-amaya:fix/lakebase-postgres-projects-pagination

Conversation

@karen-amaya

Copy link
Copy Markdown

Summary

_lookup_via_postgres_api calls GET /api/2.0/postgres/projects once without following next_page_token. That endpoint paginates at 10 projects/page, so in workspaces with more than 10 Postgres projects, an project past page 1 is invisible to this lookup — causing the misleading error "No Lakebase Autoscaling endpoint matched... legacy Provisioned instances are not supported", even with a valid, correctly-permissioned project.

Confirmed in production (2026-09-04): the project was on page 2 of 19. Fix: loop over next_page_token until exhausted.

Linked Issue / milestone

Closes #160

Plan

N/A — single-file fix, no formal plan doc for this one.

Type of change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — no behaviour change
  • test — tests only
  • perf — perf improvement
  • ci / build / chore — tooling

Author checklist

  • Conventional Commit PR title (<type>(<scope>): <subject>).
  • changelogs/<today>.log updated with title + context + numbered changes + files + test result.
  • Tests added or modified for every behaviour change.
  • uv run pytest tests/<scope>/ green locally.
  • pre-commit run --all-files clean (or skipped hooks documented).
  • If src/agents/** or any MLflow-traced LLM path changed:
    • SPEC.md present in .planning/<slug>/.
    • tests/eval/datasets/<agent>/dataset.jsonl has ≥20 examples (new) or ≥10 (change).
    • MLflow eval run URI in PR body below.
    • Judge score ≥ baseline + delta, or explicit waiver here.
  • If src/mcp-server/** changed: uv run pytest tests/mcp/ -m mcp green.
  • No gsd-* references re-introduced.

MLflow eval run

Test plan

  • uv run pytest tests/ -m "not e2e and not property and not eval" --cov-fail-under=90
  • Per-package coverage thresholds (scripts/check_coverage.py) green for touched packages.
  • If new MCP tool: uv run pytest tests/mcp/integration/test_tool_schemas.py includes it.

Reviewer hint

See docs/PR_REVIEW_CHECKLIST.md. Numbered items map 1:1 to comments — #3: missing OntoBricksError subclass for new condition is more useful than "fix error handling".

@karen-amaya
karen-amaya requested a review from a team as a code owner September 4, 2026 18:56
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[BUG]: Lakebase auth: Postgres project lookup misses projects beyond page 1 (unfollowed pagination)

2 participants