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
- Find or create an Issue without a project
- Track the issue:
Elastic::ProcessBookkeepingService.track!(issue) - Tail the elasticsearch logs
- Process the ref:
::Elastic::ProcessBookkeepingService.new.execute - Note that there's an error message in the logs but the service doesn't fail
- (Optional) Try doing the same on master and note that the service fails
Edited by Changzheng Liu