web4er / ubiquibot

Automating DevPool management.
https://github.com/marketplace/ubiquibot
MIT License
0 stars 0 forks source link

QA: Only display multiplier details if not `1.0` #48

Open web4er opened 1 year ago

web4er commented 1 year ago

Steps for each test

web4er commented 1 year ago

TEST

should not display any multiplier info to a normal bounty hunter with default multiplier settings

EresDev commented 1 year ago

/assign

web4er-ubiquibot[bot] commented 1 year ago

Deadline Mon, 31 Jul 2023 13:13:02 UTC
Registered Wallet Please set your wallet address to use `/wallet 0x0000...0000`

Tips:

EresDev commented 1 year ago

/unassign

web4er-ubiquibot[bot] commented 1 year ago

You have been unassigned from the bounty @EresDev

web4er commented 1 year ago

TEST

If the multiplier is not 1.0 then show the multiplier number, reason, and total.

web4er commented 1 year ago

/multiplier 0.7 @web4er "testing"

web4er-ubiquibot[bot] commented 1 year ago

Successfully changed the payout multiplier for @web4er to 0.7. The reason provided is "testing".

web4er commented 1 year ago

/assign

web4er-ubiquibot[bot] commented 1 year ago

Deadline Mon, 31 Jul 2023 13:15:15 UTC
Registered Wallet 0x1F9FCc0E84dc2094499b848AE37Cd6a51db03Ff2
Payment Multiplier0.70
Multiplier Reasontesting
Total Bounty8750 USD

Tips:

web4er commented 1 year ago

/unassign

web4er-ubiquibot[bot] commented 1 year ago

You have been unassigned from the bounty @web4er

web4er commented 1 year ago

TEST

If the multiplier is 1.0 and a reason is set, show all the multiplier details, but don't show the total.

web4er commented 1 year ago

/multiplier 1 @web4er "testing again"

web4er-ubiquibot[bot] commented 1 year ago

Successfully changed the payout multiplier for @web4er to 1. The reason provided is "testing again".

web4er commented 1 year ago

/assign

web4er-ubiquibot[bot] commented 1 year ago

Deadline Mon, 31 Jul 2023 13:18:06 UTC
Registered Wallet 0x1F9FCc0E84dc2094499b848AE37Cd6a51db03Ff2
Payment Multiplier1.00
Multiplier Reasontesting again

Tips:

web4er commented 1 year ago

TEST

don't show any multiplier info when message is set as an empty string and multiplier is 1

This basically brings back the default mode, when nothing was done to a hunter's multiplier.

web4er commented 1 year ago

/multiplier 1 @web4er ""

web4er-ubiquibot[bot] commented 1 year ago

Successfully changed the payout multiplier for @web4er to 1. The reason is not provided.

web4er commented 1 year ago

/unassign

web4er-ubiquibot[bot] commented 1 year ago

You have been unassigned from the bounty @web4er

web4er commented 1 year ago

/assign

web4er-ubiquibot[bot] commented 1 year ago

Deadline Mon, 31 Jul 2023 13:22:12 UTC
Registered Wallet 0x1F9FCc0E84dc2094499b848AE37Cd6a51db03Ff2

Tips:

web4er commented 1 year ago

/unassign

web4er-ubiquibot[bot] commented 1 year ago

You have been unassigned from the bounty @web4er

0x4007 commented 1 year ago

/multiplier 1 @web4er ""

I'm curious about this one.

You should be able to set your multiplier and not add an empty string, for example,

/multiplier @pavlovcik 1

Should be the correct way to not set a reason. Technically because you set an empty string, shouldn't the reason be an empty string instead of null? In which case shouldn't the reason render?

I actually do like this result, where the bot understands that an empty string means null but still just curious about it.

web4er commented 1 year ago

Yes, you can skip the reason from the command and it will work as it was working before. Writing some tests for this below.

I don't know if it was intentional, but one thing I didn't like in the code was, appending an empty space to the reason. This was before my changes: https://github.com/web4er/ubiquibot/blob/bc701f8a0126db2faa4f6e6f819f9139b10af969/src/handlers/comment/handlers/multiplier.ts#L49

This creates confusion in the code because when you provide "" as a reason, it stores it as " " (notice the space). And they evaluate to different booleans. ""==false and " "==true when it is checked in different places in the code.

With my change "" will be treated as "no reason provided". If you want to have an empty reason, you can explicitly provide it with a space " " or maybe something even more explicit "N/A" or "Not Applicable" when you don't want to have a reason. @pavlovcik

web4er commented 1 year ago

/multiplier @web4er 1

web4er-ubiquibot[bot] commented 1 year ago

Successfully changed the payout multiplier for @web4er to 1. The reason is not provided.

0x4007 commented 1 year ago

I don't know if it was intentional, but one thing I didn't like in the code was, appending an empty space to the reason.

It is unlikely to be intentional. Perhaps we should fix it!

By the way, can you send me a message on Telegram? We could use your attention to detail to help with some QA efforts!

web4er commented 1 year ago

It is unlikely to be intentional. Perhaps we should fix it!

The pull request with this QA fixes it.