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

feat: have ability to set latest flag to 0 in GrantCLRCalculation #8791

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

thelostone-mc
Copy link
Member

@thelostone-mc thelostone-mc commented Apr 16, 2021

Description

Introduce 2 new actions on Grant CLR admin

  • Reset CLR calculations for this round -> set the GrantCLRCalculations for that round to latest = False
  • Reset all CLR calculations for all rounds -> -> set ALL GrantCLRCalulations to latest = False
Why do need this ?
  • Any time the estimate_clr runs for a round -> the earlier records for that CLRGrantCLRCalculations has the latest column set to False and the once all the CLR are calculated , the effective CLR for each grant is nothing but the same of the latest GrantCLRCalculations with latest=True and the that grant.pk
  • When the round runs
    • the older ones are invalidated (aka latest is set to False)
    • new records are created
  • When a round ends, the records with latest=True are created. Let's call these Record X.
  • When a new round is started -> the record X would be taken into account cause the older ones cause they were never invalidated

This PR lets admin reset those for an individual round / bulk reset for all GrantCLRCalculations

How to use it
  • Head over to GrantCLR object once it's ended and payouts are done
  • Scroll Down to bottom of the page
  • Click on Reset CLR calculations for this round OR Reset all CLR calculations for all rounds
Testing

https://share.vidyard.com/watch/j16VkR3kC5y9tKrjUsCRHb?

@thelostone-mc thelostone-mc marked this pull request as ready for review April 16, 2021 13:32
@thelostone-mc thelostone-mc requested a review from owocki April 20, 2021 07:15
Copy link
Contributor

@chibie chibie left a comment

Choose a reason for hiding this comment

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

lgtm!

typo: _set_{current|all}_grant_clr_calulations_to_false should be _set_{current|all}_grant_clr_calculations_to_false

calculations > calulations 😉

@thelostone-mc
Copy link
Member Author

Lol thanks @chibie

@thelostone-mc thelostone-mc merged commit 7c486fc into gitcoinco:master Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants