Commit Graph

126 Commits

Author SHA1 Message Date
Tim Abbott a83ecc0618 check-mirroring: Don't fail when messages get reordered.
This happens sometimes (especially when our server is restarting), and
isn't a _real_ problem -- it's much more important that we have a
completely reliable test that we can put a Nagios alert against.

(imported from commit 0add0b3dfc5447307014bbb9137366bd7141ade0)
2012-11-08 13:34:29 -05:00
Tim Abbott 71e2e1cb1b zephyr_mirror: Support subscribing to non-ascii Zephyr classes.
(imported from commit 85437f09c4738df11208e623db566a9409e501a3)
2012-11-07 16:42:06 -05:00
Keegan McAllister e54e93dccb zephyr_mirror: Don't open /dev/null to disable logging
(imported from commit 804e627d6d70bbf2ae1ee2f467b79ed0582ced0f)
2012-11-07 16:36:40 -05:00
Keegan McAllister d7a2b0930e zephyr_mirror: Always pass a tuple to string %
(imported from commit 64a59e23c3aa3fceb350ed348812258c90ff09da)
2012-11-07 16:36:36 -05:00
Tim Abbott e7abe13cd6 The empty string shouldn't be a valid stream name.
(imported from commit 1fa878d7d51d3c3444ac75edf08b32f886683964)
2012-11-07 15:42:32 -05:00
Tim Abbott 935632428b zephyr_mirror: Use zephyr's bulk subscription functionality.
Previously we were spending 15 seconds on linerva (and more like 2.5
minutes on the not-yet-operational zmirror.humbughq.com) to subscribe
to all of our streams.

(imported from commit c36cb1c26868f142683d9c92d4875fcd4931886e)
2012-11-07 15:37:55 -05:00
Tim Abbott 7aaa08d9b2 zephyr_mirror: Eliminate the confusing "subs" global.
zephyr.Subscriptions() is a singleton class, intended to be accessed
as it is used.

(imported from commit f76c1b1129adb19ba96ed17f441492edf859a748)
2012-11-07 15:37:55 -05:00
Tim Abbott a87ac2dec9 zephyr_mirror: Fix missing api key file error message.
(imported from commit 3efe7fb8b2d593418c37dbab9389a8df9c27d003)
2012-11-07 15:37:55 -05:00
Tim Abbott 90439bbd9e zephyr_mirror: Make the logging options require the log path as an argument.
This is for supporting running the mirroring bot on a server without
AFS.

(imported from commit 400bf32f17aca984fa40c3b1222893214497eaa0)
2012-11-07 15:37:55 -05:00
Tim Abbott 36d5fabf29 zephyr_mirror: Use os.path.join for constructing the root_path.
(imported from commit d894ab68430e42233a7aa6b289f01e790f8c8586)
2012-11-07 15:37:46 -05:00
Tim Abbott 97aaa20b8c zephyr_mirror: Add option to change the root path.
This is relevant for running not out of AFS on Linerva.

(imported from commit 28549830c99ad5a52349fbcc9e53dcb3c5ef25a1)
2012-11-07 15:35:26 -05:00
Keegan McAllister a0232811b2 check-mirroring: Get the max_message_id from get_profile()
(imported from commit 95f457b91563a92eee24c4487c00abe7132b4ff8)
2012-11-07 15:34:44 -05:00
Jessica McKellar 9077d51d54 For now, allow all characters in stream names.
We've had multiple requests from MIT zephyr users to allow
non-alphanumeric stream names, and we haven't decided what we want to
allow, so for now allow everything.

Note that the web client and mirror script limit stream names to 30
characters, which is our database limit.

(imported from commit 2acb5ee04e5ee7c40031ac831e12d09d04bbb2e6)
2012-11-07 15:12:03 -05:00
Tim Abbott 8752b3bf18 zephyr_mirror: don't crash when the zephyr server returns SERVNAK errors.
Zephyr has this great property where a small fraction of the time, the
Zephyr server rejects your attempt to subscribe to something for no
particular reason, returning a "SERVNAK" error.

(imported from commit 6d5ed033d46d77a5b02539a816453724740f8fb0)
2012-11-07 13:56:21 -05:00
Tim Abbott 837fdca1c4 feedback-bot: Only forward messages sent directly to feedback@.
(imported from commit 4a4d1e4a3ba00deb929647f7f35f2982c2b4add6)
2012-11-06 16:59:28 -05:00
Tim Abbott 9b8e5bc93f Bots: Send messages through staging.humbughq.com.
(imported from commit d9859bfe5f5b3b7c5efa5ef930d6cfaa5c0d1fc2)
2012-11-06 16:59:28 -05:00
Tim Abbott b281235a81 zephyr_mirror: Remove remaining AFS reads when restarting automatically.
This does introduce a small security issue, in that a shell with
expired AFS tokens on the machine running the mirroring script will be
able to read the Humbug API key using /proc/pid/environ.  I think this
is fine -- you can steal the API key from a running process using
ptrace anyway.

