• 
      

    Allow API cookie storage paths to be configured.

    Review Request #11545 — Created March 22, 2021 and submitted — Latest diff uploaded

    Information

    ReviewBot
    release-3.0.x

    Reviewers

    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 $HOME to a
    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.

    Existing reviewbot-cookies.txt files 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
    (on macOS).

    Built the docs and checked for bad links, build errors, and spelling
    errors.

    Commits

    Files