When deleting a pipeline, only some of the cache structures were being
expired, but not the full pipeline list. We have to synchronously
schedule a pipeline cache expiration because the pipeline will be
deleted if the Sidekiq expiration job picks it up. To do this, properly
extract all the logic buried in the Sidekiq worker into a service, and
then call the service.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60469
`project.pipeline_status.has_status?` is cached, which can lead to Error
500s in the UI if the this condition is used to check whether a pipeline
exists for a commit. We now expire the cache to ensure that the
information is consistent.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59453
AuditEventService isn't equipped to handle logging of the destruction of
entities such as CI pipelines. It's a project-level event that operates
on a pipeline. The current log doesn't even indicate that the pipeline
is being destroyed.
This is a CE backport of
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9105. We're
removing the auditing call because it breaks the EE implementation.