Allow API cookie storage paths to be configured.
Review Request #11545 — Created March 22, 2021 and submitted
Review Bot has historically used the local directory it's being run from
as the location for the
reviewbot-cookies.txt. That wasn't a very nice
experience, and required deployments to explicitly set
writable path. We had no safeguards in case the cookies couldn't be
written to, either.
This change makes the cookie storage path configurable, and gives it a
reasonable default (the XDG-defined user cache path).
Any failure to create the cookie directory or cookie file, or to write
to it, will trigger a fatal error at startup. This will contain explicit
information about what is wrong.
reviewbot-cookies.txtfiles in the home directory will be
ignored, but Review Bot will just authenticate again the next time, so
it shouldn't impact any users.
Unit tests pass on Python 2.7 and 3.x.
Manually tested all success and error conditions with cookie storage
Built the docs and checked for bad links, build errors, and spelling