CircleCI-Public / jira-connect-orb

Display the status of CircleCI workflows and deployments in Jira!
https://circleci.com/orbs/registry/orb/circleci/jira
MIT License
25 stars 27 forks source link

all_commit_details is missing most of commits related to GitHub pull request #85

Closed yu-tomori closed 1 year ago

yu-tomori commented 2 years ago

Orb version

1.3.1

What happened

I use the orb to notify deployment of JIRA Issue to our JIRA project. I've noticed that most Jira issues are missing deployment notifications. According to the source code, the notify command access this endpoint, get the commit messages in the field all_commit_details, and parse it to get the JIRA issue key. I accessed the endpoint in my local(the masked response posted below), and noticed the all_commit_details contains only latest 3 commits. This seems to cause the problem that the most Jira issues are missing deployment notification.

/Users/yu $ curl -H "Circle-Token: xxxxxxxxxxxxxx" https://circleci.com/api/v1.1/project/github/japanfuse/portx/13588 | jq .all_commit_details
{
    ...
    },
    "messages" : [ ],
  "is_first_green_build" : false,
  "job_name" : null,
  "start_time" : "2022-09-05T02:58:58.833Z",
  "canceler" : null,
  "all_commit_details" : [ {
    "committer_date" : "2022-09-03T08:13:13.000Z",
    "body" : "PORTX-655: Apitest autogen",
    "branch" : "release",
    "author_date" : "2022-09-03T08:13:13.000Z",
    "committer_email" : "noreply@github.com",
    "commit" : "xxxxxxxxxxxxxxxxxxx",
    "committer_login" : "web-flow",
    "committer_name" : "GitHub",
    "subject" : "Merge pull request #765 from japanfuse/apitest-autogen",
    "commit_url" : "https://github.com/xxxxxxxxx/xxxxxxxxxx/commit/xxxxxxxxxxxxxxxxxxx",
    "author_login" : "xxxxxxxxxxxxx",
    "author_name" : "xxxxxxx",
    "author_email" : "xxxxxxxxxxxx"
  }, {
    "committer_date" : "2022-09-03T11:08:31.000Z",
    "body" : "xxxxxxxxxxxxxxxxxxxx",
    "branch" : "release",
    "author_date" : "2022-09-03T11:08:31.000Z",
    "committer_email" : "noreply@github.com",
    "commit" : "xxxxxxxxxxxxxxxxxx",
    "committer_login" : "web-flow",
    "committer_name" : "GitHub",
    "subject" : "Merge pull request #785 from japanfuse/PORTX-674",
    "commit_url" : "https://github.com/japanfuse/portx/commit/xxxxxxxxxxxxxxxxxxxxxxxxx",
    "author_login" : "xxxxxxxxxxxx",
    "author_name" : "xxxxxxxxxxxxxxxxxx",
    "author_email" : "xxxxxxxxxxxxxxxxx"
  }, {
    "committer_date" : "2022-09-05T00:49:26.000Z",
    "body" : "xxxxxxxxxxxxxxxxxxxxx",
    "branch" : "release",
    "author_date" : "2022-09-05T00:49:26.000Z",
    "committer_email" : "noreply@github.com",
    "commit" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "committer_login" : "web-flow",
    "committer_name" : "GitHub",
    "subject" : "Merge pull request #787 from japanfuse/main",
    "commit_url" : "https://github.com/japanfuse/portx/commit/xxxxxxxxxxx",
    "author_login" : "yugaraxy",
    "author_name" : "yu",
    "author_email" : "xxxxxxxxxxxxxxxxxxxxxxxx"
  } ],
  "platform" : "2.0",
  "outcome" : "success",
  "vcs_url" : "https://github.com/japanfuse/portx",
  "author_name" : "yu",
  "node" : null,
  "queued_at" : "2022-09-05T02:58:57.047Z",
  "canceled" : false,
  "author_email" : "xxxxxxxxxxxxxxxxxxxxxxx
}

Expected behavior

We should find a way to get all commit messages related to GitHub Pull Request, and all Jira Issue successfully get deployment notification.

Considerations

CircleCI API v1 is deprecated and, we should replace it to v2. But, I couldn't find any fields in v2 endpoint for all_commit_details.

KyleTryon commented 1 year ago

Hello Friends 👋

The day has finally come 🎉 ! As we have alluded to in a few spots in this repository, we have been working on a new integration for Jira with CircleCI to replace this outdated orb which has historically been difficult for us to update. Today we are excited to announce Jira Integration V2 is finally LIVE!

New Docs: https://circleci.com/docs/jira-plugin/ Orb v2: https://circleci.com/developer/orbs/orb/circleci/jira Atlassian Forge App: https://github.com/CircleCI-Public/circleci-for-jira

Key Features

What to know