Configure GitLab CI for Deploy Change Investigator
Send build and deployment webhooks to track changes
Send build and deployment data from GitLab CI/CD pipelines to the Deploy Change Investigator using webhook jobs.
Before you begin
Deploy Change Investigator setup: Build and deploy webhook integrations created in AI SRE. Go to Deploy Change Investigator to create webhook endpoints.
GitLab project access: Maintainer role to edit
.gitlab-ci.ymland configure CI/CD variables.Webhook URLs: Build and deploy webhook URLs from the AI SRE integrations page.
Store webhook URLs as CI/CD variables
Store webhook URLs securely in GitLab CI/CD variables:
In your project, go to Settings > CI/CD.
Expand the Variables section.
Click Add variable.
Configure build webhook:
Key:
AISRE_BUILD_WEBHOOK_URLValue: Build webhook URL from AI SRE
Type: Variable
Flags: Protect variable, Mask variable
Click Add variable
Repeat for deploy webhook:
Key:
AISRE_DEPLOY_WEBHOOK_URLValue: Deploy webhook URL from AI SRE
Configure build webhooks
Add a webhook notification job to your pipeline after build completes.
Docker build pipeline
GitLab CI predefined variables
GitLab CI provides these predefined variables automatically:
CI_COMMIT_SHA
Full commit SHA
1ecfd275763eff1d6b4844ea3168962458c9f27a
CI_COMMIT_SHORT_SHA
Short commit SHA (first 8 characters)
1ecfd275
CI_COMMIT_REF_NAME
Branch or tag name
main
CI_PROJECT_PATH
Project path with namespace
group/project
CI_PROJECT_NAME
Project name only
project
CI_PROJECT_URL
Full project URL
https://gitlab.com/group/project
CI_PIPELINE_ID
Unique pipeline ID
1234567
CI_REGISTRY
GitLab Container Registry URL
registry.gitlab.com
Access variables using shell syntax: $CI_COMMIT_SHA or ${CI_COMMIT_SHA}
Configure deploy webhooks
Add webhook notification jobs to deployment pipelines after deployment completes.
Kubernetes deployment pipeline
Job execution conditions
Control when jobs execute using when and only keywords:
when: on_success
Run if previous jobs succeeded
when: on_failure
Run if previous jobs failed
when: always
Run regardless of previous job status
when: manual
Require manual trigger
only: [main]
Run only on specified branches
except: [develop]
Skip on specified branches
Example with conditions:
Multi-service deployments
For pipelines that deploy multiple services, send all services in one webhook:
Reusable templates
Create reusable webhook notification templates using include:
Create template file
Create .gitlab/ci/webhook-notify.yml:
Use templates
Include and extend templates in main pipeline:
Map service and version fields
The Deploy Change Investigator requires exact matches between build and deploy webhooks:
service.name
services[].service
✅ Required
artifact.version or service.version
services[].version
✅ Required
Use the same variable ($CI_COMMIT_SHORT_SHA) in both build and deploy webhooks to ensure versions match.
Test webhooks
Test build webhook
Trigger a build and confirm the webhook reaches AI SRE:
Push a commit or create a merge request.
Check the pipeline job logs for the
notify-buildjob.Verify the curl command executed successfully.
In the AI SRE left navigation, go to Integrations.
Click the More icon (...) on the BUILD integration.
Select Debug.
Verify the webhook appears with correct payload.
Test deploy webhook
Trigger a deployment and confirm the webhook reaches AI SRE:
Trigger the deployment pipeline.
Check the
notify-deployjob logs.In the AI SRE left navigation, go to Integrations.
Click the More icon (...) on the DEPLOY integration.
Select Debug.
Verify the webhook appears.
Verify correlation
After sending both webhooks:
In the AI SRE left navigation, go to Change Management.
Deployments should appear linked to builds.
Click a deployment to see artifact versions and commit information.
Troubleshooting
Next steps
Go to Deploy Change Investigator for complete setup instructions.
Go to AI Agent RCA to learn how the AI agent uses change detection during incidents.
Go to Configure Jenkins for webhook setup in Jenkins pipelines.
Last updated
Was this helpful?