<#10370 fix: let `meltano hub` run outside a Melta...
# meltano-repo-activity
g
#10370 fix: let `meltano hub` run outside a Meltano project Pull request opened by ReubenFrankel Description
meltano hub list
and
meltano hub ping
fail outside a Meltano project with "must be run inside a Meltano project", although neither needs one. A user cannot browse the Hub before they create a project. This has been true since
meltano hub
arrived in
3.0.0
(#7989). Both commands now run anywhere. The commands took the project from
pass_project
, which refuses to run without one, and read the Hub settings from it. They now read an optional project from the context, as
meltano init
does. Outside a project, the Hub service reads each Hub setting from its environment variables, or else takes its default from the bundled setting definitions. •
meltano hub ping
and
meltano hub list
use
@click.pass_context
in place of
pass_project
, and build
MeltanoHubService(ctx.obj["project"])
. •
MeltanoHubService
takes an optional project. Without one, it reads
MELTANO_HUB_URL
,
MELTANO_HUB_API_ROOT
and
MELTANO_HUB_URL_AUTH
through the setting definitions, or else each default. •
builtin_settings()
loads the bundled setting definitions, and
ConfigService
and the Hub service share it. • The Hub service removes an old
X-Project-ID
from its shared session, as it already does for
Authorization
, so a request never carries the project ID of an earlier service. • The
hub
reference says that the command runs outside a project, and which settings it reads there. Outside a project,
meltano hub ping
reads Meltano Cloud for a logged-in user, and
MELTANO_HUB_URL
points it at another Hub. New tests cover the default Hub, the 3 environment variables, a logged-in user, a stale
X-Project-ID
, and
meltano hub list
with no project. They fail without the change. The CLI and core test suites show no new failures. Behaviour changes •
meltano hub list
and
meltano hub ping
succeed outside a project. • Outside a project, the Hub request carries no
X-Project-ID
, and the command sends no usage data, because there is no project to identify. • Inside a project,
meltano hub
no longer connects to the system database, which
pass_project
did before every command. A system database that cannot be reached no longer stops it. •
meltano hub list
and
meltano hub ping
no longer accept
--database-uri
, which only
pass_project
added and neither command used. 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 • None Summary by Sourcery Enable Hub listing and connectivity checks outside Meltano projects while preserving project-specific configuration when available. New Features: • Allow
meltano hub list
and
meltano hub ping
to run outside a Meltano project using bundled defaults and environment-based Hub settings. Bug Fixes: • Prevent Hub commands from failing with a project-required error when invoked outside a project. • Avoid sending project-specific headers and usage data for Hub requests made without a project. Enhancements: • Centralize loading of bundled setting definitions for reuse by configuration and Hub services. Documentation: • Document running the
hub
command outside a project and explain how Hub settings are selected there. Tests: • Add coverage for Hub service defaults, environment configuration, authenticated Cloud routing, header isolation, and projectless
hub list
execution. --- 🤖 Generated with Claude Code meltano/meltano