auth0-deploy-cli icon indicating copy to clipboard operation
auth0-deploy-cli copied to clipboard

Allow partial exports/imports

Open philippefutureboy opened this issue 1 year ago • 0 comments

Checklist

Describe the problem you'd like to have solved

Using the export command (dump in node) result in an error if there is no credit card associated with the tenant, as logStream retrieval requires a verified credit card on file:

Error: Problem loading tenant data from Auth0 Forbidden: There must be a verified credit card on file to perform this operation
    at YAMLContext.<anonymous> (.../auth0/node_modules/auth0-deploy-cli/lib/context/yaml/index.js:144:23)
    at Generator.throw (<anonymous>)
    at rejected (.../auth0/node_modules/auth0-deploy-cli/lib/context/yaml/index.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

This prevents us from keeping our tenants synced across environments. It didn't use to be the case, but since we upgraded recently from 7.15.2 to 7.24.3 as part of our migration from rules to actions, this breaks the workflow. Log Stream is an opt-in feature (that we don't use in paid and unpaid tenants) so I don't understand why this would be a breaking change in a non-major version of auth0-deploy-cli.

Describe the ideal solution

Add a CLI & node interface option "exclude":

CLI: Either comma separated or repeated flag:

--exclude logStream,other
# or
--exclude logStream --exclude other

node:

const { dump } = require("auth0-deploy-cli");

await dump({
    output_folder: ...
    format: "yaml",
    config: localConfig,
    exclude: ["logStream"]
});

This would most likely require an --exclude flag on the import command as well, to avoid the auth0-deploy-cli from deleting existing resources due to their absence from the local tenant YAML manifest.

Alternatives and current workarounds

None, exporting the tenant info fails. We could instrument the package directly, but that's a lot of work, and unadvisable.

Additional context

No response

philippefutureboy avatar Oct 28 '24 18:10 philippefutureboy