auth0 / auth0-deploy-cli

The Auth0 Deploy CLI is a tool that helps you manage your Auth0 tenant configuration. It integrates into your development workflows as a standalone CLI or as a node module.
MIT License
244 stars 147 forks source link

Actions export uses absolute path that is not portable between development environments #899

Open yossarian21 opened 6 months ago

yossarian21 commented 6 months ago

Checklist

Description

This relates to https://github.com/auth0/auth0-deploy-cli/issues/873 but is an issue on the export side. I'm using directory exports. When my action is exported, it writes an absolute path to the code in the Action manifest:

{
  "name": "Prompt for MFA",
  "code": "/app/auth0/infra/actions/Prompt for MFA/code.js",
  "runtime": "node18-actions",
  "status": "built",
  "dependencies": [],
  "secrets": [],
  "supported_triggers": [
    {
      "id": "post-login",
      "version": "v3"
    }
  ],
  "deployed": true
}

But this path is different on other developer machines (so if someone else runs the export, the path changes unexpectedly, and they can only run the import if they're using the same source code path) and our build environment (so our deployment pipeline fails because it can't find the file).

I am providing an absolute path as the output_folder; e.g. /app/auth0/infra is the path that was provided to the export command.

Expectation

The export should write the code as a relative path; ideally, relative to the output_folder provided to the CLI.

I would be willing to submit a PR for this change if you want it. Should it be configurable?

Reproduction

  1. Given I have an Auth0 tenant with an Action configured
  2. When I run the export command
  3. Then the Action manifest contains an absolute path to the code file
  4. And the path is not portable to other machines/build environments

Deploy CLI version

7.21.0

Node version

18.16.0