Banzai::ReferenceParser::BaseParser is executing queries that don't return results
On AR when executing queries like MergeRequest.where(ids: [])
it will execute the following query:
[1] pry(main)> MergeRequest.where(id: []).to_a
MergeRequest Load (7.7ms) SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."deleted_at" IS NULL AND 1=0 ORDER BY "merge_requests"."id" DESC
We don't need to execute that query and we can return an AR relation just using the none
method like we do in other places of the codebase. We can see a lot of this queries happening if you follow the this script to test the job. And that's because probably your database is incomplete, you just clone/forked the repository in your own instance.
This issue relates with the review of the post-receive-job
done for #18663 (moved)