Bug: Deployment webhooks incorrectly send 'cancelled' events during pipeline cleanup for unexecuted manual jobs
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
After upgrading to GitLab 18 (From 17.11), when CI/CD pipeline cleanup runs, it incorrectly triggers "deployment: cancelled" webhook events for manual deployment jobs that were never executed. These webhook events should not be sent during the cleanup process for jobs that were never started.
Steps to reproduce
- Configure CI/CD pipeline cleanup in GitLab (Settings > CI/CD > Pipeline settings > Cleanup)
- Set up deployment webhooks for a project
- Create a pipeline with manual deployment jobs
- Leave the manual deployment jobs unexecuted (never click "Play")
- Wait for the cleanup process to run based on your configured retention policy
- Observe webhook payloads being sent with "cancelled" status for manual deployment jobs that were never executed
What is the current bug behavior?
When GitLab performs pipeline cleanup based on the configured retention policy, it incorrectly sends "deployment: cancelled" webhook events for manual deployment jobs that were never executed. Additionally, the job detail URLs included in these webhook payloads return 404 errors (as expected) because the jobs have been deleted during cleanup.
What is the expected correct behavior?
Pipeline cleanup should not trigger deployment webhook events for manual deployment jobs that were never executed. No webhook events should be sent for these jobs during the cleanup process.
Relevant logs and/or screenshots
Environment information
- GitLab version: v18.4.0-ee
- Installation type: On-premise
Possible fixes
The issue appears to be related to how GitLab 18 handles deployment status during the pipeline cleanup process. The system should not send deployment webhook events during cleanup for manual jobs that were never executed.
Additional context
This issue only appeared after upgrading to GitLab 18. Prior to the upgrade, pipeline cleanup did not trigger incorrect deployment webhook events for unexecuted manual jobs.