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
248 stars 155 forks source link

Import fails when processing the type emailProvider and creating a custom email provider action in the same execution #950

Open jeanfdmelo opened 3 months ago

jeanfdmelo commented 3 months ago

Checklist

Description

When importing the emailProvider configuration and creating a custom email provider action via a0deploy import, the operation fails during the processChanges stage when processing the emailProvider type.

Expectation

The processing of the emailProvider type does not fail during a0deploy import if the required action is also created in the same import.

Workaround To overcome this, we first create the action and then add the emailProvider configuration.

  1. Run a0deploy import without the emailProvider property in tenant.yml. This will create the action.
  2. Then, run a0deploy import again, this time with the emailProvider property in place. Since the action has already been created, the processing of emailProvider will no longer fail."

However, we expect this to work in a single execution.

Reproduction

1 - Given the tenant.yml configuration has the emailProvider type being enabled and the custom email provider action being created in the same import.

tenant.yml

emailProvider:
  name: custom
  credentials: {}
  enabled: true
actions:
  - name: Custom Email Provider
  (...)
triggers:
  custom-email-provider:
    - action_name: Custom Email Provider
      display_name: Custom Email Provider

2 - When import is executed

a0deploy import --input_file tenant.yaml

3 - Then command fails with the error message:

Problem running command import during stage processChanges when processing type emailProvider No deployed action of type custom-email-provider was found

Deploy CLI version

7.24.2

Node version

20.14.0