ryantate/typingpool

With default 0.75 reward, assignment cost is always $0.00

Closed this issue · 2 comments

If I don't specify a --reward value in tp-assign, it always reports an assignment cost of $0.00:

Without --reward:

MilianoV-MBP:typingpool milianov$ to-assign "Interview 01" interview/nameless --deadline 90m --approval 6h
Figuring out what needs to be assigned
48 assignments total
47 assignments completed
1 assignments to assign
Checking your balance
Assignment cost is $0.00. Proceed? [yes]/no:

With --reward:

MilianoV-MBP:typingpool milianov$ to-assign "Interview 02" interview/nameless --deadline 90m --approval 6h --reward 1.0
Figuring out what needs to be assigned
61 assignments total
61 assignments to assign
Checking your balance
Assignment cost is $67.10. Proceed? [yes]/no:

Thanks for the bug report @vitorio! This was due to a dumb error in bin/tp-assign where I used the reward command-line option directly rather than the canonical representation of that data (a config object with the defaults, into which the command-line options were merged).

The "correct" reward was passed when actually creating the assignments but the potentially incorrect reward was used for display and also for pre-computing the total cost to make sure the user has enough money in her account, so it's good this was caught.

The fix (and regression test) are pushed both to the commit above and to a new version on rubygems.org. So a simple gem install typingpool should get you the the fix.

Looks like a pretty comprehensive fix! Thanks for doing it, and thanks for typingpool.