[HDX-12246] migrate: support customer-required clusters (6.4) - #74
Open
barottomartin wants to merge 1 commit into
Open
[HDX-12246] migrate: support customer-required clusters (6.4)#74barottomartin wants to merge 1 commit into
barottomartin wants to merge 1 commit into
Conversation
Since turbine-api 6.3 (HDX-11681), project creation requires an existing
Customer on the target cluster, and tables may only reference storages and
credentials that are members of the project's customer (HDX-11643). The
`migrate` command previously forwarded the source project body verbatim,
which fails against 6.4 targets.
Add a customer-resolution and membership pre-flight step to the global
`migrate` command:
- New `migrate/customer.py`:
- Detects whether the target requires a customer from the projects
OPTIONS metadata, so pre-6.3 targets are untouched (no version checks).
- Resolves the target customer from `--target-customer` (name or UUID),
an existing target project's immutable customer, or an interactive
picker; offers to create the customer when missing, mapping 401/403 to
an actionable insufficient-permissions message.
- Registers the migrated table's non-default storages and autoingest
credentials with the customer (add_storage / add_credential), always
behind a confirmation, running before any resource is created so a
decline or 403 never leaves a half-migrated project.
- `resources.py`: strip the source customer/org, inject the resolved
customer on project create, and run the membership pre-flight.
- `commands.py`: add `--target-customer` / `-tc` and document it.
Verified live across versions: 6.4 AIO (flag, picker, creation offer,
inheritance, conflicting-flag warning, storage membership accept/decline)
and a local v6.0.17 pre-customer cluster (old->new upgrade injects the
customer; new->old skips all customer logic).
Bumps hdxcli to 1.0.84.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Retrofits the global
hdxcli migratecommand for turbine-api 6.4's multi-org breaking changes.Since turbine-api 6.3 (HDX-11681), project creation requires an existing Customer on the target cluster, and tables may only reference storages/credentials that are members of the project's customer (HDX-11643).
migratepreviously forwarded the source project body verbatim (carrying the source cluster's customer UUID), which fails against 6.4 targets — exactly the break flagged on the ticket.Changes
migrate/customer.pyOPTIONSmetadata, so pre-6.3 targets are untouched (no version checks).--target-customer(name or UUID) → an existing target project's immutable customer → an interactive picker; offers to create the customer when missing, mapping 401/403 to an actionable insufficient-permissions message.add_storage/add_credential), always behind a confirmation, running before any resource is created so a decline or 403 never leaves a half-migrated project.resources.py— strip the sourcecustomer/org, inject the resolved customer on project create, run the membership pre-flight.commands.py— add--target-customer/-tcand document it.Scope
Per the ticket comment, this covers only the global
migratecommand. The config-onlyproject migrate(and the sharedmigrate_resource_configengine) have the same break and are left as a follow-up;hdxcli project createis also affected and out of scope here.Testing
tests/test_migrate_customer.py(resolution precedence, OPTIONS gating, collectors, default-candidate rule). Full suite green.v6.3.0-rc.1-193): flag resolution, interactive picker, customer creation offer, existing-project inheritance, conflicting-flag warning, and the storage-membership pre-flight (decline aborts before any creation; accept runsadd_storageand the table create passes validation).Notes
🤖 Generated with Claude Code