gratipay / inside.gratipay.com

Here lieth a pioneer in open source sustainability. RIP
https://gratipay.news/the-end-cbfba8f50981
58 stars 38 forks source link

run Gratipay 274 #1149

Closed gratipay-bot closed 7 years ago

gratipay-bot commented 7 years ago

← Payday 273


Runbook

http://inside.gratipay.com/howto/run-payday

Checklist

Rotation
Month Pilot Copilot
September @whit537 :airplane: @clone1018
October rohitpaulk whit537
November clone1018 rohitpaulk
December whit537 clone1018
January rohitpaulk whit537
February clone1018 rohitpaulk
March whit537 clone1018
April rohitpaulk whit537
May clone1018 rohitpaulk
June whit537 clone1018
July rohitpaulk whit537
August clone1018 rohitpaulk
chadwhitacre commented 7 years ago

There are only ~30 card holds. I might cancel manually in the Braintree dashboard instead of trying to script it in API.

chadwhitacre commented 7 years ago

Although, looking at fetch_card_holds ... it's a static method and if we pass it an empty list of participant_ids it should do what we want.

I think we can just do:

$ heroku run python
[...]
>>> from gratipay.billing.payday import Payday
>>> Payday.fetch_card_holds([])
[]
chadwhitacre commented 7 years ago
[gratipay] $ honcho run -e defaults.env,local.env env/bin/python < cancel-holds.py 
pid-3003 thread-140737185432512 (MainThread) Fetching card holds.
[gratipay] $
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

from gratipay import wireup
from gratipay.billing.payday import Payday

wireup.billing(wireup.env())

Payday.fetch_card_holds([])
chadwhitacre commented 7 years ago

Sooo ...

$ heroku run python < cancel-holds.py

You okay with that, @rohitpaulk?

chadwhitacre commented 7 years ago

I don't see a side-effect to importing Payday, and wireup.billing also looks safe.

chadwhitacre commented 7 years ago
[gratipay] $ heroku run python < cancel-holds.py > cancel-holds.log 
Running python on gratipay... up, run.5784 (Hobby)
^C[gratipay] $ cat cancel-holds.log 
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

from gratipay import wireup

wireup.billing(wireup.env())

print('Greetings, program!')
Python 2.7.11 (default, Oct 26 2016, 16:32:16) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> # -*- coding: utf-8 -*-
teralsom __future__ import absolute_import, division, print_function, unicode_li 
>>> 
>>> from gratipay import wireup
>>> 
>>> wireup.billing(wireup.env())
>>> 
>>> print('Greetings, program!')
Greetings, program!
>>> [gratipay] $
chadwhitacre commented 7 years ago

Better method:

[gratipay] $ heroku run python -c "`cat greetings.py`"
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
Running python -c "# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

print('Greetings, program!')" on ⬢ gratipay... up, run.8444 (Hobby)
Greetings, program!
[gratipay] $
chadwhitacre commented 7 years ago

Okay, getting ready to pull the trigger on:

[gratipay] $ heroku run python -c "`cat cancel-holds.py`" 2>&1 | tee cancel-holds.log
from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])
chadwhitacre commented 7 years ago

3 ...

chadwhitacre commented 7 years ago

2 ...

chadwhitacre commented 7 years ago

1 ...

chadwhitacre commented 7 years ago

0!

chadwhitacre commented 7 years ago
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... starting, run.4177 (Hobby)
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... connecting, run.4177 (Hobby)
Running python -c "from gratipay import wireup
from gratipay.billing.payday import Payday
wireup.billing(wireup.env())
Payday.fetch_card_holds([])" on gratipay... up, run.4177 (Hobby)
pid-4 thread-139695064790784 (MainThread) Fetching card holds.
pid-4 thread-139695064790784 (MainThread) Canceled a $11.13 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.10 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $103.30 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.64 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $20.91 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $13.70 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $20.91 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.36 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.05 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.64 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.87 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.00 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.82 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.61 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $103.30 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.52 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $16.79 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.51 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $11.13 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $19.10 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $12.67 hold for [].
pid-4 thread-139695064790784 (MainThread) Canceled a $10.10 hold for [].
chadwhitacre commented 7 years ago

cancel-holds.log appended to gratipay-274.log in https://github.com/gratipay/logs/commit/aa24ac447d7ed8ac165531e881a9805586ca914f.

chadwhitacre commented 7 years ago

Still held in my bank account per bank's web interface. Will check back later on that.

chadwhitacre commented 7 years ago

We canceled one extra hold for 12.05 that must've been left over from ... last time? Or something? Otherwise the amounts all line up for the 31 we accidentally created.

chadwhitacre commented 7 years ago

Oh! Hold placement is multi-threaded so we could've created the 12.05 hold but not logged it.

chadwhitacre commented 7 years ago

Alright! Things to reticket:

chadwhitacre commented 7 years ago

Reticketed! Closing.