{ "info": { "author": "Vivek Anand", "author_email": "vivekanand1101@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only" ], "description": "# pagure-importer\nCLI tool for importing issues etc. from different sources like github to pagure\n\n## Installation\n---\n\n#### In a Virtual Environment\n* Install it using ```pip``` . ```pip install pagure_importer```\n\n#### Using COPR package\n* Install it using [copr](https://copr.fedorainfracloud.org/coprs/cverna/pagure-importer/).\n```\n $ sudo dnf copr enable cverna/pagure-importer\n $ sudo dnf install python3-pgimport\n```\n\n#### Using Docker\n* Build and run a container using the Dockerfile in this repository\n```\n $ docker build -t pgimport .\n $ docker run -t -i -v ~/.ssh/:/root/.ssh/:Z /bin/bash\n```\n* Inside the container you can use the pgimport command.\n\n#### Running the tests\n\n $ python -m unittest discover tests\n\n## How to run\n---\n0. Clone the issue tracker for issues from pagure. Use: ```pgimport clone ssh://git@pagure.io/tickets/foobar.git```\n1. Activate the pagure tickets hook from project settings. This is necessary step to also get pagure database updated for tickets repository changes.\n2. Deactivate the pagure Fedmsg hook from project settings. This will avoid the issues import to spam the fedmsg bus. The Hook can be reactivated once the import has completed.\n3. Execute ```pgimport```. See Usage section\n4. Just answer what is asked. Check below instructions for particular source\n5. The script will make commits in your cloned repo: push the changes back to pagure. Use : ```pgimport push foobar.git```\n\n## Custom Close Status\n---\npagure-importer creates a configuration under the home directory of the user $HOME/.pgimport. This configuration file contains the default close status.\nIf this file is not present run the following command.\n ```$ pgimport mkconfig```\nTo add some new close status just edit the config file as follow. Where ```Foo``` is the pagure custom status and ```bar``` is the trac resolution status\n\n [close_status]\n Duplicate = ['duplicate']\n Insufficient data = ['insufficient_info']\n Invalid = ['invalid', 'wontfix', 'worksforme']\n Foo = ['bar']\n\n [github]\n auth_token =\n\n\n## Usage\n---\n\n\n $ pgimport --help\n Usage: pgimport [OPTIONS] COMMAND [ARGS]...\n\n Options:\n --help Show this message and exit.\n\n Commands:\n clone\n fedorahosted\n github\n mkconfig\n push\n\n\n### Migrate fedorahosted trac tickets to pagure\n---\n1) The clone command can be used to clone the newly created pagure ticket repository:\n\n $ pgimport clone ssh://git@pagure.io/tickets/foobar.git\n\n This will clone the pagure foobar repository into the default set /tmp directory as /tmp/foobar.git\n\n2) The fedorahosted command can be used to import issues from a fedorahosted project to pagure\n\n $ pgimport fedorahosted --help\n Usage: pgimport fedorahosted [OPTIONS] PROJECT_URL\n\n Options:\n --tags Import pagure tags as well.\n --private By default make all issues private.\n --username TEXT FAS username\n --password TEXT FAS password\n --offset INTEGER Number of issue in pagure before import\n --help Show this message and exit.\n --nopush Do not push the result of pagure-importer back\n\n\n $ pgimport fedorahosted https://fedorahosted.org/foobar --tags\n\n This command will import all the tickets information with all tags to /tmp/foobar.git repository\n\n $ pgimport fedorahosted https://fedorahosted.org/foobar --private\n\n This command will import all the fedorahosted tickets as private tickets in pagure\n\n $ pgimport fedorahosted https://fedorahosted.org/foobar --offset 10\n\n This command will import all the fedorahosted tickets starting using their\n former trac ID + the offset number 10 in this example. This is usefull for project\n which already have issues in pagure before import.\n\n $ pgimport fedorahosted https://fedorahosted.org/foobar --username foo --password bar\n\n This command will run the import using the username and password provided in the command\n line without prompting the user. This is usefull to use pgimport in a script.\n\n $ pgimport fedorahosted https://fedorahosted.org/foobar --nopush\n\n This command will not push the temporary cloned repository where the importer creates the json\n representation of the issues to import. This can be used to process the issues using the json files\n before running the import.\n Default location of the cloned repository is under /tmp/clone-foobar.git\n\n3) The push command can be used to push a clone pagure ticket repo back to pagure.\n\n $ pgimport push foobar.git\n\n4) The mkconfig command will create a default config `.pgimport` file under the user $HOME directory.\n\n $ pgimport mkconfig\n\n\n### Migrate github issues to pagure\n---\n1) The clone command can be used to clone the newly created pagure ticket repository:\n\n $ pgimport clone ssh://git@pagure.io/tickets/foobar.git\n\n This will clone the pagure foobar repository into the default set /tmp directory as /tmp/foobar.git\n\n2) The github command can be used to import issues from a github project to pagure\n\n $ pgimport github\n\n This will ask few questions, just answer them and issues will be imported to /tmp/foobar.git repository.\n\n3) The push command can be used to push a clone pagure ticket repo back to pagure.\n\n $ pgimport push foobar.git\n\n\n### Tools used:\n---\n1. [PyGithub](https://github.com/PyGithub/PyGithub) - a python library for [github](https://github.com/) api.\n2. [click](https://github.com/pallets/click) - Python package for creating beautiful command line interfaces\n3. [python-fedora](https://fedorahosted.org/python-fedora/) - A collection of python code that allows programs to talk to Fedora Services\n4. [pygit2](http://pygit2.org/) - A Python bindings to the libgit2 to interact\n with git from python.\n\n\n## How it works: Github Issues\n---\n0. For github issues, there is a bit of pre-processing so, the process is\nnot very user friendly. The reason behind the pre-processing is that: github\ndoesn't give away the email ids of issue commentors unless the commentor\nis you (if you are logged in) or if the commentor is the issue reporter\nhimself. So, to overcome this problem, we will be taking email ids from their\ncommits, if they have contributed to the project but if they haven't, : start\npanicking and read below.\n\n1. We will have to run the script two times. The first time, it will\ngenerate a json file containing all the issue commentors with their details,\nif the emails are found, no edit for that particular commentor is required.\nOtherwise, you will have to manually fill the emails. Fullnames not required.\n\n2. After running the program and answering the 'source' and 'items', you\nwill be asked a question on whether you want to generate a json file for\ncontributors and issue commentors. If you are running the script for github\nfor the first time, the answer is 'y'.\n\n3. The above step will create 3 different files: ```contributors.json```\n```issue_users.json``` and ```assembled_users.csv```. The last file\nis where all the edit has to go. All the missing entries in the assembled\ncommentors file has to be filled for the running of the script.\n\n4. Run the script again, filling the same details but answer 'n' when asked for\nwhether you want to create the json files. In this step, your local issues git\nrepo gets updated with all the issues from github issue tracker.\n\n5. Now push the local git repo changes to the remote repo on pagure. It will\nupdate the db and if the user is not found, it will create them from the\ndetails given.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pagure.io/pagure-importer", "keywords": "pagure,importer,import", "license": "GNU General Public License v2.0", "maintainer": null, "maintainer_email": null, "name": "pagure_importer", "package_url": "https://pypi.org/project/pagure_importer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pagure_importer/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://pagure.io/pagure-importer" }, "release_url": "https://pypi.org/project/pagure_importer/2.2.2/", "requires_dist": null, "requires_python": null, "summary": "CLI tool for imports to Pagure", "version": "2.2.2" }, "last_serial": 2624276, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b430b0487bc0501877899507442d65f5", "sha256": "2d14defa6142019eeb02326826723009ccfeef2f419f7469f3756645a48cddbf" }, "downloads": -1, "filename": "pagure_importer-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b430b0487bc0501877899507442d65f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5374, "upload_time": "2016-02-03T18:22:57", "url": "https://files.pythonhosted.org/packages/bc/15/c8889c96959438614904dea740ddefcd7a5a235dbe288adf54b6fbd7ca91/pagure_importer-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "4ffbeb766e80d07659f175278ad29418", "sha256": "8de1741f793b6f7bffc8a86a6653384bd16daa1275bbe7cb82d6e31036f72c9c" }, "downloads": -1, "filename": "pagure_importer-0.0.3.tar.gz", "has_sig": false, "md5_digest": "4ffbeb766e80d07659f175278ad29418", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5450, "upload_time": "2016-02-06T16:36:08", "url": "https://files.pythonhosted.org/packages/0c/e2/7b3db1e0ee1e78daf323585752ecae1221e239b2797528b4f8563abf48dc/pagure_importer-0.0.3.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a3dc221379e8d7b22d97e2d2db160eaa", "sha256": "0e39ad9b97d745a5c310883d37aa445c89a0fe0c34403ec3123f1701086beb9a" }, "downloads": -1, "filename": "pagure_importer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a3dc221379e8d7b22d97e2d2db160eaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10612, "upload_time": "2016-06-13T20:12:42", "url": "https://files.pythonhosted.org/packages/59/f6/25b94ee96a6bd3c146a5ddb62dfbabafc65d542f34fe368d5c0fa0aa83d5/pagure_importer-1.0.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "90b58bbbefd87085c155f8bbb9061746", "sha256": "be1b598c30686166c55c3fdc9dc3639ef28f2a5063474b885cb8501d598335f7" }, "downloads": -1, "filename": "pagure_importer-1.2.0.tar.gz", "has_sig": false, "md5_digest": "90b58bbbefd87085c155f8bbb9061746", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24008, "upload_time": "2016-09-07T19:34:23", "url": "https://files.pythonhosted.org/packages/85/eb/3800d791f8cda0706096fece81cffc34c1b3148a151f4f49b5dbaba47448/pagure_importer-1.2.0.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "62d967c332b061d2a00429b3dd055e54", "sha256": "eea97838ad90a751adadb31fae06c877504afba19434324edb8f636520d17544" }, "downloads": -1, "filename": "pagure_importer-1.2.3.tar.gz", "has_sig": false, "md5_digest": "62d967c332b061d2a00429b3dd055e54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20615, "upload_time": "2016-11-14T19:16:56", "url": "https://files.pythonhosted.org/packages/33/29/d8e567e575346a82ad2fc71c357fe78445d0727b7175b7a9e5b4666a9a1a/pagure_importer-1.2.3.tar.gz" } ], "1.2.3": [], "2.0": [], "2.1": [], "2.2": [], "2.2.1": [ { "comment_text": "", "digests": { "md5": "c0ba3e5cc765ad69a92207071d581020", "sha256": "23b9a976ead935ee3dea6e17d6769a4c5a4b095e42974aa79a9e8fc195b32ba6" }, "downloads": -1, "filename": "pagure_importer-2.2.2.tar.gz", "has_sig": false, "md5_digest": "c0ba3e5cc765ad69a92207071d581020", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22484, "upload_time": "2017-02-03T19:26:11", "url": "https://files.pythonhosted.org/packages/f1/80/7666d9a48dcb4ea232aa8da8990606cc092b6bc8968be101ceadc5adc8f5/pagure_importer-2.2.2.tar.gz" } ], "2.2.2": [] }, "urls": [] }