Webhooks for Environment Clone event

Hi,
When using webhooks can you only use deployment event triggers as in the api example? What event should I use that trigger after a cloning of an enviroment?

//Björn

    {

        "id": "97f109ee-b684-43fd-9777-2166b5d13b46",

        "created_at": "2022-09-14T11:08:05.678117Z",

        "updated_at": "2022-09-14T11:08:05.678118Z",

        "description": "This is a description",

        "target_url": "https://webhook.site/5dfd05ac-2880-4165-a365-a76524c08349",

        "events": [

            "DEPLOYMENT_STARTED"

        ],

        "project_names_filter": [

            "e723615a-6698-493c-afa6-d95647d79174"

        ],

        "environment_types_filter": [

            "DEVELOPMENT"

        ],

        "enabled": true,

        "target_secret_set": false

    }

We have registered this webhook but it does not trigger any webhook.

They should appear here but we don’t get anything: (click link)

We have also tried without project_names_filter but still nothing.

Is there any webhook history available?

Hi :wave:

Can you detail your use case? And I will give you a clear answer on how to do it. If the event does not exist we can add it easily.

@addiva-software , I’ve seen a bug with the DEPLOYMENT_STARTED event. Let me report it to our engineering team. cc @Melvin_Zottola

Hi,
After I successfully cloned an environment I want to trigger the webhook.

//Björn

Can I know what you’ll want to trigger when an environment is cloned? It will help to better understand your use case and provide the best implementation possible on our end.

We have a WebhookConnection for incoming requests in Azure Devops and it triggers a pipeline.
And we need the url and id from the cloned enviroment.

1 Like

Thank you. Let me come back to you asap Cc @a_carrano @Melvin_Zottola

Hi @bos79 ,

two questions:

  1. do you want to trigger this pipeline when you manually clone an environment or when the environment is created via the preview environment feature?
  2. “we need the url and id from the cloned environment” → do you need the Qovery console URL (Qovery Web Console | Deploy and Manage On-demand Environments on AWS, Remarkably Fast…) or the public URL provided by Qovery to expose your application (example: ze9845f9-ze74f3cef-gtw.zc221a994.rustrocks.cloud )

1: We want to clone the environment via the api so we can stop using github. The idea of the pipeline is to add a comment to a pull request in azure devops with the deployment URL when the deployment is finished so the developer and test person can be notified that the environment is ready for them.

We are able to clone environments but we can not get the webhook working. We have been able to register webhooks successfully and we can’t tell why they are not firing.

2: the public url

1 Like

Hello @addiva-software,
We are working on a fix, I keep you updated once it is released

thanks for your reply @bos79.

We won’t be able to provide you directly with the public URL in the webhook. In the webhook call you will get the environment id and you will need to call our API to get public URL for each exposed apps of that environment (via the endpoints /applications and application/link)

Hi @bos79 , let me know if you want a complete example of what you can do. I can provide it to ease your integration

Yes that would be great

Hello @addiva-software, the DEPLOYMENT_STARTED webhook event has been fixed.

Hi Melvin,
How do you trigger the DEPLOYMENT_STARTED webhook?
Can’t get it to work.

//Björn

@bos79 it’s triggered when the environment deployment is started. You can restart an environment and you should see that this event is triggered. I’ve just checked myself on my side