GitLab.com for Jira Cloud app sometimes doesn't sync builds
Summary
It looks like synchronizing build data with Jira is inconsistent. We use the /rest/builds/0.1/bulk
endpoint to send data to Jira
Looking at the background worker logs we see some failures, but they don't seem to be related to the missing builds. However, if we check JiraConnect integration logs there are some error responses:
{"errorMessages":["Instantiation of [simple type, class com.atlassian.jira.plugin.devstatus.devinfo.schema.DevInformationTOImpl] value failed: null"]}
(Logged at Feb 8, 2022 @ 10:32:50.868)
and
Note: This has been a bug in our logging where we treaded HTTP 202
responses as "Unknown error"
. This has been fixed with !81986 (merged). More details here
{"errorMessages":["Unknown error"],"response":{"unknownIssueKeys":[],"acceptedBuilds":[{"pipelineId":"35741210","buildNumber":3}],"rejectedBuilds":[]}}
(Logged at Feb 8, 2022 @ 09:46:00.282)
What should be checked
We should, set up the Jira Cloud App and some environment, and try to use combination of Jira keys, namely in:
- branch name
- commit message
- MR title
- MR description
- combination of both MR (title and description)
Validate that it works for all of them, and the builds are displayed under the issue's detail page.
Steps to reproduce
- Start a Gitpod for the
gitlab-org/gitlab
project. - Enable runners.
- Create a project with a
.gitlab-ci.yml
file. - Create an MR on that project and trigger builds until one fails.
In addition to the steps above, we could reproduce the missing deployments/builds problem:
-
Branch containing JIRA issue key
- Create a branch that contains Jira issue key (e.g.:
MYPROJECT-123
) - Create an MR without issue keys in the title or description
- Validate that the correct issue has been linked in the summary page
- Create a branch that contains Jira issue key (e.g.:
-
MR title containing JIRA issue key
- Create an MR with JIRA issue keys only in the title
- Validate that the correct issue has been linked in the summary page
-
MR description containing JIRA issue key
- Create an MR with JIRA issue keys only in the description
- Validate that the JIRA issue is not synchronized in the summary page
As we can see that issue is only when JIRA issue keys are stored in the MR's description.
note: Having an issue key in title and description works as expected.
Example Project
https://gitlab.com/cmutua-free-group/feb7-jira-builds/-/merge_requests/1
What is the current bug behavior?
Sometimes build data doesn't show up in Jira
What is the expected correct behavior?
Builds should reliably show up in Jira
Relevant logs and/or screenshots
See summary
Output of checks
This bug happens on GitLab.com
Possible fixes
- Scan commit messages for Jira keys when syncing... (#390888 - closed) this will probably fix #352411
See discussion.
Additional follow-up improvements from our investigation
- Include related MR Jira issue keys for branches (#354373 - closed)
- Update the jira_issue_key_regex to conform to t... (#390887 - closed) I think this will not be visible for users and more of an performance improvement because we don't have to send data that gets rejected by Jira anyway.
- Fetch Jira projects first and only send the dat... (#390889 - closed) This is probably also a performance improvement.
See discussion.
Customer impact
Per our Prioritization Table, this issue ranks 18 with a priority score of 299k, which I would rate as fairly high impact. That said, we do have some higher priority issues in our current plans.