Handle Elastic issue references when project is nil

What does this MR do and why?

Implements gitlab-com/gl-infra/production#18480 (comment 2085851834) to fail gracefully and log if there are Issue references without a project by returning early.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Example log:

{"severity":"WARN","time":"2024-09-02T10:11:15.352Z","message":"Reference as_indexed_json is blank, removing from the queue","ref":"Issue 643 643"}

How to set up and validate locally

  1. Find or create an Issue without a project
  2. Track the issue: Elastic::ProcessBookkeepingService.track!(issue)
  3. Tail the elasticsearch logs
  4. Process the ref: ::Elastic::ProcessBookkeepingService.new.execute
  5. Note that there's an error message in the logs but the service doesn't fail
  6. (Optional) Try doing the same on master and note that the service fails

Related to gitlab-com/gl-infra/production#18480 (closed)

Edited by Changzheng Liu

Merge request reports

Loading