This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new aa0118806 feat: add deployment URL mapping to webhook plugin (#8000)
aa0118806 is described below
commit aa011880625edfcc3af9f5c3943391fd5b33dadd
Author: Kévin Toublanc <[email protected]>
AuthorDate: Thu Sep 19 05:16:26 2024 +0200
feat: add deployment URL mapping to webhook plugin (#8000)
---
backend/plugins/webhook/api/deployments.go | 2 ++
config-ui/src/plugins/register/webhook/components/utils.ts | 1 +
2 files changed, 3 insertions(+)
diff --git a/backend/plugins/webhook/api/deployments.go
b/backend/plugins/webhook/api/deployments.go
index 366cf11b7..cc5b97827 100644
--- a/backend/plugins/webhook/api/deployments.go
+++ b/backend/plugins/webhook/api/deployments.go
@@ -43,6 +43,7 @@ type WebhookDeploymentReq struct {
Result string `mapstructure:"result"`
Environment string `validate:"omitempty,oneof=PRODUCTION STAGING
TESTING DEVELOPMENT"`
Name string `mapstructure:"name"`
+ Url string `mapstructure:"url"`
// DeploymentCommits is used for multiple commits in one deployment
DeploymentCommits []WebhookDeploymentCommitReq
`mapstructure:"deploymentCommits" validate:"omitempty,dive"`
CreatedDate *time.Time
`mapstructure:"createdDate"`
@@ -209,6 +210,7 @@ func CreateDeploymentAndDeploymentCommits(connection
*models.WebhookConnection,
deployment.StartedDate = request.StartedDate
deployment.FinishedDate = request.FinishedDate
deployment.Result = request.Result
+ deployment.Url = request.Url
if err := tx.CreateOrUpdate(deployment); err != nil {
logger.Error(err, "failed to save deployment")
return err
diff --git a/config-ui/src/plugins/register/webhook/components/utils.ts
b/config-ui/src/plugins/register/webhook/components/utils.ts
index 73824d148..e41721614 100644
--- a/config-ui/src/plugins/register/webhook/components/utils.ts
+++ b/config-ui/src/plugins/register/webhook/components/utils.ts
@@ -41,6 +41,7 @@ export const transformURI = (prefix: string, webhook:
IWebhook, apiKey: string)
"startedDate": "2023-01-01T12:00:00+00:00",
"finishedDate": "2023-01-01T12:00:00+00:00",
"result": "SUCCESS",
+ "url": "Optional. The URL of the deployment",
"deploymentCommits":[
{
"repoUrl": "your-git-url",