mpg: route attach connection info through the public API - #5191
Draft
tripledoublev wants to merge 2 commits into
Draft
tripledoublev wants to merge 2 commits into
tripledoublev wants to merge 2 commits into
Conversation
tripledoublev
force-pushed
the
vincent/mpg-attach-public-connection-info
branch
2 times, most recently
from
September 8, 2026 20:06
15af7e2 to
c53a700
Compare
Retrieve MPG attach connection information through the public API, falling back to the legacy bundle only on classified cluster or default-credential 404s. Fetch default credentials only when no username is selected. Explicit and interactively selected users use their own credentials without being blocked by an unrelated default-user lookup. Reject failed clusters and missing pooler hosts or ports before requesting credentials. Preserve database and secret-name overrides, legacy fallback behavior, and authoritative non-404 errors. Keep the change scoped to attach and cover public success, credential selection, fallback, readiness, and failure handling.
tripledoublev
force-pushed
the
vincent/mpg-attach-public-connection-info
branch
from
September 8, 2026 20:23
c53a700 to
2834f7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fly mpg attachstill fetches the legacy cluster response to get its base connection URI. This change builds that connection information from the public pooler endpoint and user credentials instead.Classified 404 responses retain the legacy fallback. Other errors stop before app secrets are written. Missing pooler endpoints are rejected before fetching credentials. The public path keeps the existing
fly-userandfly-dbdefaults, while explicit user and database selections remain supported.Generated connection strings preserve the
postgresql://scheme used by the legacy API, including compatibility with SQLAlchemy. Attachment creation continues to use the existing public attachment endpoint.Validation:
DATABASE_URLwritten to the secrets API, including its scheme.postgresql://, and successfully queried the database from an app Machine using the attached secret.