status-im / open-bounty

Enable communities to distribute funds to push their cause forward.
https://openbounty.status.im/
GNU Affero General Public License v3.0
118 stars 36 forks source link

Do not invoke GitHub API update operations needlessly #385

Closed vitvly closed 6 years ago

vitvly commented 6 years ago

Description

Type: Bug GitHub comments should only be updated once after any relevant input changes.

Expected behavior

GitHub comment is not updated unless:

Actual behavior

If a PR for an issue with a bounty has been merged, but the contributor has no Ethereum address set in OpenBounty, scheduler's self-sign-bounty thread will attempt to repeatedly update a GitHub comment with text "Pending user to save ETH address", although just one update is enough.

Steps to reproduce

Solution

Store an additional flag inside issue comment hash (comment_hash field in issue_comment table). Currently the hash is generated based on a tuple owner, repo, issue_number, eth_balance. Include an additional flag from the enumeration address_not_set, pending_confirmation, paid. Always generate a hash based on this data before posting a GitHub comment update and proceed only if generated hash differs from the one stored in database.

martinklepsch commented 6 years ago

@arash009 did we get an update from GitHub whether our changes have already reduced the issue sufficiently?

arash009 commented 6 years ago

The main concern at the time was that one issue that was doing the non-stop repeated calls which we stopped straight away. That was confirmed.

Once this is implemented we will go back to them to recheck our usage.