<#10335 feat: read the Hub that Meltano Cloud serv...
# meltano-repo-activity
g
#10335 feat: read the Hub that Meltano Cloud serves once logged in Pull request opened by ReubenFrankel Description A user who logs in with
meltano cloud auth login
still reads the same Hub as everyone else, so the account buys nothing:
meltano add
,
meltano lock
and
meltano hub list
return all 737 plugins that Meltano Hub indexes, whether or not Meltano supports them. A logged in user now reads the index that Meltano Cloud serves at
<https://app.meltano.com/api>
, which lists the plugins that Meltano supports, maintains and tests. The OAuth audience already named that API, so the token the login returns is the one it accepts. No existing user reads a different Hub. The Cloud index is reached only when the request carries a Cloud session and
hub_url
still holds its default, so a logged out user, a project that points
hub_url
at a Hub of its own, and a project that manages its own credentials with
hub_url_auth
all read the Hub they read before. The order, highest first, is
hub_api_root
,
hub_url_auth
, an explicit
hub_url
, a Cloud session, the default Hub. A logged out user does see one new info line. It names the Cloud Hub and
meltano cloud auth login
, and it appears once for each command that reads the Hub. A project that configures a Hub of its own gets nothing, because the line and the Hub choice both read
MeltanoHubService.has_configured_hub
, so the two cannot disagree. • Return
<https://app.meltano.com/api>
from
MeltanoHubService.hub_api_url
for a request that carries a Cloud session and no configured Hub. • Name the URL
CLOUD_API_ROOT
and read
AUTH_AUDIENCE
from it, because the audience is the same API. • Document the behaviour under
hub
and under the
hub_url
setting. • Log one info line for a logged out user, which names the Cloud Hub and the command that gives access. • Add 10 tests, covering each step of the order above and each case in which the line appears. The index cache keys on the URL, so the two indexes never mix, and a user who logs in or out reads a fresh index rather than the other one's. Verified against the real API with a Cloud session:
meltano hub list
returns 555 of those 737 plugins from
<https://app.meltano.com/api>
, and
meltano add --plugin-type extractor tap-github
fetches the definition and writes a lock artifact. Logged out, and with
MELTANO_HUB_URL
set,
meltano hub ping
reports
<https://hub.meltano.com/meltano/api/v1>
. The info line appears once for
hub ping
and once for
add
, and not for
install
,
run
or
config
, which never build the service. The Cloud index names its own default variants.
tap-github
resolves to the
matatika
variant rather than
meltanolabs
, so a logged in user who adds a plugin can get a different variant than before. A fixture defect fixed on the way
_no_cloud_session
was function scoped, but the
project
fixture is class scoped and builds a
MeltanoHubService
before any function scoped fixture of the first test in the class has run. On a contributor's machine that is logged in, that service therefore read the real stored credentials. It now reads the Cloud Hub as well, so the Hub tests fail for a logged in contributor and pass in CI. The fixture is now session scoped, which is what its own docstring already promised. Checklist • I have read the contribution guide Was generative AI tooling used to co-author this PR? • Yes (please specify the tool below) Generated-by: Claude Code following the agentic coding guidelines Related Issues • MEL-691 • Follows #10328 Summary by Sourcery Use the Meltano Cloud plugin index for authenticated users while preserving existing custom and default Hub behavior. New Features: • Route authenticated users without custom Hub settings to Meltano Cloud’s supported-plugin index while preserving configured Hub behavior. Bug Fixes: • Prevent developer Cloud credentials from affecting class-scoped Hub tests by isolating the test session from stored credentials. Enhancements: • Establish and test Hub selection precedence across API-root, Hub authentication, explicit Hub URL, Cloud session, and the default Hub. • Notify logged-out users that Cloud authentication provides access to Meltano’s supported Hub. Documentation: • Document that authenticated users read Meltano Cloud’s supported-plugin index and that custom Hub settings take precedence. Tests: • Add coverage for Cloud Hub selection, custom Hub overrides, default behavior, authentication notices, and session isolation. --- 🤖 Generated with Claude Code meltano/meltano