1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 10:18:48 +02:00
Commit graph

86 commits

Author SHA1 Message Date
epriestley
74f3112b1c Allow daemons to perform writes unconditionally. 2011-08-16 13:43:51 -07:00
epriestley
879431fb50 Improve GC performance for Herald Transcripts
Summary: This has to table scan a ginormous table right now, give it a fighting
chance with a more usable key.
Test Plan:
  - Launched GC daemon, no errors.
  - Used test console to create a new transcript.
  - Viewed some old transcripts.
  - Ran EXPLAIN on the SELECT and verified it was utilizing the garbageCollected
key.

Reviewed By: jungejason
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley, jungejason
Differential Revision: 735
2011-07-28 18:50:54 -07:00
epriestley
51c2726a34 Add Differential parse cache to the GC daemon
Summary:
Add the differential parse cache to the GC. This is the largest object in the
system by a wide margin, I think.

This table is potentially gigantic which is why the script truncates it before
doing a schema change.

Test Plan: Ran the GC daemon, it cleaned up some parse caches.
Reviewed By: jungejason
Reviewers: tuomaspelkonen, jungejason, aran
Commenters: tuomaspelkonen
CC: aran, jungejason, tuomaspelkonen, epriestley
Differential Revision: 620
2011-07-08 17:31:25 -07:00
Ricky Elrod
3d85d6a81d Add language to paste.info, and show it in Pxxx responses from phabot.
Summary:
Now that we store language with pastes, we can include this in Conduit.

Test Plan:
Tried it on a paste with a blank language, and one with a specified language.
    16:14:50 <@CodeBlock> P1
    16:14:51 <@codeblock-phabot> P1: http://phabricator.local/P1 - test.php
    16:15:05 <@CodeBlock> P43
    16:15:06 <@codeblock-phabot> P43: http://phabricator.local/P43 - sadoijfoisaf (php)

Reviewers:
epriestley, Ttech

CC:

Differential Revision: 616
2011-07-08 13:55:22 -07:00
epriestley
4ef918e213 Add a garbage collector daemon
Summary:
Phabricator generates a bunch of data that we don't need to keep around forever,
add a GC daemon to get rid of it with some basic configuration options.

This needs a couple more diffs to get some of the details but I think this is a
reasonable start.

I also fixed a couple of UI things related to this, e.g. the daemon logs page
going crazy when a daemon gets stuck in a loop and dumps tons of data to stdout.

Test Plan:
  - Ran gc daemon in 'phd debug' mode and saw it delete stuff, then sleep once
it had cleaned everything up.
  - Mucked around with TTLs and verified they work correctly.
  - Viewed gc'd transcripts in the web interface and made sure they displayed
okay.
  - Viewed daemon logs before/after garbage collection.
  - Running some run-at / run-for tests now, I'll update if the daemon doesn't
shut off in ~10-15 minutes. :P

Reviewed By: tuomaspelkonen
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, tuomaspelkonen, epriestley
Differential Revision: 583
2011-07-05 13:49:11 -07:00
Ricky Elrod
eeb8d10f42 Edited src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php via GitHub 2011-07-05 08:55:21 -07:00
epriestley
39adae9aa8 Prevent Phabot from spinning out of control
Summary: When the remote closes the connection, phabot goes into a busy loop
because of PHP's "nothing should ever be an error" semantics. Instead, detect
connection termination.
Test Plan: Disabled the "PONG" response in the protocol handler and let freenode
disconnect phabot. It spun out of control before, now it detects the issue and
exits to await automatic restart.
Reviewed By: jungejason
Reviewers: codeblock, jungejason, aran, tuomaspelkonen
CC: aran, jungejason
Differential Revision: 582
2011-07-03 09:58:11 -07:00
Evan Priestley
edf6a44db3 Merge pull request #28 from CodeBlock/3346f04d89548ebfa6e84c6bada01b84b
D552 and 553.
2011-06-29 12:16:57 -07:00
Ricky Elrod
3346f04d89 Add Pxxx to phabot.
Summary:
Summarize (or at least link to) pastes when P<id> is given in a channel. This depends on D552!

Test Plan:
04:34:03 <@codeblock-phabot> P15 - http://phabricator.local/P15
04:35:22 <@CodeBlock> P1 asdf foo Bar Baz Diet Sprite P4
04:35:24 <@codeblock-phabot> P1 - http://phabricator.local/P1
04:35:24 <@codeblock-phabot> P4 - http://phabricator.local/P4

