From 95610c58d5a1398c2dad746bacae4cab2d722b90 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Mar 04 2017 20:17:12 +0000 Subject: [PATCH 1/4] github: introduce --gencsv and --import Signed-off-by: Vivek Anand --- diff --git a/pagure_importer/commands/github.py b/pagure_importer/commands/github.py index 8cf12bf..ce5db30 100644 --- a/pagure_importer/commands/github.py +++ b/pagure_importer/commands/github.py @@ -17,18 +17,16 @@ from pagure_importer.utils.exceptions import ( @click.option('--project', prompt='Enter github project name like pypingou/pagure', help="Github project like pypingou/pagure") +@click.option('--gencsv/--import', default=False) @click.option('--status', type=click.Choice(['all', 'open', 'closed']), default='all', help="Status of issue/PR to be imported(open/closed/all)") @click.option('--nopush', is_flag=True, help="Do not push the result of pagure-importer back") -def github(username, project, nopush, status): +def github(username, project, nopush, status, gencsv): ''' Command to import from github ''' password = click.prompt("Github Password", hide_input=True) - gen_json = click.confirm( - "Do you want to generate jsons for project's contributers" - " and issue commentors?") - if gen_json: + if gencsv: gh_get_contributors(username, password, project) gh_get_issue_users(username, password, project) gh_assemble_users() From 83a831635789b0206be625e948f3cf81a7743ada Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Mar 05 2017 10:44:02 +0000 Subject: [PATCH 2/4] Readme: Update for --gencsv/--import options in github Signed-off-by: Vivek Anand --- diff --git a/README.md b/README.md index 53b4b5d..3880ce4 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,23 @@ To add some new close status just edit the config file as follow. Where ```Foo`` This will clone the pagure foobar repository into the default set /tmp directory as /tmp/foobar.git -2) The github command can be used to import issues from a github project to pagure +2) The gencsv option with github command can be used to generate csv containing username and email ids. + $ pgimport github --gencsv + + This command will generate a csv file ```assembled_users.csv``` for you where all the contributors + and issue commentors' username is given. A few of the email ids that pgimport could find from github + is also mentioned. This csv has to be filled with the email ids of the user because pagure needs + an email id for each user. + +3) Once the csv is filled: + $ pgimport github --import + + or, $ pgimport github - This will ask few questions, just answer them and issues will be imported to /tmp/foobar.git repository. + Both will have same effect, this command will assume that you have the csv ready for use and will begin + importing issues from github to your local git repository. 3) The push command can be used to push a clone pagure ticket repo back to pagure. From 1aa4882dfb1e7f0a392dddba3d3ff50c2d7a6791 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Mar 05 2017 11:07:21 +0000 Subject: [PATCH 3/4] Remove --import from github command --- diff --git a/pagure_importer/commands/github.py b/pagure_importer/commands/github.py index ce5db30..ff48ca1 100644 --- a/pagure_importer/commands/github.py +++ b/pagure_importer/commands/github.py @@ -17,7 +17,7 @@ from pagure_importer.utils.exceptions import ( @click.option('--project', prompt='Enter github project name like pypingou/pagure', help="Github project like pypingou/pagure") -@click.option('--gencsv/--import', default=False) +@click.option('--gencsv', is_flag=True, default=False) @click.option('--status', type=click.Choice(['all', 'open', 'closed']), default='all', help="Status of issue/PR to be imported(open/closed/all)") From a7fdf2909b4e4d44aa83c9aa46f84e01f1d98f58 Mon Sep 17 00:00:00 2001 From: Vivek Anand Date: Mar 05 2017 11:08:59 +0000 Subject: [PATCH 4/4] Update readme after removing --import from github Signed-off-by: Vivek Anand --- diff --git a/README.md b/README.md index 3880ce4..8582225 100644 --- a/README.md +++ b/README.md @@ -146,12 +146,10 @@ To add some new close status just edit the config file as follow. Where ```Foo`` an email id for each user. 3) Once the csv is filled: - $ pgimport github --import - or, $ pgimport github - Both will have same effect, this command will assume that you have the csv ready for use and will begin + This command will assume that you have the csv ready for use and will begin importing issues from github to your local git repository. 3) The push command can be used to push a clone pagure ticket repo back to pagure.