atlassian / github-for-jira

Connect your code with your project management in Jira
https://github.atlassian.com
MIT License
630 stars 190 forks source link

Commits not showing up on JIRA #205

Closed eldenis closed 3 years ago

eldenis commented 5 years ago

We have several repositories in our organization. The smallest ones are syncing without issue, the biggest one however (couple of years and thousands of commits) doesn't seem to be sending all commit info to JIRA as only a handful of commits show up.

We've reached Atlassian and they've done their investigation on their end and conclude github's at fault since they're not getting all commit info. We've tried to resync all commit info to no avail. We've also tried removing the synchronization and adding it again and this didn't work either.

fwdco commented 5 years ago

We are also experiencing the same issue (not all commits showing, many missing) on our most critical repositories. Working with Atlassian as well who explained that the data coming from GitHub is the problem. We have also removed the app, reinstalled and tried full sync's multiple times. Each time we see a status of "complete" but numerous commits are always missing.

ACyphus commented 5 years ago

Howdy @eldenis 👋

In the large repository, of the commits that are appearing in your Jira issues, are they on the default branch of the repository? Are the commits that aren't appearing on non-default branches?

eldenis commented 5 years ago

Hi, @ACyphus! Some are on the default branch, some are on other non-default branches.

ACyphus commented 5 years ago

Thanks @eldenis. Please can you get in touch with GitHub Support and we'll be able to offer further assistance.

Including links and screenshots of the following will be very helpful for our investigation:

welps commented 5 years ago

Hello,

I'm not sure if the preference here is to piggyback or to open up my own issue, but we at @discovery-digital are using this plugin with Jira Cloud and have similar issues regarding syncing. There seems to be no log or feedback to work from on the Jira AND Github end.