Reviewers:
epriestley

CC:

Differential Revision: 553
2011-06-29 15:00:07 -04:00
Ricky Elrod
2728a41fa0 Make phabot understand Txxx.
Summary:
Maniphest tasks can now be summarized by referencing their respective T<id> in irc.

Test Plan:
03:29:28 <@CodeBlock> T218
03:29:29 <@codeblock-phabot> T218: NYANCAT (Priority: Wishlist) - https://secure.phabricator.com/T218
03:30:14 <@CodeBlock> T58 asdf foo bar baz mcFoo T163
03:30:15 <@codeblock-phabot> T58: Allow AphrontFormView to render as a <div /> instead of a form (Priority: Wishlist) - https://secure.phabricator.com/T58
03:30:15 <@codeblock-phabot> T163: arc amend is slow (Priority: Needs Triage) - https://secure.phabricator.com/T163
...
03:28:23 <@CodeBlock> Oh. Hah, I'm testing against production Conduit. Ah well.
03:28:40 <@CodeBlock> I don't always test my code...but when I do, I do it in prod! :D

Reviewers:
epriestley

CC:

Differential Revision: 551
2011-06-29 04:14:16 -04:00
epriestley
709d7ed5d7 Use the proc-error-aware signaling check for daemons from the CLI
Summary:
The web console already correctly checks for processes which are running but
can't be signaled. Share this check in the CLI.

Test Plan:
Looked at the web console. Poked at the CLI.

Reviewed By: fratrik
Reviewers: fratrik
CC: aran, fratrik
Differential Revision: 544
2011-06-27 15:01:07 -07:00
epriestley
b61e325f05 Show logs to the console in 'phd debug'
Summary:
Currently we send logs to the logfile in 'phd debug', but we should send them to
the console instead.

Also fixed some %C stuff which could theoretically cause problems if a user had
percentage symbols in their paths (heaven forbid).

fratrik, this or D535 might have been involved in frustrating your efforts to
debug the "sudo" stuff.

Test Plan:
Ran "phd debug irc derpderp" and "phd launch irc derpderp". In the former case,
the exception appeared in the console. In the latter, it appeared in the log.

Reviewed By: codeblock
Reviewers: codeblock, jungejason, tuomaspelkonen, aran, fratrik
CC: aran, codeblock
Differential Revision: 536
2011-06-26 20:41:08 -07:00
epriestley
d33670c416 Update Herald documentation. 2011-06-14 11:09:40 -07:00
epriestley
555464c4a7 "Paste" application tweaks
Summary:
Tweaks to the paste app:

  - I realized that unlike all the other apps, it makes more sense for the
default view of this one to be "create paste" instead of "list pastes" since
when you access the application directly you are most often wanting to share
something. Swap list out of the default slot and make edit the default.
  - Make the textarea bigger (usability).
  - Allow you to copy an existing paste.
  - Implement 'raw view'.
  - Tweak/adjust list view (usability, formatting).
  - Tweak page titles.

Test Plan:
Created, copied, and listed pastes. Viewed raw paste. Created an invalid paste.
Tried to create a copy of a nonexistant paste.

Reviewed By: codeblock
Reviewers: codeblock, jungejason, aran, tuomaspelkonen
CC: aran, epriestley, codeblock
Differential Revision: 456
2011-06-13 21:13:32 -07:00
epriestley
8f63873d57 Ping conduit from PHD and set daemon logfiles. 2011-06-13 18:39:23 -07:00
epriestley
1d28d97307 This needs a defualt or everything is ruined. 2011-06-13 18:07:58 -07:00
Ricky Elrod
226fdb5589 Fix IRC nick regex.
Summary:
Nicks can contain more characters than were allowed. The new regex is ugly,
but should include most of them.