(imported from commit c6fdb798294fb32d640823b409f3e46274ca01f4)
2012-11-06 15:10:11 -05:00
Tim Abbott 0717665b69 zephyr_mirror: Zev's proposed fix to latest linewrapping problem.
(imported from commit 90fc4774e10255d0237a37b8af753059a66efb2d)
2012-11-06 11:31:37 -05:00
Tim Abbott c04815ad38 zephyr_mirror: Add support for importing as a library.
(imported from commit 91dc7e8fae89ba8ade8dd98b747a25b46fca13e7)
2012-11-06 11:31:37 -05:00
Tim Abbott 08d75c5c64 zephyr_mirror: Speed up retrying the restart process.
(imported from commit 7f7a2aaa8a7f872180400f57ad09c065ea2ababa)
2012-11-05 18:39:02 -05:00
Tim Abbott 8a870047db zephyr_mirror: Also linewrap with extremely long strings.
(imported from commit cffa80f283fdac341942beb56ada9013cb8f7c39)
2012-11-05 18:39:02 -05:00
Tim Abbott 298ceb13a7 zephyr_mirror: Only strip trailing whitespace.
(imported from commit f349778200e0c2fb410e5e2644c82ba4105f3634)
2012-11-05 18:39:02 -05:00
Tim Abbott a4a94050e6 zephyr_mirror: Improve different-paragraph detection algorithm.
(imported from commit 789651dd5b9af58bbc0e59a64dd565f06585134d)
2012-11-05 18:39:02 -05:00
Tim Abbott f07e0a6324 zephyr_mirror: Make paragraph break detection a bit less aggressive.
Because in the zephyr world, people often manually linewrap their
zephyrs, we need to relax the algorithm's assumption that every line
was wrapped to the same linewrapping threshhold.  Otherwise messages
that look like this:

aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa
aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaa
aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa

might be treated as a paragraph break, even though that was unlikely
to have been the sender's intention.

(imported from commit e1144da2a3efc3241a8f15b0f19fea2ea6684254)
2012-11-05 18:39:02 -05:00
Tim Abbott 850e70c592 zephyr_mirror: Fix name of MIT Zephyr realm.
(imported from commit 2c4d269fee673171fcbacbd865135d266489559d)
2012-11-05 18:39:02 -05:00
Tim Abbott 3af18006ce zephyr_mirror: Fix syncing instances of class message.
(imported from commit dfbbce336145ef6233eab27120a1ccefda055b13)
2012-11-05 18:39:02 -05:00
Tim Abbott bfae15c887 zephyr_mirror: Use SIGTERM to try to kill children.
It's generally best to first try killing with SIGTERM, and if we fail
to kill the child, we'll end up trying to kill them with SIGKILL
anyway when the new zephyr_mirror process starts up,

(imported from commit cfee2dd5f809f6e38d90a09be82719a8660d8377)
2012-11-05 18:39:02 -05:00
Tim Abbott bd60b071e5 zephyr_mirror: Use better line unwrapping algorithm.
(imported from commit e58ad67e98a9f2ec672162f955e49883d2dd3ab8)
2012-11-05 18:39:02 -05:00
Tim Abbott 605353027e zephyr_mirror: Encode the content as utf-8 before sending to zwrite.
(imported from commit 8bc578701a99f98eb5cc3e179fef696514da0066)
2012-11-05 10:20:40 -05:00
Zev Benjamin bd62c58a61 zephyr_mirror: do case-insensitive compare when checking for instanced personals
Users were seeing "[-i PERSONAL]" prepended to mirrored zephyrs.

