Log if pipeline creation limit might be exceeded
What does this MR do and why?
Previously if a user pushed more than 4 refs to a pipeline, the PostReceive Sidekiq job would pick the first 4 and ignore the rest. This commit adds a log message to warn the admin this might be happening. Note that we can't be sure if a given ref would actually have a pipeline created for it since the CI rules would need to be evaluated to determine that.
Sample log message:
{
"severity": "INFO",
"time": "2024-03-18T22:42:14.742Z",
"correlation_id": "01HS9VNFSWXCKJH0W0NDCK5WNV",
"meta.caller_id": "PostReceive",
"meta.remote_ip": "127.0.0.1",
"meta.feature_category": "source_code_management",
"meta.user": "root",
"meta.user_id": 1,
"meta.project": "root/go-micro-test",
"meta.root_namespace": "root",
"meta.client_id": "user/1",
"meta.root_caller_id": "POST /api/:version/internal/post_receive",
"message": "Some pipelines may not have been created because ref count exceeded limit",
"ref_limit": 4,
"total_ref_count": 5,
"possible_omitted_refs": [
"refs/tags/test9"
],
"possible_omitted_ref_count": 1
}
Relates to #350886
How to set up and validate locally
- Check out this branch.
- Restart Sidekiq:
gdk restart rails-background-jobs
- Clone a project.
- Create 5 tags or branches.
- Run
git push --all
. -
application_json.log
should have that message.
Edited by Stan Hu