Modernize Countdown somewhat

Summary: Far from perfect, but better?

Test Plan:
{F51153}
{F51154}
{F51155}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6533
Launch daemons with a full Phabricator environment in the overseers

Summary:
Ref T1670. Prepare for the overseers to talk directly to the database instead of using Conduit. See T1670 for discussion.

This shouldn't impact anything, except it has a very small chance of destabilizing the overseers.

Test Plan:
Ran `phd launch`, `phd debug`, `phd start`.

Ran with `--trace-memory` and verified elevated but mostly steady memory usage (8MB / overseer). This climbed by 0.05KB / sec (4MB / day) but the source of the leaks seems to be the cURL calls we're making over Conduit so this will actually fix that. Disabling `--conduit-uri` reported steady memory usage. I wasn't able to identify anything leaking within code we control. This may be something like a dynamic but capped buffer in cURL, since we haven't seen any issues in the wild.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1670

Differential Revision: https://secure.phabricator.com/D6534
Use events rather than Conduit to report daemon status in Phabricator

Summary: Ref T1670. Use events and direct database writes instead of Conduit. Deprecate the Conduit methods.

Test Plan: Ran daemons, used the console to review daemon event logs.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1670

Differential Revision: https://secure.phabricator.com/D6536
Remove Conduit daemon methods

Summary: Fixes T1670. These are now unused.

Test Plan: Grepped for callsites.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1670

Differential Revision: https://secure.phabricator.com/D6538
Use modern UI elements to show daemons in Daemons

Summary:
Ref T3557. Slightly improves display of daemons:

  - Makes status more clear (through colors, explanatory text, icons, and explicit descriptions instead of symbols).
  - Particularly, the "wait" status is now communicated as a normal status ("waiting a moment...") with a calm blue color.
  - Uses modern responsive elements.

Test Plan: {F51232}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6539
Mostly modernize daemon detail views

Summary:
Ref T3557. The major goals here are:

  - Modernize use of UI elements.
  - Present daemon status with more clarity. Particularly, the "Waiting" status is called out and explained in detail.

Test Plan:
{F51247}

{F51248}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6541
Show wait delay in daemon UI explicitly

Summary: Ref T3557. I had misremembered this value; show it in the UI. Depends on D6542.

Test Plan: Viewed UI for a waiting daemon. Saw it restart after 5s.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6543
Use a real Query class to load daemon information

Summary:
Ref T3557. This stuff does a bunch of nonsense in the View right now. Instead, do it in a real Query class.

Fixes a long-standing bug which prevented "all daemons" from showing more than 3 days' worth of data.

Test Plan: Viewed `/daemon/`, viewed "All Daemons".

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6544
Allow long daemon log messages to be expanded

Summary:
Ref T3557. We summarize long messages, but don't let you see the entire message. This is occasionally inconvenient, and I'm planning to add more prefix junk to some messages for T2569.

Provide a link you can click to see the full message.

This isn't javascripted because a ton of these can make the page ridiculously enormous and it seems unlikely you'd care much about all of them.

Test Plan: {F51261} {F51262}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, chad

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6546
Add `bin/phd log <id>` to dump all logs to the CLI

Summary: Ref T3557. Make it easier to access full daemon logs from the CLI.

Test Plan: {F51265}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6547
Use PhutilProxyException to disambiguate repository pull errors

Summary: Ref T2569. When repository pulls fail, they don't necessarily list identifying information about which repository failed. Use a proxy exception to list that information.

Test Plan: {F51267}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2569

Differential Revision: https://secure.phabricator.com/D6548
Use PhutilProxyException to disambiguate work queue failures

Summary: Fixes T2569. This is the other common exception source which is ambiguous. List the task ID explicitly to make debugging easier.

Test Plan: {F51268}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2569

Differential Revision: https://secure.phabricator.com/D6549
Surface task queue temporary failure rate in Daemon console

Summary: Fixes T3557. One thing which made T3557 kind of a mess was the lack of information about progress through temporary failures. Add a column which records a task's last failure time, and surface it in the console.

Test Plan: {F51277}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3557

Differential Revision: https://secure.phabricator.com/D6550
Bucket Asana parent tasks by "assignee_status"

Summary: Ref T2852. When the parent task is actionable (needs revision, accepted) give it an "Upcoming" status; otherwise give it a "Later" status.

Test Plan: Sync'd "Needs Revision" and "Needs Review" tasks and saw them both bucket correctly

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2852

Differential Revision: https://secure.phabricator.com/D6551
Fix a bad query in LeaseQuery

Summary: Fixes T3610. This got un-scoped at some point, and is only used in Drydock so it escaped notice.

Test Plan: Ran `bin/drydock lease --type host` without hitting an exception about incorrect query construction.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3610

Differential Revision: https://secure.phabricator.com/D6552
Use application PHIDs in Phriction

Summary: Ref T2715. Moves Phriction to application PHIDs.

Test Plan: Used `phid.query`; browsed Phriction.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6553
Use Application PHIDs in Ponder

Summary: Ref T2715. Switch Ponder to the new IDs.

Test Plan: Ran `phid.lookup`; `phid.query`. Grepped for old constant

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6554
Use application PHIDs in Paste

Summary: Ref T2715. Switch Paste to application PHIDs.

Test Plan: Used `conduit.query`; `conduit.lookup`; grepped for constants.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6555
Use application PHIDs in Macro

Summary: Ref T2715. Move Macro to application PHIDs.

Test Plan: Used `conduit.query` to look up macros.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6556
Use application PHIDs in Phlux

Summary: Ref T2715. PVAR -> app phids

Test Plan: Used `conduit.query` to load one.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6557