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

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

Open yossarian21 opened this issue 1 year ago • 0 comments

Checklist

  • [X] I have looked into the README and have not found a suitable solution or answer.
  • [X] I have looked into the documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have upgraded to the latest version of this tool and the issue still persists.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

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

yossarian21 avatar Mar 18 '24 15:03 yossarian21