(imported from commit 82f1c93705f4000607ad8fd733c9fb5045619b10)
2012-11-05 00:48:00 -05:00
Tim Abbott 61d42511fb zephyr_mirror: Don't try to forward Humbug cross-realm messages to Zephyr.
(imported from commit b14174d79c88dcaec57207cd8467aa14d9cf02ba)
2012-11-04 06:50:52 -05:00
Tim Abbott 18a5f9e1da zephyr_mirror: Comment subject truncation.
(imported from commit eb292b47d74388d9c0065661c8b6fef9ab6f3554)
2012-11-04 06:50:52 -05:00
Tim Abbott ebada01f91 zephyr_mirror: Fix handling of cross-realm Zephyr users.
(imported from commit c3739bcd383e73ef7f5347f0665e990a0d121a47)
2012-11-04 06:50:52 -05:00
Tim Abbott b798b66ba0 zephyr_mirror: Small logic fix in add_humbug_subscriptions.
(imported from commit bbcb7710310186612a8e7661a20b8b6558614758)
2012-11-04 06:50:52 -05:00
Tim Abbott d95d346afc zephyr_mirror: Clean up old mirroring duplicate suppression.
(imported from commit ada8b4747d329da8b84acc8d3ff4fa2a4d653938)
2012-11-04 06:50:52 -05:00
Tim Abbott 5686d25b45 zephyr_mirror: Parse zsig/body in its own function.
(imported from commit b692fa692d24d79f797852acffa0472d68930c88)
2012-11-04 06:50:52 -05:00
Tim Abbott 29ff3fd840 zephyr_mirror: Don't force-lower-case instance names.
(imported from commit 5b9b450ae7666a9c74704a7bd494c57a47578fe7)
2012-11-04 06:50:51 -05:00
Tim Abbott 45bffc8a0e zephyr_mirror: Reduce code dupliation in process_notice.
(imported from commit f0d371cfcd3f4f5443dea5dc8f96f53df160d179)
2012-11-04 06:50:51 -05:00
Tim Abbott f4fef79be3 zephyr_mirror: Clean up send_humbug() interface.
(imported from commit 76d53e83eacedead2dabbf921e240afc4e4d09db)
2012-11-04 06:50:51 -05:00
Tim Abbott 07f12b51c8 zephyr_mirror: Remove an unnecessary username parsing.
(imported from commit 56c27a6cd923f13e23b70914f85dd73661e27651)
2012-11-04 06:50:51 -05:00
Tim Abbott bcf34d6373 zephyr_mirror: Use a function to compute Zephyr usernames.
(imported from commit 73c066944942169d5a37fada110ed95aa2c10c94)
2012-11-04 06:50:51 -05:00
Tim Abbott e5df7b289c zephyr_mirror: Rename humbug_username to to_humbug_username.
(imported from commit 764673b9ccf2f58f88e1d6eec173a1c49ac15cad)
2012-11-04 06:50:51 -05:00
Tim Abbott 63a015f67d zephyr_mirror: Use %me% rather than guessing the current Zephyr user.
(imported from commit 8c04581c4327a44515b9ce1b938c69675964c6c0)
2012-11-04 06:50:51 -05:00
Tim Abbott f75fc44a4e zephyr_mirror: Don't let a single bad message break humbug=>zephyr forwarding.
(imported from commit 9b20f5e9c661fe0850c119309f4fe6f2c5d40679)
2012-11-02 14:15:46 -04:00
Tim Abbott f8d5287581 zephyr_mirror: Shell out to zwrite instead of using python-zephyr to send.
This eliminates the problems with python-zephyr not being able to
handle non-ascii characters in instances and class names.

