-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add status-provider Flag #38
base: master
Are you sure you want to change the base?
Conversation
Travis tests have failedHey @vex8, 1st Buildcoala --non-interactive -V
TravisBuddy Request Identifier: 0fd95ca0-f085-11e8-a427-d38b467abfda |
c2711bc
to
d31c62a
Compare
Travis tests have failedHey @vex8, 1st Buildcoala --non-interactive -V
TravisBuddy Request Identifier: ba7bc3f0-f085-11e8-a427-d38b467abfda |
016ebd9
to
d7aef45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments :)
org_status/org_status.py
Outdated
@@ -87,6 +87,7 @@ def get_argument_parser(): | |||
parser.add_argument('--export-repos', type=str) | |||
parser.add_argument('--format', type=str, default='gitman') | |||
parser.add_argument('--check-providers-only', action='store_true') | |||
parser.add_argument('--status-provider', type=str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--status-providers
? I think it'd be more clear.
org_status/org_status.py
Outdated
@@ -36,7 +36,7 @@ def generate_fetch_jobs(org_strings): | |||
for supported_host in get_all_supported_hosts(): | |||
if host == supported_host.HostName: | |||
yield (supported_host, org) | |||
raise StopIteration | |||
# raise StopIteration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either get rid of the code, or leave it in, but please don't have it as a comment.
org_status/org_hosts/gitlab.py
Outdated
branch=branch) | ||
|
||
repo_status = [] | ||
for i in enumerate(self._status_provider): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally, the hacky if
statement was added in #19 as a temporary solution. This isn't the ideal way to check each StatusProvider.
Please see #19 (comment) (and the other comments on there) for ideas on how to do it.
org_status/org_hosts/gitlab.py
Outdated
if Status.PASSING in repo_status: | ||
repo_status = Status.PASSING | ||
# if statuses are identical, just return one of them | ||
elif repo_status[0] == repo_status[1]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
statement will fail if there is more than one result. The entire if
is not a good solution; I think it needs to be re thought.
org_status/org_status.py
Outdated
status_provider.append(supported_provider) | ||
found = True | ||
break | ||
if found: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just check for if not found
?
org_status/org_hosts/github.py
Outdated
repo_status = Status.PASSING | ||
# if statuses are identical, just return one of them | ||
elif repo_status[0] == repo_status[1]: | ||
if len(repo_status) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be repeating the same code again in gitlab.py
. See other comments for suggestions instead of these if
's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best way to implement this functionality would be to simply extend syntax to submit a task to include the status provider to use, say to something like travis@gitlab:coala
or some other proper alternate instead of just gitlab:coala
. We can prevent these kinds of hacky solutions by simply ensuring that an instance of OrgHost is only attached to one StatusProvider which can be configured during object construction. This way we can integrate well with the current infrastructure and not break anything.
d7aef45
to
27e65fe
Compare
Travis tests have failedHey @vex8, 1st Buildcoala --non-interactive -V
TravisBuddy Request Identifier: 8d5df590-f22f-11e8-bef6-4798215d728f |
27e65fe
to
5e54047
Compare
Travis tests have failedHey @vex8, 1st Buildcoala --non-interactive -V
TravisBuddy Request Identifier: 75d4ea40-f230-11e8-bef6-4798215d728f |
5e54047
to
e9f20a6
Compare
Travis tests have failedHey @vex8, 1st Buildpytest
TravisBuddy Request Identifier: 7adf3d50-f231-11e8-bef6-4798215d728f |
e9f20a6
to
33cdc3f
Compare
Travis tests have failedHey @vex8, 1st Buildcoala --non-interactive -V
TravisBuddy Request Identifier: 8f4d48d0-f237-11e8-bef6-4798215d728f |
This commit adds a pattern to determine status-provider. The status-provider is determined by @ at the beginning of `orgs` argument Closes ksdme#17
33cdc3f
to
c05945f
Compare
Requires more work, please be on stand by. I'll review it a bit later. |
Alright, for now I'll assess my code once more and see what I can do.
…On Tue, Nov 27, 2018, 20:51 Kilari Teja ***@***.*** wrote:
Requires more work, please be on stand by. I'll review it a bit later.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#38 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKF4UrnIZTjYHYSwhej3NhrQMBQxf9Vmks5uzUNOgaJpZM4YxwW7>
.
|
This adds a status-provider flag to mix and match between Status
Providers and Hosts, while falling back to defaults.
Closes #17