1. Christian Freund
  2. PowerBuilder
  3. Monday, 19 September 2022 15:49 PM UTC

Hi,

actually we use MS Teamfoundation Server as sourcecode control system.
We want migrate it to GitHub.

We have an external ticketsystem to followup changes and issues.

In TFS we can use checkin notes to find out which object is chanded for a ticket.
Sometimes there is more than one chechin needed to solve the issues.

In TFS we can use a SQL on the TFS database to find out the changes.

What can we do with github?

Is there any tool to work with?
Can we use the GitHup Api to get all filenames with a chommit comment with our TicketId?

 

Best regards,

 

Christian

Christian Freund Accepted Answer Pending Moderation
  1. Tuesday, 20 September 2022 14:57 PM UTC
  2. PowerBuilder
  3. # 1

Hi Andreas,

thank you for your answer.

The ticketsystem doesn't have any api.

The ticket ID is a generated id.

It's although used in other systems to document any changes for users and future releases.

Do you use a ticket numer?

And if yes - do you type it in every commit comment?

 

Regards, Christian

Comment
  1. Andreas Mykonios
  2. Wednesday, 21 September 2022 06:58 AM UTC
No. We use issue numbers created from gitea when registering an issue. If we want to connect the issue with another system we do put a link to that issue, or mention the repository and issue number. But for now, most of the work is done in gitea (projects, milestones, issues).



Andreas.
  1. Helpful
  1. Christian Freund
  2. Wednesday, 21 September 2022 07:11 AM UTC
Okay, thank you for your informations.



Christian
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 20 September 2022 13:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi.

As nobody answered, first of all this is not the best location to ask questions about github.

We do use gitea, which does have a pretty nice API. As gitea is a smaller project compared to github, I did checked and github also offers an api wich seems to be pretty nice. There are at least 4 calls that you can do and expect information about commits. One of them (Commits - GitHub Docs) does give detailed information about a specific commit (so you need to first get a list of commits, and then query for the one you are interested in). This is a sample result in json (from github):

{
  "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "node_id": "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==",
  "html_url": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e",
  "comments_url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments",
  "commit": {
    "url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
    "author": {
      "name": "Monalisa Octocat",
      "email": "mona@github.com",
      "date": "2011-04-14T16:00:49Z"
    },
    "committer": {
      "name": "Monalisa Octocat",
      "email": "mona@github.com",
      "date": "2011-04-14T16:00:49Z"
    },
    "message": "Fix all the bugs",
    "tree": {
      "url": "https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e",
      "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
    },
    "comment_count": 0,
    "verification": {
      "verified": false,
      "reason": "unsigned",
      "signature": null,
      "payload": null
    }
  },
  "author": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "committer": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "parents": [
    {
      "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
      "sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
    }
  ],
  "stats": {
    "additions": 104,
    "deletions": 4,
    "total": 108
  },
  "files": [
    {
      "filename": "file1.txt",
      "additions": 10,
      "deletions": 2,
      "changes": 12,
      "status": "modified",
      "raw_url": "https://github.com/octocat/Hello-World/raw/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt",
      "blob_url": "https://github.com/octocat/Hello-World/blob/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt",
      "patch": "@@ -29,7 +29,7 @@\n....."
    }
  ]
}

While Github doesn't give you a database schema to work on, I believe that you can do lot of things using their api. Now I don't know what happens with TicketId (or what is TicketId). If it's a Ticketing system, does it have an api? If yes, then I guess you could build a service that may update TicketId.

Andreas.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.