Page MenuHomePhabricator

SQL user/grant for phabricator statistics script
Closed, ResolvedPublic

Description

for T1003, we would like to run a script on the phabricator database to fetch various statistical values (like "how many tickets created" and much more)

in https://gerrit.wikimedia.org/r/#/c/177792/6/modules/phabricator/templates/community_metrics.sh.erb i'd be using a shell script to access the db, like we did in Bugzilla

you see that i could just use the existing "appuser" and password but it has been pointed out by Chase that a separate user would be better and i agree

can you make one more user/grant like "phmetrics" or "phstats" and add it to passwords::mysql::phabricator ($metrics_user = 'phmetrics' .. ?

it should be allowed to connect from server iridium to the phabricator prod db on m3-master and it should be _read-only_ so that even if a script update messes up it can't do any damage. we will just need to select so far from database "phabricator_maniphest"

P.S. should there be a phabricator project called "SQL" or "DB-related" or "DB access requests" or something?

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Dzahn created this task.Dec 11 2014, 5:11 PM
Dzahn assigned this task to Springle.
Dzahn raised the priority of this task from to Needs Triage.
Dzahn updated the task description. (Show Details)
Dzahn changed Security from none to None.
Dzahn added subscribers: Dzahn, chasemp, Aklapper.
Aklapper triaged this task as Normal priority.Dec 11 2014, 5:25 PM
Qgil awarded a token.Dec 11 2014, 7:41 PM
Springle closed this task as Resolved.Dec 15 2014, 4:44 AM

Added to passwords::mysql::phabricator $metrics_user (phstats) and $metrics_pass.

Granted SELECT on phabricator_maniphest.* to phstats@iridium.

Dzahn added a comment.Dec 15 2014, 2:16 PM

Thank you Sean. Patch amended using the new metrics user.

Dzahn reopened this task as Open.Dec 17 2014, 11:39 AM

re-opening, because now we have an additional requirement. In T1003 we have been asked to add another query but it access a different database, the "phabricator_user" database as opposed to just the "phabricator_maniphest" database.

Could you additionally give this user read-only access to db "phabricator_user"? Thanks

Qgil moved this task from To Triage to Ready to Go on the Phabricator board.Dec 22 2014, 10:04 AM

phstats now has access to both phabricator_maniphest and phabricator_user.

Dzahn closed this task as Resolved.Dec 23 2014, 1:02 PM

thanks :)