-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Integrate StandardBounties increasePayout() #626
Conversation
This currently only works for ETH. Do we need to support tokens as well? |
Implemented token support & did some cleanup and testing. The basic functionality is done. It should not interfere with other functionality, however I'm not sure about all the possible side-effects caused by localStorage. I did not touch the github bot or the email functionality. Is there a need for notifications about bounty increases through these channels? I haven't fixed the linter errors yet - I'm happy to do that, squash, and finalize the PR once you guys are happy with my changes. Let me know if I'm missing anything :) |
yes please! here is the part of the system that can/should notice the increase in funds and then trigger a notification. https://github.com/gitcoinco/web/blob/master/app/dashboard/helpers.py#L551-L552
its pretty easy to just update the PR with |
parent: 'right_actions', | ||
color: enabled ? 'darkBlue' : 'darkGrey', | ||
extraClass: enabled ? '' : 'disabled', | ||
title: enabled ? 'Increase the funding of this bounty' : 'Can only be performed if you are the funder.' |
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.
cant wait to get a v2 out there so that we can remove Can only be performed if you are the funder
!
@@ -0,0 +1,160 @@ | |||
load_tokens(); | |||
var setUsdAmount= function (event) { |
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.
itd be great to DRY this (maybe move it into shared.js)
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.
On it.
_alert({ message: "Please enter a valid github issue URL." }); | ||
isError = true; | ||
} | ||
if(amount == ''){ |
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.
maybe worth it to add an error IFF someone tries to do this thats not the original funder
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.
Will do.
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'm doing this here, do you want me to move it?
} | ||
|
||
function approveSuccessCallback () { | ||
bounty.increasePayout( |
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 youll need to batch up, and call the contribute()
method here too
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.
It worked during manual testing, but if you want I can do that. Out of curiosity: What makes you think that this is necessary?
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.
@mbeylin told me it was :P
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 believe per the standardbounties docs, those two methods complement each other https://github.com/ConsenSys/StandardBounties/
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'll look into it.
@owocki I tested it in my docker instance connected to rinkeby and saw the updated amounts on the bounty details page. I'll look into the notifications. |
Added notifications. I'm skipping the email for now since in v1 only the funder can increase bounties and the current email notification solution based on keywords does not scale. |
395f984
to
2c45a58
Compare
Makes senes to me.. I think a github/slack notification may be all we need at this point |
@@ -239,6 +244,14 @@ def build_github_notification(bounty, event_name, profile_pairs=None): | |||
f"[here]({absolute_url})\n * Questions? Get help on the " \ | |||
f"<a href='https://gitcoin.co/slack'>Gitcoin Slack</a>\n * ${amount_open_work}" \ | |||
" more Funded OSS Work Available at: https://gitcoin.co/explorer\n" | |||
if event_name == 'increased_bounty': |
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.
awesome.
bd97ccf
to
09b34f3
Compare
@mbeylin Looking into the StandardBounties docs, it seems like |
4ef1f5a
to
373bcab
Compare
Codecov Report
@@ Coverage Diff @@
## master #626 +/- ##
==========================================
- Coverage 34.73% 34.66% -0.08%
==========================================
Files 97 97
Lines 5317 5340 +23
Branches 597 602 +5
==========================================
+ Hits 1847 1851 +4
- Misses 3402 3418 +16
- Partials 68 71 +3
Continue to review full report at Codecov.
|
feb37a0
to
6bb795a
Compare
@msuess so you've actually discovered a hole in our documentation. You CAN call Also, if you are calling |
1671b1c
to
cc310dd
Compare
app/dashboard/views.py
Outdated
@@ -476,6 +476,34 @@ def fulfill_bounty(request): | |||
|
|||
return TemplateResponse(request, 'fulfill_bounty.html', params) | |||
|
|||
def increase_bounty(request): | |||
"""Increase a bounty (funder)""" | |||
issueURL = request.GET.get('source') |
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.
Can you camel_case
this variable? Maybe: issue_url
?
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.
Sure!
app/app/urls.py
Outdated
@@ -71,7 +71,7 @@ | |||
url(r'^issue/(?P<ghuser>.*)/(?P<ghrepo>.*)/(?P<ghissue>.*)', dashboard.views.bounty_details, name='issue_details_new2'), | |||
url(r'^bounty/details/?', dashboard.views.bounty_details, name='bounty_details'), | |||
url(r'^funding/details/?', dashboard.views.bounty_details, name='funding_details'), | |||
url(r'^legacy/funding/details/?', dashboard.views.bounty_details, name='legacy_funding_details'), |
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.
🤔
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.
huh, I could have sworn this was removed at some point on master, will put it back
@@ -0,0 +1,109 @@ | |||
{% comment %} |
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.
Can you switch this file to use 2-space indentation?
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.
will do.
2acd253
to
0e26f9a
Compare
@mbeacom rebased and implemented the changes, feel free to check again :) |
Travis says:
I think this is something on master, I didn't touch this file. |
@msuess Master should be good to go now. |
Gives the funder the ability to increase the payout. Changes: - add new route for increase_bounty view - add increase_bounty view and js - DRY up duplicate code in new_bounty.js and increase_bounty.js - implement bounty increase notification through git, slack and twitter
0e26f9a
to
546cb85
Compare
@mbeacom rebased! |
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.
lgtm - Thanks for the contribution @msuess ! I'm going to deploy this to https://stage.gitcoin.co and test it out.
Thanks @mbeacom! |
Tested on staging. Everything worked appropriately. 🙌 |
Nice, glad to hear that @mbeacom! |
testing now |
nevermind the above Major point. rinkeby.etherscan has an old interface and that's why it didnt appear as though the payouts were working |
@msuess false alarm! |
@owocki Cheers, thanks for looking into this! |
Description
Gives the funder the ability to increase the payout.
Changes:
Checklist
Affected core subsystem(s)
Testing
Testing in progress
Refers/Fixes
Fixes #617