Test Plan:
Joined the bot as phabot-c0d`eb1^ock successfully.

Reviewers:
epriestley

CC:

Differential Revision: 453
2011-06-13 19:24:23 -04:00
epriestley
cb0cbc50ad Add a "phd debug" command
Summary:
Make it easier to find obvious problems in daemons by letting them run
undaemonized in the console without requiring the user to know the magical
incantations for loading libraries, etc.

Test Plan:
Ran "phd debug nice", simulated some failures (e.g., bringing down Phabricator,
daemon fatal) and got useful error messages.

Reviewed By: jungejason
Reviewers: toulouse, jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 448
2011-06-13 13:42:01 -07:00
epriestley
fedbd475b5 Create phd PID directory if it doesn't exist, and give the user a meaningful
error message if that doesn't work

Summary:
This workflow is needlessly bad right now, make it not terrible.

Also removed some related, unused code.

Test Plan:
Ran 'phd launch nice' with no directory and with a failing mkdir command.

Reviewed By: toulouse
Reviewers: hsb, toulouse, codeblock
CC: aran, toulouse
Differential Revision: 440
2011-06-12 22:40:07 -07:00
epriestley
0ad2b526bc Don't mention the same object in IRC more than once every 10 minutes
Summary:
phabot gets spammy when discussing a specific revision.

Test Plan:
Added debugging code and produced a reasonable-looking chatlog:

  [1:15pm] phabotlocal joined the chat room.
  [1:15pm] epriestley: D5
  [1:15pm] phabotlocal: D5 quack - http://local.aphront.com/D5
  [1:15pm] epriestley: D5
  [1:15pm] phabotlocal: Declining to mention PHID-DREV-d7940d0fe081e3ae5267
again (59s left).
  [1:15pm] epriestley: D5
  [1:15pm] phabotlocal: Declining to mention PHID-DREV-d7940d0fe081e3ae5267
again (57s left).
  [1:15pm] CodeBlock: nice :D
  [1:15pm] epriestley: I should just leave that code in for maximum irony.
  [1:15pm] epriestley: D5
  [1:15pm] phabotlocal: Declining to mention PHID-DREV-d7940d0fe081e3ae5267
again (9s left).
  [1:16pm] epriestley: D5
  [1:16pm] phabotlocal: Declining to mention PHID-DREV-d7940d0fe081e3ae5267
again (2s left).
  [1:16pm] epriestley: D5
  [1:16pm] phabotlocal: D5 quack - http://local.aphront.com/D5
  [1:16pm] epriestley: D5
  [1:16pm] phabotlocal: Declining to mention PHID-DREV-d7940d0fe081e3ae5267
again (57s left).
  [1:16pm] epriestley: rJUI100
  [1:16pm] phabotlocal: http://local.aphront.com/rJUI100
  [1:16pm] epriestley: rJUI100
  [1:16pm] phabotlocal: Declining to mention PHID-CMIT-8fb731b171a27b8d477c
again (55s left).
  [1:16pm] phabotlocal left the chat room. (Remote host closed the connection)

Reviewed By: aran
Reviewers: aran, codeblock, hsb, mroch
CC: aran
Differential Revision: 420
2011-06-09 13:48:03 -07:00
epriestley
d3fed84b9c Minor IRCBot fixes/upgrades
Summary:
Keep him from getting killed every 24 hours by the overseer, add basic commit
support.

Test Plan:
Ran irc bot, fed him a commit, fed him "http://blah/D1".

Reviewed By: aran
Reviewers: aran, jungejason, tuomaspelkonen, codeblock, mroch
CC: aran, epriestley
Differential Revision: 377
2011-05-30 12:24:39 -07:00
epriestley
28146171ce Add an "IRC Object Name" handler for D12345
Summary:
I need to add some more conduit methods / info to make this at all useful but
here's some basics.

Test Plan:
Hung out in #phabot-test

Reviewed By: mroch
Reviewers: mroch, codeblock, aran, jungejason, tuomaspelkonen
CC: aran, mroch, epriestley
Differential Revision: 300
2011-05-17 16:16:25 -07:00
epriestley
f1d43bc3c5 Establish a Conduit connection from PhabricatorIRCBot
Summary:
Allow construction of handlers which use Conduit.

Test Plan:
Made a bot that connects to local and runs conduit.ping.

Reviewed By: mroch
Reviewers: mroch, codeblock, aran, jungejason, tuomaspelkonen
CC: aran, mroch
Differential Revision: 299
2011-05-17 16:16:07 -07:00
epriestley
417ca39703 Update Phabricator to new PhutilServiceProfiler APIs
Summary:
Get rid of the Phabricator-level DarkConsole-specific API and use the more
general Phutil-level one.

Test Plan:
Loaded DarkConsole services plugin, viewed Diffusion, got execs in the trace.

Reviewed By: aran
Reviewers: aran, jungejason, tuomaspelkonen
CC: aran
Differential Revision: 293
2011-05-16 17:10:18 -07:00
epriestley
3fdc115b54 Very basic IRC Bot
Summary:
This is sort of a silly/fun project but I think there's some utility. For
example, mroch added some handlers to an eggdrop or something similar to look
for "D12345" and print out the title/link, which was actually pretty useful.

We could also add logging here and subsume the more-or-less unowned Facebook
tool that does the same thing, especially since we can get a bunch of good stuff
it doesn't support (like search) more or less for free.

This is also an easy way to provide some example code for writing Conduit system
agents.

This is a minimal implementation which creates a bot that connects to a
hard-coded server and sits there indefinitely. Next steps:

  - Add conduit/sysagent support
  - Write differential/maniphest/diffusion handlers
  - Move configuration to the web interface (?) and integrate with phd
  - Write a logging handler?

Test Plan:
Ran bot with "exec_daemon.php", it connected to the hard-coded server and sat
there indefinitely.

Reviewed By: aran
Reviewers: codeblock, mroch, tuomaspelkonen, aran, jungejason
CC: aran, epriestley
Differential Revision: 283
2011-05-16 13:18:02 -07:00
jungejason
c223aaa79e Enable phd to load extra libraries
Summary: add --load-phutil-library for libraries other than phabricator
and libphutil.

Test Plan: launch a daemon in facebook such as
PhabricatorDifferentialCommentDaemon.

Reviewers: epriestley, tuomaspelkonen

CC:

Differential Revision: 146
2011-04-15 18:57:03 -07:00
epriestley
ca7a0de1cf Prevent a race in Phabricator workers
Summary: See D133. Workers can also be subject to the same race, invert the
row relationship in the same way.

Test Plan: Launched repository master daemons and some taskmasters and used
the Daemon console to veify that they were able to process tasks. Manually
checked the database to make sure data got linked correctly and that new data
was inserted correctly.

Reviewers: jungejason

CC: tuomaspelkonen

Differential Revision: 135
2011-04-14 12:09:56 -07:00
epriestley
ee1e2da8fb Avoid Timeline race condition
Summary: While I should fix the transactional stuff, that patch is going to be
tricky and transactions have some performance implications. This is a simple
fix which prevents the race.

Instead of having the data point at the event ID, have the event point at a
data ID. Insert the data first, then insert the event with the right data
pointer. This is super simple and prevents the race issue.

Test Plan:
  - Ran the schema upgrade script, verified that the database was
    correctly upgraded. Was also prompted to stop daemons.
  - Ran 'repository-launch-master', verified that the discovery daemons were
    able to discover new commits and insert events for them. Verified the
    committask daemon was consuming events and converting them into tasks.
  - Verified new tasks looked correct in the database.
  - Browsed web interface.

Reviewers: jungejason

CC: tuomaspelkonen

Differential Revision: 133
2011-04-14 10:12:10 -07:00
epriestley
1f88e08761 Move 'phd parse-commit' to a dedicated script; allow message parsing tasks to
be executed in isolation, provide a script to requeue all message reparses,
stop parse-commit from inserting side-effect tasks.
2011-04-02 13:23:22 -07:00
epriestley
01b2a6bbe1 Show and reap dead daemons from phd. 2011-03-27 00:23:39 -07:00
epriestley
ab2b83ce14 Fix chdir() + proc_open() php 5.2 issues. 2011-03-15 20:55:05 -07:00
epriestley
bb144542d3 Diffusion/phd/console improvements. 2011-03-15 13:38:14 -07:00
epriestley
bf196910b0 More phd stuff. 2011-03-15 10:23:35 -07:00
epriestley
8bcbeface1 Increase parseriness of some parsery things.
Summary: None of these are parsnips.

Test Plan:

Reviewers:

CC:
2011-03-11 09:34:22 -08:00
epriestley
ec084ca419 Rough cut of Workers
Summary: workers do work, provided I have written them correctly. perhaps it
is so.

Test Plan:

Reviewers:

CC:
2011-03-10 13:48:29 -08:00
epriestley
57495c4287 Rough cut of repository tracking
Summary: Basic scaffolding for repository tracking, plus daemon infrastructure
(Timelines, Cursors) and some fixes (memory usage, mysql_connect() junk).

Test Plan: parsed Javelin git commit history via daemon

Reviewers:

CC:
2011-03-06 22:29:22 -08:00