We have 450+ repositories and at some point, the plugin stopped syncing completely. I was able to find a temporary solution by doing the following:

  1. Configure the plugin in our GitHub Organization settings (https://github.com/organizations/your-org/settings/installations/1350259) and reduced it down to 230~ repositories, in which I wrote some code (outlined below) to avoid typing 230 repositories into the interface

  2. On the Jira Cloud configuration end (https://your-installation.atlassian.net/plugins/servlet/ac/com.github.integration.production/github-post-install-page) , select Full under the Retry column and then hit Submit

Note: I uninstalled/reinstalled the plugin on both the GitHub and Jira Cloud end, but I don't think it's necessary to fix it. If I'm not mistaken, this removes the existing Development Tools git data on Jira's side so maybe not ideal. After the sync began working, I did notice past commit/branch/PR data show up on tickets but not sure what the extent of it was.

This is now working for us, but the issue remains where we now have to manually add new repositories that we want to benefit from the plugin.


Code to sanely selectively specify repositories in the GitHub for Jira plugin

  1. I used python with the PyGithub library to get all repository IDs, names, and last updated dates into a CSV. We only needed repos updated in the last two years so this worked out for us.
from github import Github

def main():
    g = Github('YOUR GITHUB ACCESS TOKEN HERE -- NEEDS REPO PERMISSIONS')
    org = g.get_organization('YOUIRORG')
    repos = org.get_repos(type='all',sort='updated',direction='desc')
    for repo in repos:
        print("{},{},{}".format(repo.id, repo.updated_at, repo.full_name))

main()
  1. I assume 1350259 is the plugin id for GitHub for Jira on Jira Cloud's end and that this ID is universal.

On https://github.com/organizations/your-org/settings/installations/1350259, I run this within my browser dev console. I used Chrome for this case. The code below will remove any existing selected repositories in the plugin interface and replace them with the ones specified in the code. Note that I've encountered a validation error after submission where the plugin will tell me that 100 repositories is the selector limit, but if you play around with the number of repos you submit, it seems that you can get over it. I was able to get it to select 230.

// Remove all existing repositories from plugin
while ($('.js-selected-repository-field') !== null) {
    $('.js-selected-repository-field').remove();
}

let addRepo = (repoId) => {
    let repoInput = document.createElement("input");    
    repoInput.setAttribute("type", "hidden")
    repoInput.setAttribute("name", "repository_ids[]")
    repoInput.setAttribute("value", repoId)
    $('#edit_integration_installation_1350259').append(repoInput);
}

let repos = ['YOURID1', 'YOURID2'];

repos.forEach((repoId) => {addRepo(repoId)});

$('#edit_integration_installation_1350259').submit();
reillydavis commented 5 years ago

@eldenis @fwdco Did you have any success in getting it working? Are you still stuck or were you able to get Atlassian to revert you to the old DVCS connector?

eldenis commented 5 years ago

@eldenis @fwdco Did you have any success in getting it working? Are you still stuck or were you able to get Atlassian to revert you to the old DVCS connector?

Not yet. I haven't had any replies from Github and the problem persists. My organization has decided to just stop using this integration and wait for further assistance from Github if they ever do reply.

@ACyphus are you still investigating this issue?

reillydavis commented 5 years ago

@eldenis and others having this issue: Atlassian was able to re-enable the old DVCS connector for us until GitHub is able to fix all of these syncing issues.

See the article here: https://community.atlassian.com/t5/Jira-articles/Everything-you-need-to-know-about-migrating-from-the-DVCS/ba-p/945910 Taylor, the PM for this, has left his email in the comments. If you get in touch with him he can help re-enable the old connector.

GitHub support has not been helpful with this issue at all, which is disappointing. For such a critical integration, GitHub really needs to put more urgency and resources behind this.

daveliao commented 4 years ago

I'm having the same issue with Jira Cloud not re-posting comments from GitHub.com.

On the bright side, I can see commits inside Jira issues, so developers aren't totally lost. ¯_(ツ)_/¯

rachellerathbone commented 3 years ago

Hi @eldenis. I'm from a team at Atlassian that is currently in the process of migrating the ownership over to us from GitHub. As a part of this, we're currently going through the backlog of issues and prs to see what can still be addressed and what should be closed.

When the migration of this app is complete, my team will be looking into potential ways to improve the sync process, particularly in cases where there are a large number of repos, commits, branches etc. Stay tuned 😄

drewpink-zz commented 3 years ago

@rachellerathbone any updates? I'm attaching just one of our Github repos to Jira Cloud and no issues are showing up.

rachellerathbone commented 3 years ago

Hi @drewpink. Unfortunately not at this point. We're still in the process of migrating this app ovee from the team at GitHub but, while we're getting closer to the finish line, there's still at least several weeks of work remaining. That said, once it's done, tackling issues and features in our backlog will be in full swing.

drewpink-zz commented 3 years ago

Okay, thanks for the timely reply.

evanw-lucid commented 3 years ago

Any updates on this? I'm able to get PRs to show up, but the commits will not appear unless I do a manual full sync from the Github app in Jira.

Hi @drewpink. Unfortunately not at this point. We're still in the process of migrating this app ovee from the team at GitHub but, while we're getting closer to the finish line, there's still at least several weeks of work remaining. That said, once it's done, tackling issues and features in our backlog will be in full swing.

rachellerathbone commented 3 years ago

Hey @evanw-lucid and @drewpink. Could you please let me know if this is still an issue for either of you?

drewpink-zz commented 3 years ago

@rachellerathbone we ended up automating our own Jira/Zenhub/Github connector.

bgvozdev commented 3 years ago

This is an old issue and we recently implemented quite some improvements to the sync process. Closing this one but please feel free to open a new issue in case you see any problems with the sync.

KarmaBlackshaw commented 1 year ago

Still experiencing the same issue.

I have two commits with the issue key image

However, it is not reflecting in the ticket image image

Some repositories work, some do not. image image

jlk4p commented 3 months ago

We have this issue as well with Jira Data Center 9.4.21. We have several different teams with organizations integrated with Jira. Some teams have all of their commits coming through on their Jira project tickets. But we have one team with a project that is not getting all of the commits connected to its tickets as expected. In this case the GitHub organization has over 250 repositories. The repo not fully syncing with Jira tickets has 1,456 commits. In examining a few Jira tickets for this project:

We have tried manually resyncing the repository and also redoing the GitHub and Jira integration for that organization. Nothing has resolved this issue.