Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seeking a way to clone the issues for github projects

Tags:

git

github

I would like to be able to use git to clone the issues for various projects on github. I know I can clone the code and the wiki (if it exists). I cannot find a way to clone the issues.

As a worked example, here's how I would clone the main repo containing the project's source code: git clone https://github.com/kiwix/kiwix-android.git

And this works for the wiki pages of this project: git clone https://github.com/kiwix/kiwix-android.wiki.git

I've tried the following to see if it would work for the issues, but it doesn't

git clone https://github.com/kiwix/kiwix-android.issues.git
Cloning into 'kiwix-android.issues'...
remote: Repository not found.
fatal: repository 'https://github.com/kiwix/kiwix-android.issues.git/' not found

Being able to clone the issues would be a great help, particularly to run scripts to analyse the set of issues for various problems, etc.

like image 329
JulianHarty Avatar asked Jun 04 '19 04:06

JulianHarty


3 Answers

Thanks to @madhu-bhat's suggestion I read the documents on GitHub's v3 API and discovered examples such as

curl -i "https://api.github.com/repos/vmg/redcarpet/issues?state=closed"

which I then revised to get the open issues for one of our projects:

curl -i "https://api.github.com/repos/kiwix/kiwix-android/issues?state=open"

This approach does what I need and allows me to filter by the state, etc. +1 for StackOverflow.

like image 68
JulianHarty Avatar answered Nov 15 '22 19:11

JulianHarty


It is not possible to clone issues of GitHub repositories. An alternative for you to get the issues' data would be to use the GitHub APIs.

Check out the documentation here to get issues for a repository.

GET /repos/:owner/:repo/issues

You can get the issues' data using the API, store it in file system and then run your necessary scripts on them.

like image 20
Madhu Bhat Avatar answered Nov 15 '22 20:11

Madhu Bhat


Disclamers

  • I am involved in creating the github repository listed below.
  • This answer does not provide an exact clone of an issue, but it copies the issues.

Constraints

Kamino requires the Chrome browser and I was not willing to work with an extension. Additionally, I wanted to clone issues from a private repo A to a public repo B, which I was not able to do with the copy issue button.

Solution

So a bit of Python code was written that copies all open issues from repo A to repo B. It is located here: https://github.com/a-t-0/batch-copy-issues and you can use it as:

git clone [email protected]:a-t-0/batch-copy-issues.git
cd batch-copy-issues
conda env create --file environment.yml
conda activate batch_copy_issues
python -m code.project1.src

Then it asks you for the GitHub username and repository from which you want copy the issues, and to which GitHub user and repository you want to copy them to. Next it gets a browser controller, ensures Firefox is installed and starts copying the labels, titles and comments of open issues from repo A to repo B. You can watch it copying the stuff.

Note clone vs copy

Please not this is not an exact "Clone" of an issue, since it does not properly conserve "who said what", since all comments will be written by the person copying the issues. The software would be able to include a small footnote saying originally said by X at time Y., however that is currently not implemented.

like image 24
a.t. Avatar answered Nov 15 '22 20:11

a.t.