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.
StatusSubtypeAssignedTask
ResolvedNone
Resolved Springle

Event Timeline

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 Medium priority.Dec 11 2014, 5:25 PM

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

Granted SELECT on phabricator_maniphest.* to phstats@iridium.

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

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

phstats now has access to both phabricator_maniphest and phabricator_user.