Skip to content

Add deployment metadata when firing hooks

What does this MR do and why?

The deployment hooks worker can run against a runner's job request API call which lacks user, project or group identities in certain cases (such as shared runners).

In such cases it is difficult to locate the exact log that was responsible for firing a webhook or integration event related to a deployment because the volume of overall deployments per minute is pretty high (on SaaS) and no distinguishable fields are present to filter it any further.

This change adds ID values to the logging that allows us to track the deployment by ID or its associated project by ID. The expectation is that these IDs are always printed regardless of the scope of the runners.

This need came up during active investigation of support ticket https://gitlab.zendesk.com/agent/tickets/285549 (internal link)

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Open production Kibana, Sidekiq index
  2. Look for json.class as Deployments::HooksWorker
  3. Observe that some of the entries are missing meta.project, meta.user, or meta.job_id
  4. Observe also that such entries lack any distinguishing marks that associate them to a specific project/group/user

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

/cc @dkua1

Edited by Harsh Chouraria

Merge request reports

Loading