Run new batches as the submitting user
AcceptedPublic

Authored by LucasWerkmeister on Oct 18 2018, 2:53 PM.

Details

Reviewers
Magnus
Patch without arc
git checkout -b D1119 && curl -L https://phabricator.wikimedia.org/D1119?download=true | git apply
Summary

This adds a new table storing OAuth details for a batch, and populates it when any new batch is created. When running commands for a batch, QuickStatements will attempt to load the OAuth details for that batch, and run the commands using those details instead of the bot account in case of success.

The effect of this is that any new batches will be run as the user who submitted the batch, instead of as the bot account. Old batches that were in progress when this commit was deployed will continue to complete as the bot account, since we don’t have OAuth details for them (and it would be odd to change the account mid-batch anyways).

Error handling is relaxed compared to surrounding code in several places, generally falling back to OAuth-less mode instead of aborting.

Diff Detail

Repository
R2010 tool-quickstatements
Lint
Lint Skipped
Unit
Unit Tests Skipped
LucasWerkmeister requested review of this revision.Oct 18 2018, 2:53 PM
LucasWerkmeister created this revision.
Magnus accepted this revision.Oct 18 2018, 3:28 PM
This revision is now accepted and ready to land.Oct 18 2018, 3:28 PM