Page MenuHomePhabricator

Chatbot requires access to the database
Closed, ResolvedPublic

Description

The chatbot (i.e. PhabricatorBot) requires access to the database, which is not obvious. Whilst the chatbot uses Conduit for querying data from Phabricator, it seems that access is required to the database to record the daemon status. I don't think that we need to record the daemon status to the database for this bot though?

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Chatlog.
joshuaspence added a subscriber: joshuaspence.
epriestley triaged this task as Wishlist priority.Dec 4 2015, 1:16 PM
epriestley added a subscriber: epriestley.

I think there are two issues here:

  • PhabricatorDaemonEventListener pings the database.
  • The overseer loads scripts/__init_script__.php on launch, which loads configuration from the database.

The pings are pretty easy to fix, I think:

  • We could put some isStealthy() method on PhabricatorDaemon to allow this to be turned off.
  • (Generally, it would be nice to fold this whole thing into PhutilDaemonOverseerModule and get rid of the events entirely, I think?)

Fixing the second case seems hard, though:

  • Make PhabricatorBot extend PhutilDaemon instead of PhabricatorDaemon? Maybe even put it in libphutil?
  • We can't launch it with bin/phd? Not sure what to do about that.
epriestley claimed this task.

Per discussion T11508, I'm just going to officially call this a "feature".

In the far future, I plan to move chat daemons into the core and make them depend on Phabricator anyway, and we have no other reasons to break this dependency.