CAQE icon indicating copy to clipboard operation
CAQE copied to clipboard

Paying bonuses does not work when hosting on Heroku

Open jfsantos opened this issue 7 years ago • 4 comments

Paying bonuses does not work because the participant list is on the remote DB (on Heroku) but not available locally. Since one is not supposed to upload their AWS secrets to Heroku, this makes it very awkward to pay bonuses (need to get a database dump from Heroku just to figure out which participants to pay, and then update the database at Heroku).

jfsantos avatar Jun 21 '18 18:06 jfsantos

Hmmm... it's been a long time since I've used this (and I have a terribly memory), so I can't remember the details. But I don't recall this being an issue. Can't you run some commands directly on Heroku? e.g. heroku run bash to get a shell and then run whichever commands you want, no?

@pseeth you've used CAQE recently, right? did you pay bonuses? how'd you do it?

mcartwright avatar Jun 21 '18 19:06 mcartwright

That is possible, but it would require storing AMT secrets on Heroku. I'm solving it by setting DATABASE_URL on the local computer to match the database URI from Heroku. There are still some other minor issues that I'm trying to track now but if there's a correct way of doing it I would appreciate it, as following the documentation as it is currently does not work.

-- João Felipe Santos

On Thu, 21 Jun 2018 at 15:10, Mark Cartwright [email protected] wrote:

Hmmm... it's been a long time since I've used this (and I have a terribly memory), so I can't remember the details. But I don't recall this being an issue. Can't you run some commands directly on Heroku? e.g. heroku run bash to get a shell and then run whichever commands you want, no?

@pseeth https://github.com/pseeth you've used CAQE recently, right? did you pay bonuses? how'd you do it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/interactiveaudiolab/CAQE/issues/33#issuecomment-399211949, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWZT3HrDiT2u95XCgUU6SG8REpG2fXks5t---sgaJpZM4UylpJ .

jfsantos avatar Jun 21 '18 19:06 jfsantos

What about a getpass prompt for the secret key if it isn't in the file?

mcartwright avatar Jun 21 '18 19:06 mcartwright

Setting DATABASE_URL to Heroku's URL works and does not require keeping secrets on the remote, but there was actually an issue on the code that made paying bonuses not work. The API call to create_participant was expecting arguments assignmentId and hitId, but was called with crowd_assignment_id and crowd_assignment_type instead.

I also improved the code by adding a bonus_paid column to the Participant class, and using that to track whether bonuses were paid to a person or not. I'll eventually clean up my code (it's full of debug messages now) and submit a PR.

jfsantos avatar Jun 25 '18 20:06 jfsantos