Error "null commit diff for sha1" while getting GitLab commit diff

Issue #16 resolved
Ananta Ram das created an issue

Thank you for your add-on.

Could you help me: there are 3 commits in master but I cannot see through your add-on. Please advice what I'm doing wrong.

Thank you!

Comments (16)

  1. Ananta Ram das reporter

    Got following in jira log:

    2017-12-05 10:30:54,998 http-nio-8080-exec-9 WARN ********* 630x1721x1 c5swlf 46.219.46.42 /rest/plugins/1.0/available/com.apanasevich.jira-jigit-plugin-key/review [c.a.upm.pac.MarketplaceReviewsAndNotificationsServiceImpl] Marketplac
    e returned error 401 when getting review at https://marketplace.atlassian.com/rest/2/addons/com.apanasevich.jira-jigit-plugin/reviews/mine
    2017-12-05 10:31:34,673 Caesium-1-3 ERROR ServiceRunner     [jigit.indexer.JigitIndexer] JigitIndexer::execute - ExecutionException. Cause:
    java.lang.IllegalStateException: Something goes wrong. Got null commit diff for sha1 = ##########################################
            at jigit.indexer.api.gitlab.GitLabCommitAdapter.getCommitDiffs(GitLabCommitAdapter.java:78)
            at jigit.indexer.IndexingWorker.indexFromCommit(IndexingWorker.java:130)
            at jigit.indexer.IndexingWorker.indexRepoBranch(IndexingWorker.java:75)
            at jigit.indexer.IndexingWorker.call(IndexingWorker.java:56)
            at jigit.indexer.IndexingWorker.call(IndexingWorker.java:18)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    
  2. Dmitrii Apanasevich repo owner

    Hi!

    It's an interesting bug. GitLab API returns null as commit diff. I'll try to investigate and fix it as soon as possible.

    Which GitLab version do you use?

    Should I have anything else except Jira installed on server to use your add-on?

    No, all you need is installed add-on.

  3. Ananta Ram das reporter
    # curl --header "PRIVATE-TOKEN: **********************" "https://gitlab.com/api/v4/projects/#########/repository/commits/#####################################"
    {"id":"#####################################","short_id":"####291","title":"PP-1 Importing all previous changes to gitlab","created_at":"2017-12-05T10:54:27.000+02:00","parent_ids":["#####################################"],"message":"PP-1 Importing all previous changes to gitlab\n","author_name":"********","author_email":"********@********.com","authored_date":"2017-12-05T10:54:27.000+02:00","committer_name":"********","committer_email":"********@********.com","committed_date":"2017-12-05T10:54:27.000+02:00","stats":{"additions":274,"deletions":2,"total":276},"status":null,"last_pipeline":null}
    

    https://docs.gitlab.com/ce/api/commits.html#get-the-diff-of-a-commit

    worked correctly for that commit

  4. Dmitrii Apanasevich repo owner

    Thank you for comprehensive information (the curl output is awesome). I'll publish new version in Atlassian Marketplace ASAP.

  5. Dmitrii Apanasevich repo owner
  6. Log in to comment