Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for action file in root folder during import #873

Open
6 tasks done
schazza opened this issue Dec 12, 2023 · 2 comments
Open
6 tasks done

Looking for action file in root folder during import #873

schazza opened this issue Dec 12, 2023 · 2 comments
Labels

Comments

@schazza
Copy link

schazza commented Dec 12, 2023

Checklist

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

Description

Since updating to 7.20.0 I get the following error when trying to import (a0deploy import --input_file ./src --config_file ./config/config-file.json):
Unable to load file C:\Git\auth0-cicd\src\code.js due to Error: ENOENT: no such file or directory, access 'C:\Git\auth0-cicd\src\code.js'

Expectation

The import should work with this command without a code.js file in the src folder. Alternatively if this file is required some information on what it should include should have been added in the release notes for 7.20.0.

Reproduction

  1. Given a source folder that a repo has been exported to on version 7.18.0
  2. When running the command a0deploy import --input_file ./src --config_file ./config/config-file.json
  3. Then the tenant should be updated

Deploy CLI version

7.20.0

Node version

18.17.1

@schazza schazza added the bug label Dec 12, 2023
@willvedd
Copy link
Contributor

As noted by the changelog for 7.20.0, there was added support for actions code files to be imported relative to the configuration file (#866). There must've been a regression included in that.

Looking closer, there is a loadFile function that allows for an absolute path or a path relative to the actions folder. The code that was added in #866 only accounts for the latter of the cases, which may explain this bug. Especially since you nest the config file in a config directory. I'm unable to recreate your specific issue, can you provide the action configuration file and the path of the exported code.js file?

@schazza
Copy link
Author

schazza commented Dec 14, 2023

Thanks for a fast response.

We have three actions that all look roughly like this:

{
  "name": "Add roles to ID token",
  "code": "code.js",
  "runtime": "node18",
  "status": "built",
  "dependencies": [],
  "secrets": [],
  "supported_triggers": [
    {
      "id": "post-login",
      "version": "v2"
    }
  ],
  "deployed": true
}

Path to the action configuration file is C:\Git\auth0-cicd\src\actions\Add roles to ID token.json
Path to the code.js file is C:\Git\auth0-cicd\src\actions\Add roles to ID token\code.js

We set this up following this example: https://github.com/auth0/auth0-deploy-cli/tree/master/examples/directory/actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants