GCI: Add fetch_linter_issues command - #214
Conversation
Travis tests have failedHey @ksdme, 1st Buildcoala --non-interactive -VTravisBuddy Request Identifier: 91f56d80-d52f-11e8-9a9f-2b0087888c0e |
5f25d83 to
edc12a2
Compare
|
|
||
| if host == 'github': | ||
| gh_repo_name = get_repo_name(target, host) | ||
| gh_repo = github.get_repo(gh_repo_name) |
There was a problem hiding this comment.
use community.git.get_irepo , and giturlparse.parse(url) , and add any other git / hoster utility functions in there.
|
Did you forget to push? |
edc12a2 to
d027f32
Compare
Travis tests have failedHey @ksdme, 1st Buildcoala --non-interactive -VTravisBuddy Request Identifier: c11ef480-d671-11e8-9e21-2d628ca2e168 |
d027f32 to
944db72
Compare
|
@jayvdb @li-boxuan Updated. |
|
Not sure how I got included on this... I hope you all can find a way to get me off it it.
…________________________________
From: Kilari Teja <notifications@github.com>
Sent: Tuesday, October 23, 2018 6:33 AM
To: coala/community
Cc: Jay Anderson; Mention
Subject: Re: [coala/community] GCI: Add fetch_linter_issues command (#214)
@JayVB<https://github.com/JayVB> @li-boxuan<https://github.com/li-boxuan> Updated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#214 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQGUxrdbi4CnEESsOegmW0Fqh1_hijOyks5unvCCgaJpZM4XycEP>.
|
|
Apologies @JayVB , someone misspelt my username. There is an unsubscribe button on this page. Well, there is one idea ... we could block you from the |
|
Hey,
I am sorry I made a typo while pinging somebody else. Please find a link to
unsubscribe in the footer of the other email from Github or use the
notification section on Github to unsubscribe from this thread.
ksdme
…On Tue, Oct 23, 2018, 4:54 PM JayVB ***@***.***> wrote:
Not sure how I got included on this... I hope you all can find a way to
get me off it it.
________________________________
From: Kilari Teja ***@***.***>
Sent: Tuesday, October 23, 2018 6:33 AM
To: coala/community
Cc: Jay Anderson; Mention
Subject: Re: [coala/community] GCI: Add fetch_linter_issues command (#214)
@JayVB<https://github.com/JayVB> @li-boxuan<https://github.com/li-boxuan>
Updated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<
#214 (comment)>, or
mute the thread<
https://github.com/notifications/unsubscribe-auth/AQGUxrdbi4CnEESsOegmW0Fqh1_hijOyks5unvCCgaJpZM4XycEP
>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#214 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALl8bvmCEN5X3JPKCMJM8u8GrbYe0Z20ks5unvx7gaJpZM4XycEP>
.
|
|
Thanks; I'll try the unsubscribe.
…________________________________
From: John Vandenberg <notifications@github.com>
Sent: Tuesday, October 23, 2018 7:43 AM
To: coala/community
Cc: Jay Anderson; Mention
Subject: Re: [coala/community] GCI: Add fetch_linter_issues command (#214)
Apologies @JayVB<https://github.com/JayVB> , someone misspelt my username. There is an unsubscribe button on this page.
That is the best we can do. I dont believe there is another alternative.
Well, there is one idea ... we could block you from the @coala org, but that feels a bit wrong as it is supposed to be used to prevent damage from bad actors, which is certainly not what you are. I am not 100% sure how effective that will be, but I guess it might work. Let me know if you want me to try it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#214 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQGUxqhclXKOZP_MttCLz0nQbdV9p7Ukks5unwDdgaJpZM4XycEP>.
|
| parser.add_argument('--all', action='store_true') | ||
| parser.add_argument( | ||
| 'targets', type=argparse.FileType(), | ||
| help='file containing tagret repositories') |
There was a problem hiding this comment.
tagret -> target
and move the positional argument to the top of the list, before the -s hort args and --long-args
and four space indents
| if not options.get('no_color'): | ||
| issue_labels = colored(issue_labels, 'cyan') | ||
|
|
||
| print('{repo}#{id}: {labels} {title} '.format( |
There was a problem hiding this comment.
use fstrings, and four space indents.
|
|
||
| def simplify_issue(issue, repo_url=''): | ||
| return { | ||
| 'id': issue.number, |
| print('processing', target) | ||
|
|
||
| parsed_url = giturlparse.parse(target) | ||
| repo = get_irepo(parsed_url) |
There was a problem hiding this comment.
can be deferred ... but just noting
processing https://github.com/sk-/html-linter
Traceback (most recent call last):
File "manage.py", line 24, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute
output = self.handle(*args, **options)
File "/home/jayvdb/projects/coala/org/community/gci/management/commands/fetch_sub_linter_issues.py", line 54, in handle
debug=True)
File "/home/jayvdb/projects/coala/org/community/gci/linter_repos.py", line 48, in fetch_issues
repo = get_irepo(parsed_url)
File "/home/jayvdb/projects/coala/org/community/community/git.py", line 109, in get_irepo
slug = get_repo_slug(url)
File "/home/jayvdb/projects/coala/org/community/community/git.py", line 75, in get_repo_slug
return url.owner + '/' + url.name
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
upstream
Parsed(pathname='/sk-', protocols=['https'], protocol='https', href='https://github.com/sk-/html-linter', resource='github.com', user=None, port=None, name='sk-', owner=None)
Looks like the same problem as nephila/giturlparse#14 (is it in the wrong repo?)
Percent encoding it doesnt help.
Not a useful repo though..
| debug=True) | ||
|
|
||
| for _, sub in results.items(): | ||
| print_scope = 'all' if options.get('all') else 'filtered' |
There was a problem hiding this comment.
could you add an option of issue count per repo, if filtered is empty includes all, and then randomly selects the desired issue count from the list.
| help='file containing tagret repositories') | ||
|
|
||
| def handle(self, *args, **options): | ||
| with options.get('targets') as targets_file: |
There was a problem hiding this comment.
just thinking out loud.... after using it a bit, I need this to read issues.yaml and then exclude issues which are already listed in there. #215 has a much better parser, which I think I will improve even more to make this easier.
Or maybe we try to keep this not GCI specific, move it to a different module (community/?), and then I add a command to create the repo list and the ignore issue list.
also would be good to to have a 'min-issues' and 'max-issues' per repo, set to 2 and 4.
and a random mode... ;-)
| repo = get_irepo(parsed_url) | ||
|
|
||
| with Pool(processes=processes) as pool: | ||
| all_issues = pool.map(simplify_issue, repo.issues) |
There was a problem hiding this comment.
would be good to have a mode which filters out any issue which mentions a PR (or has a PR which mentions it) , as we dont want to be offering those.
Usage:
If
labelsorkeywordsare not passed, a default set will be used. To get a list of all issues use--all. Primary repo list https://gist.github.com/ksdme/fcc26083fe7aae4b8e314892ca302718