Skip to content
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

General faucet cleanup #582

Merged
merged 7 commits into from
Mar 9, 2018
Merged

General faucet cleanup #582

merged 7 commits into from
Mar 9, 2018

Conversation

mbeacom
Copy link
Contributor

@mbeacom mbeacom commented Mar 9, 2018

Description

The goal of this PR is to cleanup some of the logic and syntax associated with Faucet and add docstrings.

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)

faucet

@mbeacom mbeacom added backend This needs backend expertise. faucet labels Mar 9, 2018
@mbeacom mbeacom requested a review from owocki March 9, 2018 17:13
@mbeacom mbeacom self-assigned this Mar 9, 2018
@codecov
Copy link

codecov bot commented Mar 9, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@bcf89b2). Click here to learn what that means.
The diff coverage is 12.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #582   +/-   ##
=========================================
  Coverage          ?   29.15%           
=========================================
  Files             ?       93           
  Lines             ?     4856           
  Branches          ?      568           
=========================================
  Hits              ?     1416           
  Misses            ?     3393           
  Partials          ?       47
Impacted Files Coverage Δ
app/app/urls.py 100% <ø> (ø)
app/marketing/webhookviews.py 42.1% <ø> (ø)
app/faucet/admin.py 76.47% <50%> (ø)
app/faucet/models.py 89.47% <50%> (ø)
app/faucet/views.py 32.14% <7.14%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcf89b2...3e96e64. Read the comment docs.

@mbeacom
Copy link
Contributor Author

mbeacom commented Mar 9, 2018

@owocki When you have a moment, can I get 👀 on this?

'user': user['items'][0]
}
response = {'status': 200, 'user': False}
if not len(user['items']) == 0 or not user['items'][0]['login'].lower() != profile.lower():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks different than what was being done before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. I'm checking if not for both cases, defaulting to {'status': 200, 'user': False} and only updating response['user'] if the case is correct ^ - It's performing the same logic, just updating the one value if necessary to be more DRY.

return JsonResponse({
'message': e.messages[0]
}, status=400)
github_profile = request.POST.get('githubProfile')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not test here either.. can you do a runthrough of testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's doing the same exact thing, only catching in one place versus three since we're returning on exception anyway.

@owocki
Copy link
Contributor

owocki commented Mar 9, 2018

just left a few comments.. LGTM once its tested both success/fail cases

@mbeacom
Copy link
Contributor Author

mbeacom commented Mar 9, 2018

@owocki The logic hasn't really changed. As for the python code, it's the same exact thing as before only a little more DRY.

@owocki owocki merged commit 3e96e64 into master Mar 9, 2018
@owocki
Copy link
Contributor

owocki commented Mar 9, 2018

🚢 ed-- thanks!

@owocki owocki removed the in progress label Mar 9, 2018
@mbeacom mbeacom deleted the faucet-cleanup branch March 9, 2018 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This needs backend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants