I have 1 self-hosted Gitlab (v15.11.3 community edition using docker-compose.yml file) server and 2 self-hosted Jira instances (Let’s call them Jira A and Jira B).
Both of the Jira instances have a project with issue keys start with ABC (ABC-1, ABC-2, ABC-3, …).
The GitLab server was initially integrated with Jira A. Previously, this integration created a comment on issue ABC-500 in Jira A.
The comment looked like this:
John mentioned this issue in a commit of Folder1 / project_name on branch main:
Merge branch 'feature1' into 'main'
As you can see from the comment, Gitlab created this comment when a merge request mentions an issue key in Jira A.
About 8 months ago, I changed the Jira integration of Gitlab to connect to Jira B. At that time, the highest key number in project ABC was less than 500.
About 7 days ago, issue ABC-500 in Jira B was created. And after 2 days, Gitlab automatically created a comment in ABC-500 issue in Jira B.
The content of this comment was exactly the same as the one on issue ABC-500 in Jira A.
Why did Gitlab create a comment in ABC-500 in Jira B?
The commit that mentions ABC-500 hasn’t been updated since its creation date.
Here’s the time line that describes the things that have happened.
Gitlab created a comment in ABC-500 in Jira A ABC-500 in Jira B created
-------------|----------------------------------|------------------------------------|-------------------|-------------------------> time
Integration changed from Jira A to Jira B Gitlab created a comment in ABC-500 in Jira B
I don’t think the last thing should happen. But it happened. I’d like to know the reason behind it.
Here’s a log that I found in /var/log/gitlab/sidekiq/@40000000667c46d930ba2cac.u
file:
{"severity":"INFO","time":"2024-06-26T07:23:37.026Z","retry":3,"queue":"default","version":0,"store":null,"args":["242","60","{\"id\"=\u003e\"ba678de2d52a1aacdac5c95175b1b772c03f84dc\", \"message\"=\u003e\"Merge branch 'bugfix/feature1' into 'main'\\n\\ncommit message ABC-500\\n\\nSee merge request Folder1/project_name!5557\", \"parent_ids\"=\u003e[\"9404db120f6406a85743603b0835df34226608b5\", \"8ec25da1f1433b823802dbcabea3267650da4a63\"], \"authored_date\"=\u003e\"2023-10-20 15:42:32 +0800\", \"author_name\"=\u003e\"User Name\", \"author_email\"=\u003e\"user_name@mycompany.com\", \"committed_date\"=\u003e\"2023-10-20 15:42:32 +0800\", \"committer_name\"=\u003e\"User Name\", \"committer_email\"=\u003e\"user_name@mycompany.com\", \"trailers\"=\u003e{}, \"extended_trailers\"=\u003e{}, \"referenced_by\"=\u003e[]}","false"],"class":"ProcessCommitWorker","jid":"18032aa8e7a2c1129d28ee8e","created_at":"2024-06-26T07:23:34.958Z","correlation_id":"01J19PVA8Y3107P958PASAQP2W","meta.caller_id":"PostReceive","meta.remote_ip":"127.0.0.1","meta.feature_category":"source_code_management","meta.user":"user_name","meta.user_id":60,"meta.project":"Folder1/project_name","meta.root_namespace":"Folder1","meta.client_id":"user/60","meta.root_caller_id":"POST /api/:version/internal/post_receive","worker_data_consistency":"always","size_limiter":"validated","enqueued_at":"2024-06-26T07:23:34.959Z","job_size_bytes":638,"pid":548,"message":"ProcessCommitWorker JID-18032aa8e7a2c1129d28ee8e: start","job_status":"start","scheduling_latency_s":2.067695}
You can see that the merge request authored_date is 2023-10-20 15:42:32 +0800
. And the Jira comment was created at 2024-06-26T07:23:34.958Z
.
Why did ProcessCommitWorker process a commit that was created about 8 months ago?