(imported from commit c9f295cb18bc5043cd8efecbe6996ff373f66c9a)
2012-11-02 14:15:46 -04:00
Tim Abbott c81515e6ac Use the empty string rendered in blue as the zsig loop avoidance token.
(imported from commit 10610b25b006f85b6557592ce73899381b520e3b)
2012-11-02 13:49:30 -04:00
Tim Abbott 795808e7cc zephyr_mirror: Support the empty string in blue as our loop detection technique.
(imported from commit 4f9c77df7479bfa485dac381514ee2c591ce09ef)
2012-11-02 13:49:29 -04:00
Tim Abbott 2279214600 Add copyright notice to zephyr mirroring bots.
(imported from commit f3d27a032a461cf3eb92822feee3f8e790d630dd)
2012-11-02 13:49:29 -04:00
Tim Abbott 3aab57a283 humbug_trac: Don't send some updates without a comment.
(imported from commit 2cf5e8c2fc1cefcbfe440b2e29d89b78f19205e6)
2012-11-02 10:50:59 -04:00
Tim Abbott f319eef425 humbug_trac: Remove redundant 'Trac ' in subjects.
(imported from commit 309b477963cd0d3cca06eef2a685b1143c144455)
2012-10-31 14:06:35 -04:00
Tim Abbott 31666a1f3d humbug_trac: Try to compress the rest of the changes.
(imported from commit a7bdf3cb8243d43837705d4c9eb00d5e6d75d4b5)
2012-10-31 14:06:35 -04:00
Tim Abbott b9c54ed6f2 Include the trac summary in the Humbug subject.
(imported from commit 23298d8455e2b0e8c4947f2d2e76874b66a8e28c)
2012-10-31 14:06:35 -04:00
Tim Abbott 212a4e76d4 zephyr_mirror: Append our elements to the start of sys.path.
(imported from commit 674848bcac71d5bd28549f14a5da0f72c6c59d69)
2012-10-31 14:06:35 -04:00
Tim Abbott 013a2381b2 zephyr_mirror: More reliable killing of other zephyr_mirror processes.
(imported from commit ae00299114a74ebd582aec835ffd5f8127d8f55f)
2012-10-30 16:59:25 -04:00
Tim Abbott 73f6c614b8 Move trac bot to the trac stream.
(imported from commit 7c05062d73d6bd4de4b9329f1f2b7baa705c9d2b)
2012-10-30 16:59:25 -04:00
Keegan McAllister 270912e582 zephyr_mirror: Remove 'continue' at the end of a loop
(imported from commit 5d6143828f1a6946b67ae23342c0bc2185ebee07)
2012-10-29 23:21:00 -04:00
Keegan McAllister cae174847a zephyr_mirror: Use a set for current_zephyr_subs
(imported from commit 2736ea13dac7d3b5914eac27ed92ddacafd6ee8e)
2012-10-29 23:21:00 -04:00
Tim Abbott 9c5136c8cc zephyr_mirror: Clean up some code duplication.
(imported from commit ab21fc28d167d6f74e9d93aa8a7ccb252b5664c2)
2012-10-29 18:57:54 -04:00
Tim Abbott 6e31e7d405 zephyr_mirror: Set subject to personal if it is empty.
(imported from commit c843199287ab693f9f325ca0216cee59f8accdb3)
2012-10-29 18:25:03 -04:00
Tim Abbott ddf131143c Improvements to .zephyrs.subs parsing.
(imported from commit b1ddbf4416f4b04201a66409bdc48a469801b9de)
2012-10-29 18:25:02 -04:00
Tim Abbott 0b5b1dd14e zephyr_mirror: Fix unicode decoding issues.
(imported from commit b8c15fca2f691d23260ec025ad471815a7ab41b0)
2012-10-29 17:30:06 -04:00
Tim Abbott c5367bc21d Fix auto-restart functionality with new paths.
(imported from commit cbaf31a194c92a3683249f38f2949259d05d0921)
2012-10-29 17:30:06 -04:00
Tim Abbott b423d07a84 Add tabbott/extra to the tabbott-stamp users.
(imported from commit 378fa53fa8d2f237c8366969ff8a3efb0dee961a)
2012-10-29 14:34:28 -04:00
Tim Abbott 42097b377b zephyr_mirror: Clean up sys.path computations.
(imported from commit 7a58c4aae017b67b8b03ba1f4a0286d29381a5b1)
2012-10-29 14:34:28 -04:00
Tim Abbott 13f342a8fa Change the location where stamp files are looked for.
(imported from commit 15aec12195f5650df0b603ebe8ad9f38fc29d8e1)
2012-10-29 14:13:13 -04:00
Tim Abbott d03cdd2a1d zephyr_mirror: Suppress help for options users shouldn't use.
(imported from commit 62dc96147f2d4a706ff2570653ce3ad727d56967)
2012-10-29 14:13:13 -04:00
Tim Abbott 955f7ac9d8 Hardcode logging path for zephyrs.
(imported from commit c40fc9b67cae201cd2e94033257fb5f43602a5f2)
2012-10-29 14:13:13 -04:00
Tim Abbott 11cd128725 zephyr_mirror: Stop importing mit_subs_list.py.
(imported from commit 15e1eb1eabfa8db335f99b067dc4f4eecc00f639)
2012-10-29 13:58:05 -04:00
Tim Abbott ba08d06cb8 zephyr_mirror: Add option to just sync subscriptions.
(imported from commit 56951bb2bb62a8549593d2a33e883e66147d59a9)
2012-10-29 13:19:41 -04:00
Keegan McAllister c1171c9832 Change default site in API clients
(imported from commit 185cf8e27cb6ecd1cd8ccca834d30ca0de2236b8)
2012-10-27 11:38:15 -04:00
Tim Abbott 7c03f03557 trac-bot: Show summary in tickets.
(imported from commit fdf48c0e6cd0c7a94d7ddb1f982d2398381e310a)
2012-10-26 14:15:27 -04:00
Tim Abbott e3a63937fb feedbact-bot: send feedback messages sent by non-MIT users too.
(imported from commit 00eb1f99af751665d036d25ea31da3dbfdf327a4)
2012-10-26 10:42:54 -04:00
Tim Abbott 6dbd689f91 Kill duplicate zephyr mirror processes on startup.
(imported from commit 52db0c911e5d60a54eb43c5c075709c02e75da63)
2012-10-25 17:41:08 -04:00
Keegan McAllister eef027560a Remove unused imports
(imported from commit eb576627ff72e57fee0e3a4c357f51ad74cd6c86)
2012-10-25 15:22:18 -04:00
Tim Abbott 6e1ec1a2ec Move our various bots into api/bots/.
(imported from commit f5803441b9b84872b942dff8e1c0ad1100788bcd)
2012-10-25 13:53:34 -04:00
Tim Abbott b92ac0ffa1 Add feedback@humbughq.com forwarding bot.
(imported from commit 219909bd06025e3778f162321628781e2e3e2c94)
2012-10-25 13:53:33 -04:00