diff --git a/doc/user/project/integrations/webhook_events.md b/doc/user/project/integrations/webhook_events.md index fda778aa167dbee0d89dcd1a0dc7d684168d102a..bd5baaeb9be5027a7e0656369b462b0fb214146a 100644 --- a/doc/user/project/integrations/webhook_events.md +++ b/doc/user/project/integrations/webhook_events.md @@ -1142,7 +1142,8 @@ Payload example: "key": "NESTOR_PROD_ENVIRONMENT", "value": "us-west-1" } - ] + ], + "url": "http://example.com/gitlab-org/gitlab-test/-/pipelines/31" }, "merge_request": { "id": 1, diff --git a/lib/gitlab/data_builder/pipeline.rb b/lib/gitlab/data_builder/pipeline.rb index ecb0cc20a64ee65d76e8d2823bc8fff378cb9bc0..044d3bb50cd2c80fdc87f5ab7e098fff3042a952 100644 --- a/lib/gitlab/data_builder/pipeline.rb +++ b/lib/gitlab/data_builder/pipeline.rb @@ -77,7 +77,8 @@ def hook_attrs(pipeline) finished_at: pipeline.finished_at, duration: pipeline.duration, queued_duration: pipeline.queued_duration, - variables: pipeline.variables.map(&:hook_attrs) + variables: pipeline.variables.map(&:hook_attrs), + url: Gitlab::Routing.url_helpers.project_pipeline_url(pipeline.project, pipeline) } end diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb index eb348f5b497baa320f8746d2c9defc9ea4d4c839..a379af7483b92eec04c92f0fc475fffccef20dd7 100644 --- a/spec/lib/gitlab/data_builder/pipeline_spec.rb +++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb @@ -33,6 +33,7 @@ expect(attributes[:iid]).to eq(pipeline.iid) expect(attributes[:source]).to eq(pipeline.source) expect(attributes[:status]).to eq(pipeline.status) + expect(attributes[:url]).to eq(Gitlab::Routing.url_helpers.project_pipeline_url(pipeline.project, pipeline)) expect(attributes[:detailed_status]).to eq('passed') expect(build_data).to be_a(Hash) expect(build_data[:id]).to eq(build.id)