1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 09:22:40 +01:00
Commit graph

10091 commits

Author SHA1 Message Date
epriestley
bc6e6c0500 Allow Calendar exports to be disabled
Summary:
Ref T10747. This adds disable/enable to exports.

Mostly useful if you leak a URI by accident.

Test Plan:
  - Disabled and enabled exports.
  - Verified that disabled exports don't actually export any data.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16681
2016-10-06 15:34:51 -07:00
epriestley
ff97ed2195 Document how to export Calendar events
Summary:
Ref T10747. This explains how exports work.

Also make mail exports use the same logic as other stuff.

Test Plan: Read documentation. Did some exports.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16680
2016-10-06 15:33:01 -07:00
epriestley
4819446fe5 Export recurring events and build ICS files for configured exports
Summary:
Ref T10747. This:

  - Exports recurring events properly, with RRULE + RECURRENCE-ID.
  - When exporting a part of an event series, export the whole series to ICS so it is represented faithfully.
  - Make the subscribable URL for "Export" objects work.

Test Plan:
  - Downloaded the ".ics" for a normal event, imported it into Calendar.app and Google Calendar.
  - Downloaded the ".ics" for a recurring event, imported it into Calendar.app and Google Calendar.
  - Defined an ".ics" Export of my events, subscribed to them in Calendar.app.
    - Edited an event in Phabricator.
    - Hit {key Command R} in Calendar.app, saw changes. (MAGIC!)
    - This export included recurring events, which appeared the same way in Calendar.app and Phabricator.
  - Can't import into Google Calendar from my local install easily since Google's servers can't hit my laptop, but I'll test once we deploy.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16679
2016-10-06 14:07:17 -07:00
epriestley
fa6a5a46ba Make more of the Calendar export workflow work
Summary:
Ref T10747.

  - Adds a "Use Results..." dropdown to query result pages, with actions you can take with search results (today: create export; in future: bulk edit, export as excel, make dashboard panel, etc).
  - Allows you to create an export against a query key.
    - I'm just using a text edit field for this for now.
  - Fleshes out export modes. I plan to support: public (as though you were logged out), privileged (as though you were logged in) and availability (event times, but not details).

This does not actually export stuff yet.

Test Plan: Created some exports. Viewed and listed exports.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16676
2016-10-06 04:14:29 -07:00
epriestley
49448a87c1 Rough in most of Calendar exports
Summary:
Ref T10747. Rough flow is:

  - Run a query.
  - Select a new "Export Events..." action.
  - This lets you define an "Export", which has a unique URL you can paste into Google Calendar or Calendar.app or whatever.

Most of this does nothing yet but here's the boilerplate.

Test Plan: Doesn't do anything yet.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16675
2016-10-06 04:06:35 -07:00
epriestley
c5efa3ecb5 Swap "Description" and "Invitees / Details" on Calendar event views
Summary:
Ref T11326. This reorders sections:

  - Description (if present)
  - Recurring event series info (if recurring)
  - Invitees (this also has custom stuff, if it exists)

Test Plan: Viewed some events, saw more sensible order.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16671
2016-10-06 04:06:02 -07:00
epriestley
3164ff68db Convert Calendar Events to use RRULE frequency constants in various other places
Summary:
Ref T10747.

  - Store recurrence as RRULEs internally.
  - Use RRULE constants.
  - Migrate existing rules to RRULEs.

Test Plan: Ran migration, nothing seemed broken?

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16670
2016-10-06 04:02:27 -07:00
epriestley
20f7de91ce Drive calendar event queries through the RRULE engine
Summary: Ref T10747. This drives event queries through RRULE, too.

Test Plan: Created recurring events, saw them appear correctly on the calendar.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16668
2016-10-06 03:57:50 -07:00
epriestley
5dfb672a80 Mostly drive Calendar event recurrence with the RRULE engine
Summary:
Ref T10737. Today, we evalute recurrence twice: once when querying, and once in all other cases. This converts the second case to use the RRULE engine.

Next up is making the query use the RRULE engine, too.

Test Plan: Created a new recurring event, iterated through it by clicking "next instance", viewed it on Calendar view.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10737

Differential Revision: https://secure.phabricator.com/D16667
2016-10-06 03:56:52 -07:00
epriestley
d3fc1800f8 Migrate Calendar away from stored-epoch fields
Summary:
Ref T10747. This deprecates "dateFrom", "dateTo", "allDayDateFrom", "allDayDateTo", and "recurrenceEndDate".

They are replaced with "utc*Epoch" fields (for querying) and CalendarDateTime objects (for start, end, until). These objects can represent the full range of dates and times expressible in ICS format, allowing us to import a wider range of ICS events.

Test Plan:
Ran migrations, viewed/edited Calendar, didn't catch anything catastrophcially broken.

This likely needs some followups, I'll keep it local for a bit until I'm confident I didn't break anything too catastrophically. I'm retaining the old data for now so we can likely fix things if it turns out there is some sort of issue.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16664
2016-10-06 03:55:59 -07:00
epriestley
fae0ec9220 Use more CalendarDateTime and fewer epoch timestamps in Calendar
Summary: Ref T10747. Moves away from getDateFrom() / getDateTo() and makes a few more date/time methods more consistent.

Test Plan: Created, edited, viewed events.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16663
2016-10-06 03:52:59 -07:00
epriestley
37f35e9ecc Remove "viewerDateFrom" / "viewerDateTo" in favor of CalendarDateTime methods
Summary: Ref T10747. The CalendarDateTime object now carries the viewer timezone as part of its state, so we don't need to have separate accessors.

Test Plan:
  - Viewed events, checked that crumbs render properly.
  - Edited events.
  - Created new events.
  - Viewed calendar.
  - Viewed event detail pages.
  - Viewed profile mini-calendar.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16662
2016-10-06 03:52:30 -07:00
epriestley
e042533375 Store "start", "end", and "until" event dates as CalendarDateTime objects
Summary:
Ref T10747. This does double-writes and starts generating/writing CalendarDateTimes.

This greater flexibility is necessary to support the full range of ICS-specifiable events, including "floating" events.

This doesn't do anything yet.

Test Plan: Created and edited events, verified sensible representations of corresponding datetimes appeared in the database.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16661
2016-10-06 03:51:57 -07:00
epriestley
0ce7eacaf1 Introduce Calendar "UTC Epoch" columns for query windowing
Summary:
Ref T10747. Currently, Calendar events are mostly epoch-based and cheat a little bit for all-day events.

This already felt a little flimsy, and can't reasonably accommodate the full range of `.ics` events, which include "floating" events (e.g., occurs at 3PM regardless of timezone, like "Tea Time").

As a secondary issue, we identify instances of a recurring event by instance number (1, 2, 3, etc.). This can't accommodate the full range of `.ics` events, which include arbitrary additional "RDATE" events (e.g., recurrs every week, and also on these specific extra days).

However, we do need to store some epoch information so we can do query windowing: when the user looks at "October 2016", we want to select the smallest number of events that we can from the database initially, before refining them down to generate instances. We can't reasonably query the actual dates no matter how we store them because this depends on computing things like UNTIL, COUNT, initial dates, whether events are recurring or not, timezones, etc.

Instead, when we save an event compute the earliest second it occurs on in UTC and the latest second it occurs on in UTC. We can then query for a small superset of possible events in "October 2016" for any viewer pretty easily.

Also, start laying the groundwork for using fewer epochs in the rest of the code, and for reducing the role of sequence indexes (I plan to keep some sequences indexes around, probably, since they're nice in the UI, but not all child events will have indexes since there's no index for an RDATE event).

This doesn't migrate existing events yet or actually read these new columns -- that will come later once the new code is a little more solid.

Test Plan:
  - Ran `bin/storage upgrade`.
  - Created a new event.
  - Saved an existing event.
  - Viewed database, saw sensible-looking "UTC Epoch" values.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16652
2016-10-06 03:46:03 -07:00
Chad Little
d68c444ffa Convert Conpherence to use normal picture setting flows
Summary: This moves room pictures out of the dialog and into it's own PictureController. Also adds a standard image (and removes the "last person to chat" picture (though we could add that back. My plan is though that direct messages use auto use the other person's photo, after we have editengine and room pictures will have a plain, replaceable image.

Test Plan: Set a new room picture, remove a picture. Run migration, see old images properly set with new image.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11730

Differential Revision: https://secure.phabricator.com/D16669
2016-10-05 12:05:36 -07:00
Chad Little
524906a439 Remove Crop Image from Conpherence Edit UI
Summary: Ref T11730. Removes the front end crop feature. Will follow up with proper removal, but this seems broken outright.

Test Plan:
Edit a room, don't seen "Crop" feature. Upload new photo, works fine.

- grep for `ConpherencePicCropControl`
- grep for `aphront-crop`

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11730

Differential Revision: https://secure.phabricator.com/D16665
2016-10-04 16:25:52 -07:00
Chad Little
02b5a2b39b Add Room Image to Conpherence header
Summary: This adds the room image to the main header in full Conpherence. It's nice, plus I plan to move the image edit workflow to it to simplify the move to EditEngine. I plan to build some default images for Conpherence which should be better about denoting the room, not just the last person writing.

Test Plan: Click on lots of rooms with and without topics.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16666
2016-10-04 16:24:38 -07:00
Chad Little
a3b2e422fe Use most recent transaction in Conpherence notification menu
Summary: Not sure this ever worked correctly, but now once we have a supported action, skip the rest of the transactions. Currently you'll see a random old post.

Test Plan: Test multiple rooms in various states with new messages, edits, new room titles, etc.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16660
2016-10-04 08:13:19 -07:00
Chad Little
60ce989247 Return more transaction types in Conpherence notification menu
Summary: Unclear these are worth sending, but mostly seems useful. Returns `getTitle` for the transaction if it's not a message. Fixes T10683

Test Plan: Leave rooms, change names, add pictures.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10683

Differential Revision: https://secure.phabricator.com/D16658
2016-10-03 14:31:27 -07:00
Chad Little
75fe750ee3 Allow Conpherence room images up to 200px
Summary: Provide higher resolution for Conpherence room images. Fixes T11728

Test Plan:
Upload a new photo, see it pulls in 200px image as background.

{F1858660}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11728

Differential Revision: https://secure.phabricator.com/D16659
2016-10-03 14:29:01 -07:00
Chad Little
3ce3ce957d Clean up css race condition in Conpherence notification menu
Summary: Depending on when packages loaded, this CSS sometimes gets overwritten. Make it more specific and always present.

Test Plan: Reload a lot

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16657
2016-10-03 12:32:57 -07:00
Chad Little
1d00bc9180 Clean up nux state with durable column
Summary: Remove policy icons from durable column, create a basic nux layout and style.

Test Plan: leave all rooms, pop open chat, see helpful text and button.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16655
2016-10-03 11:29:57 -07:00
Nevogd
c7a6cfd87c Fix 'Branches' typo in ActionsManagementPanel
Summary:
Fix typo 'Branches' in the panel header for the Diffusion Actions
management panel.

Test Plan: Saw 'Actions' in the panel heading

Reviewers: chad, epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16654
2016-10-03 10:14:30 -07:00
Chad Little
da1ed2c63a Don't mark a thread as seen if durable column is minimized
Summary: More work to do here on the JS side, but this at least makes sure users with a small chat window have some notification marked that new replies have not been seen.

Test Plan: Open two windows. Window 1 has durable minimized, Window 2 is full conpherence. Send a message from Window 2, see header count in Window 1 increase. Repeat with durable open, see no change in window.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16650
2016-10-02 20:31:47 -07:00
Chad Little
a591b86d91 Add an icon to aphlict connection status
Summary: A bit better styling, this adds an indication icon for if you're connected or not (and later, away, etc).

Test Plan: Test in Notifications menu, Conpherence full, Durable Column.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16647
2016-10-02 08:17:21 -07:00
Chad Little
87ebb80059 Revert "Clean up more Quicksand"
Summary: This reverts commit 5eb4bc6ca9.

Test Plan: Reload homepage, no scrollbars

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16645
2016-10-01 12:58:30 -07:00
Chad Little
2f2126ecce Add 'Persist Chat' option in Conpherence notification menu
Summary: This exposes the chat window to a larger audience beside people who accidentaly hit `\`.

Test Plan:
Lots of clicks and reloads.

{F1856043}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16643
2016-10-01 11:36:05 -07:00
Chad Little
5eb4bc6ca9 Clean up more Quicksand
Summary: Creates a background that renders inside the Quicksand frame, through sorcery.

Test Plan: Turn on Quicksand, visit lots of pages. See correct background colors. This probably blows something up I'm not testing.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16642
2016-10-01 11:22:42 -07:00
Chad Little
e498d4476d Fix some Quicksand bugs
Summary: Packages AppSearch, fixes body color, moves Differential filetree into differential package.

Test Plan: Enable quicksand. Navigate home -> differential -> diff.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16641
2016-09-30 14:59:53 -07:00
Chad Little
3d08046041 Remove calls to attachFilePHIDs in Conpherence Reply Handler
Summary: I missed removing this during the file purge of '16. Fixes T11717

Test Plan: Will test live

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11717

Differential Revision: https://secure.phabricator.com/D16639
2016-09-30 13:52:00 -07:00
Chad Little
6d82fcc6d7 Allow Durable Column to be minimized
Summary: Add ability to minimize durable column

Test Plan:
Shrink and Grow, reload page, see stickyness...

{F1855051}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16638
2016-09-30 20:24:18 +00:00
Chad Little
46f11a2450 Redesign durable column to be more a 'mini conpherence'
Summary:
Since I plan to add collapsing, this widens the chat window and moves the switcher to the side, for more visual space for conversation.

TODO: make a magical minimizer so I can always have it open.

Test Plan:
Tested on my large display and little Macbook.

{F1854092}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16635
2016-09-29 23:28:28 +00:00
epriestley
d5925ffc57 When a file is stored as chunks, show "Format: Chunks" instead of "Format: Raw"
Summary: Fixes T11712. This is somewhat misleading with encryption enabled.

Test Plan: Viewed chunked and unchunked files.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11712

Differential Revision: https://secure.phabricator.com/D16636
2016-09-29 15:47:09 -07:00
Chad Little
8af29f2df1 Group similar transaction comments in Conpherence
Summary: Adds a CSS class if comments come in from the same user in the past 2 minutes for cleaner UI. Note will have to find some better display UI when comment editing comes.

Test Plan: Test lots of random Conpherence messages with different transactions, different people, and quick commenting.

Reviewers: scp, epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16632
2016-09-29 12:23:01 -07:00
Chad Little
95d1749566 Convert Durable Column to popup chat in footer
Summary: This feels pretty reasonable with little effort, and I think I'd use it more than the full column.

Test Plan:
Chat a lot on various pages.... still some quicksand quirks around various pages.

{F1853487}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: scp, Korvin

Differential Revision: https://secure.phabricator.com/D16627
2016-09-29 10:08:14 -07:00
Chad Little
aa248a6b20 Use Notification Status in Conpherence
Summary: Adds a connection status message in Conpherence

Test Plan: Check status

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16625
2016-09-28 15:36:38 -07:00
epriestley
5d1359d78f Fix an issue where repository message counts would never reset
Summary:
Fixes T11705. I did not realize that `ON DUPLICATE KEY UPDATE` was order-dependent, so the "reset" clause of this `IF(...)` never actually worked.

Reorder it so we check if we're changing the message type //first//, then actually change the message type.

This makes the count reset properly when a failing repository succeeds, or a working repository fails.

Test Plan:
  - On `master`, forced a working repository to fail a `bin/repository update`, saw the message change types (expected) but keep the old count (wrong!).
  - With this patch, repeated the process and saw the count reset properly.
  - Ran the patch, verified counts reset to 0.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11705

Differential Revision: https://secure.phabricator.com/D16623
2016-09-28 15:02:26 -07:00
Andre Klapper
360597d8ee Link user name in People log view to user page
Summary:
Looking at IPs who recently registered more than one account in
Phabricator and trying to figure out whether they are spam bots
or just all on the same university network, I often want to check
recent user activity of these accounts. Hence linking the entries
in the User column to their user page comes in handy.

Test Plan: Tested on local instance and works as expected.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D16620
2016-09-28 08:47:49 -07:00
Josh Cox
32d660c08f Added a token_token table in anticipation of some data-driven tokens
Summary: Ref T11217. This just adds the table that we'll store tokens in. It doesn't make use of the table at all yet. This is mostly pulled from this diff (D16178). Specifically I mostly followed Evan's instructions related to the token table here: D16178#189120.

Test Plan: I ran `./bin/storage upgrade` successfully and there were no schema errors.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T11217

Differential Revision: https://secure.phabricator.com/D16621
2016-09-27 11:12:34 -04:00
Chad Little
700666ae0a Make Conpherence Pontificate Send-on-Enter
Summary: Fixes T11623. Enables send-on-enter and shift-enter for linebreaks, per durable column. Also cleaned up UI for Joining Room or Logging In.

Test Plan: See room I can join, click Join Room. Leave Room, Log out, visit room with login prompt. Login, Join Room again.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11623

Differential Revision: https://secure.phabricator.com/D16595
2016-09-27 19:54:07 -07:00
Josh Cox
0fc05ab47e Link to badge view from people profile view
Summary: Fixes T10715. Badges on the profile view now link to the badge view

Test Plan: Went to the profile view and clicked the link.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T10715

Differential Revision: https://secure.phabricator.com/D16604
2016-09-27 02:21:43 -04:00
Josh Cox
6649b0cef8 Remove "Application" field from ConduitSearchEngine
Summary: Fixes T9063. Removes the "Application" field from the search because it was largely redundant with the 'Name Contains' field.

Test Plan: Went to `/conduit/query/modern/`, clicked on `Edit Query` and noted that there is no "Application" field anymore. The 'Name Contains' field still works however.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T9063

Differential Revision: https://secure.phabricator.com/D16602
2016-09-27 01:50:49 -04:00
Josh Cox
fc82118848 Expose conduit API methods for Phurl URLs
Summary: Fixes T10681. Adds a search API endpoint and an edit API endpoint for Phurl URLs. I still need to add the ability to search by name, alias, URL, and maybe description.

Test Plan: Test the methods through `/conduit/method/phurls.search/` and `/conduit/method/phurls.edit/`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T10681

Differential Revision: https://secure.phabricator.com/D16600
2016-09-27 00:21:49 -04:00
Josh Cox
26b29a60c0 Remarkup rule to embed images
Summary:
Ref T4190. Added the remarkup rule to embed images:

Syntax is as follows:

`{image <IMAGE_URL>}`

Parameters are also supported, like:
`{image uri=<IMAGE_URI>, width=500px, height=200px, alt=picture of a moose, href=google.com}`

URLs without a protocol are not supported.

Test Plan: Tested with many of the syntax variations. If the provided URL doesn't point to an image, then a broken image icon will be shown.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T4190

Differential Revision: https://secure.phabricator.com/D16597
2016-09-26 16:55:38 -04:00
Josh Cox
7d576c3f94 Fix a bug in the imageproxy controller
Summary: Somehow this got through last week :( It's a bug that causes the controller to... *ahem*... just not work. Luckily nothing uses this yet so nothing was really affected.

Test Plan: Hit `/file/imageproxy/?uri=http://i.imgur.com/nTvVrYN.jpg` and are served a nice picture of a bird

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Differential Revision: https://secure.phabricator.com/D16598
2016-09-26 10:44:55 -04:00
epriestley
38b10f05a2 For now, disable persistent connections and the "max_connections" setup warning
Summary:
Ref T11672. At low loads, this causes us to use more connections, which is pushing some installs over the default limits.

Rather than trying to walk users through changing `max_connections`, `open_files_limit`, `fs.file-max`, `ulimit`, etc., just put things back for now. After T11044 we should have headroom to use persistent connections within the default limits on all reasonable systems..

Test Plan: Loaded Phabricator, poked around.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11672

Differential Revision: https://secure.phabricator.com/D16591
2016-09-23 12:42:26 -07:00
Josh Cox
eea540c5e4 Endpoint+controller for a remarkup image proxy
Summary:
Ref T4190. Currently only have the endpoint and controller working. I added caching so subsequent attempts to proxy the same image should result in the same redirect URL. Still need to:

- Write a remarkup rule that uses the endpoint

Test Plan: Hit /file/imageproxy/?uri=http://i.imgur.com/nTvVrYN.jpg and are served the picture

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T4190

Differential Revision: https://secure.phabricator.com/D16581
2016-09-23 10:28:24 -04:00
Chad Little
01afa791ab Don't lock subscription in PhameBlog
Summary: Ref T11687. Subscription to Blogs comes with many additional features, don't lock people in.

Test Plan: Saw I was no longer subscribed.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11687

Differential Revision: https://secure.phabricator.com/D16589
2016-09-23 09:03:41 -04:00
epriestley
a799d0a893 Give Phragment a sort of tetris block thing as a title glyph
Summary:
Fixes T11679. This application is probably vanishing into the aether eventually, but stop it from fataling for now.

Here's the glyph: ▛

It's like a fragment of a block of file data! Right? Obviously.

Test Plan: Visited `/phragment/` with glpyhs on, saw the glyph.

Reviewers: chad, avivey

Reviewed By: avivey

Subscribers: avivey, hach-que

Maniphest Tasks: T11679

Differential Revision: https://secure.phabricator.com/D16588
2016-09-22 15:13:06 -07:00
epriestley
88ff486aae Fix URI for Phurl NUX
Summary: Fixes T11685. We missed this one straggler the recent conversion of Phurl to EditEngine, in T10673.

Test Plan: Visited `/phurl/?nux=1`, clicked "Shorten a URL".

Reviewers: chad, jcox

Reviewed By: jcox

Maniphest Tasks: T11685

Differential Revision: https://secure.phabricator.com/D16587
2016-09-22 14:45:34 -07:00
epriestley
396be07c15 Add a setup issue about small "max_connections" settings
Summary:
Fixes T11683. Likely as a result of the persitent connections change, more users are seeing MySQL connection limit errors.

The persistent connections change means we use //fewer// connections at the high end, but I'm guessing PHP is keeping some more connections around in the pool, so while high-traffic hosts use fewer connections, low-traffic hosts now use more.

Raise an explicit setup warning about this. Users should be adjusting it anyway, there's no value to leaving it at extremely low default and connections are baiscally free until you run out of outbound ports.

Test Plan: {F1844630}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11683

Differential Revision: https://secure.phabricator.com/D16586
2016-09-22 13:09:16 -07:00
epriestley
db2425b300 Do initial repository imports at a lower priority and finish importing commits before starting new ones
Summary:
Fixes T11677. This makes two minor adjustments to the repository import daemons:

  - The first step ("Message") now queues at a slightly-lower-than-default (for already-imported repositories) or very-low (for newly importing repositories) priority level.
  - The other steps now queue at "default" priority level. This is actually what they already did, but without this change their behavior would be to inherit the priority level of their parents.

This has two effects:

  - When adding new repositories to an existing install, they shouldn't block other things from happening anymore.
  - The daemons will tend to start one commit and run through all of its steps before starting another commit. This makes progress through the queue more even and predictable.
    - Before, they did ALL the message tasks, then ALL the change tasks, etc. This works fine but is confusing/uneven/less-predictable because each type of task takes a different amount of time.

Test Plan:
  - Added a new repository.
  - Saw all of its "message" steps queue at priority 4000.
  - Saw followups queue at priority 2000.
  - Saw progress generally "finish what you started" -- go through the queue one commit at a time, instead of one type of task at a time.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11677

Differential Revision: https://secure.phabricator.com/D16585
2016-09-21 16:41:01 -07:00
Josh Cox
0817eb14a9 Update Phurl to use EditEngine
Summary: Fixes T10673. Set up Phurl to use Edit Engine. There's no way this is all I needed to do to get it working, so I'll be making another pass at it and testing more thoroughly...

Test Plan: Ran through the Phurl URL creation/edit/deletion process.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T10673

Differential Revision: https://secure.phabricator.com/D16573
2016-09-20 09:38:49 -04:00
epriestley
9329e6a12d Stop doing an excessive amount of work in diffusion.rawdiffquery
Ref T11665.

Without `-n 1`, this logs the ENTIRE history of the repository. We
actually get the right result, but this is egregiously slow. Add `-n 1`
to return only one result.

It appears that I wrote this wrong way back in 2011, in D953. This
query is rarely used (until recently) which is likely why it has
escaped notice for so long.

Test Plan: Used Conduit console to execute `diffusion.rawdiffquery`.
Got the same results but spent 8ms instead of 200ms executing this
command, in a very small repository.
2016-09-20 06:00:31 -07:00
Daniel Stone
03d323e9fd Fix config-migration text for dashboard options
Summary:
The commit which added checks for the old homepage options (now in
Dashboard) in rP9d9a47e9cf, added them to the auth section, where they
would present:
  This option has been migrated to the "Auth" application. Your old
  configuration is still in effect, but now stored in "Auth" instead of
  configuration. Going forward, you can manage authentication from the
  web UI.

Remove them from the moved-to-Auth list, and coalesce the multiple
definitions of the help text into one.

Test Plan:
 - set maniphest.priorities.unbreak-now to something
 - observe the setup issue reported
 - hope it tells you the right thing

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, chad

Differential Revision: https://secure.phabricator.com/D16576
2016-09-20 10:47:30 +00:00
epriestley
d3280c406d When repositories hit pull errors, stop updating them as frequently
Summary:
Ref T11665. Currently, when a repository hits an error, we retry it after 15s. This is correct if the error was temporary/transient/config-related (e.g., bad network or administrator setting up credentials) but not so great if the error is long-lasting (completely bad authentication, invalid URI, etc), as it can pile up to a meaningful amount of unnecessary load over time.

Instead, record how many times in a row we've hit an error and adjust backoff behavior: first error is 15s, then 30s, 45s, etc.

Additionally, when computing the backoff for an empty repository, use the repository creation time as though it was the most recent commit. This is a good proxy which gives us reasonable backoff behavior.

This required removing the `CODE_WORKING` messages, since they would have reset the error count. We could restore them (as a different type of message), but I think they aren't particularly useful since cloning usually doesn't take too long and there's more status information avilable now than there was when this stuff was written.

Test Plan:
  - Ran `bin/phd debug pull`.
  - Saw sensible, increasing backoffs selected for repositories with errors.
  - Saw sensible backoffs selected for empty repositories.

Reviewers: chad

Maniphest Tasks: T11665

Differential Revision: https://secure.phabricator.com/D16575
2016-09-19 17:29:56 -07:00
epriestley
e41a64607e Retain repository update cooldowns across daemon restarts
Summary:
Ref T11665. Fixes T7865. When we restart the daemons, the repository pull daemon currently resets the cooldowns on all of its pulls. This can generate a burst of initial load when restarting a lot of instance daemons (as in the Phacility cluster), described in T7865. This smooths things out so that recent pulls are considered, and any repositories which were waiting keep waiting.

Somewhat counterintuitively, hosted repositories write `TYPE_FETCH` status messages, so this should work equally well for hosted and observed repositories.

This also paves the way for better backoff behavior on repository errors, described in T11665. The error backoff now uses the same logic that the standard backoff does. The next change will make backoff computation consider recent errors.

(This is technically too large for repositories which have encountered one error and have a low commit rate, but I'll fix that in the following change; this is just a checkpoint on the way there.)

Test Plan: Ran `bin/phd debug pull`, saw the daemon compute reasonable windows based on previous pull activity.

Reviewers: chad

Maniphest Tasks: T7865, T11665

Differential Revision: https://secure.phabricator.com/D16574
2016-09-19 16:49:34 -07:00
Josh Cox
adf9d5ffdd Removed willProcessRequest from DifferentialRevisionLandController
Summary: Ref T8628.

Test Plan: Landed a revision through the web UI

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D16572
2016-09-19 13:47:37 -04:00
Josh Cox
799ecdc278 Update RedirectController for handleRequest
Summary: Ref T8628.

Test Plan: Performed an action that uses the redirect controller (trying to visit a repo page while not logged in). Logged in and was redirected as expected

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D16571
2016-09-19 13:24:01 -04:00
Josh Cox
2e4b5b45a2 Update DarkConsole for handleRequest
Summary: Ref T8628

Test Plan: Updated DarkConsoleDataController and observed that the darkconsole still works as expected

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D16570
2016-09-19 13:18:27 -04:00
Josh Cox
dda06c6bdc Added a 'name' field to the results for harbormaster.build.search endpoint
Summary: Fixes T11642. Added a 'name' field to the results from harbormaster.build.search.

Test Plan: Went to `/conduit/method/harbormaster.build.search/` and ran a search that would yield results (because otherwise there will be nothing there). Noted that there was, in fact, a name in the results.

Reviewers: yelirekim, #blessed_reviewers, epriestley

Reviewed By: yelirekim, #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T11642

Differential Revision: https://secure.phabricator.com/D16569
2016-09-19 13:15:52 -04:00
Chad Little
a2a19e29aa Remove TYPE_FILES from Conpherence
Summary: I believe these are left over from widgets, when we added a "Files" widget that kept track of everything added to the window.

Test Plan: Added files to a Conpherece, Set an image when editing. Anything else?

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16567
2016-09-17 21:23:54 +00:00
Chad Little
28201bf2b5 New NUX states for Conpherence
Summary: Roughly, if user isn't in any rooms, search for joinable ones. If no results, show big NUX banner.

Test Plan: Left all rooms, got fallback, joined room, left room. Create new instance, see new NUX. Set instance to public, visit Conpherence with and without public rooms.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16563
2016-09-16 15:09:04 -07:00
Chad Little
1ea6fe9387 Add basic feed stories for Conpherence
Summary: [Draft] Posting this up because feed is pulling `getTitle` and not `getTitleForFeed` and I'm super confused. Restarted phd and apache.

Test Plan: Create a new room, see link in feed. Change topic, see story, add people, don't see story.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11645

Differential Revision: https://secure.phabricator.com/D16561
2016-09-16 14:30:08 -07:00
epriestley
7f6fa28363 When loading packages affected by a change to a particular path, ignore archived packages
Summary:
Ref T11650. Currently, we load packages and then discard the archived ones.

However, this gets "dominion" rules (where a more-general package gives up ownership if a more-specific package exists) wrong if the more-specific package is archived: we incorrectly give up ownership.

Instead, just ignore these packages completely when loading affected packages. This is slightly simpler.

(There are technically two pieces of code we have to do this for, which should be a single piece of code but which haven't yet been unified.)

Test Plan:
  - Created packages:
    - Package A, on "/" (strong dominion, autoreview).
    - Package B, on "/x/" (weak dominion, autoreview).
    - Package C, on "/x/y" (archived, autoreview).
  - Create a revision affecting "/x/y".
  - Saw correct path ownership in table of contents ("B", strongest package only).
  - Saw correct autoreview behavior (A + B).
  - (Prior to patch, in `master`, reproduced the problem behaviors described in T11650, with bad dominion rules and failure to autoreview B.)

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11650

Differential Revision: https://secure.phabricator.com/D16564
2016-09-16 14:02:53 -07:00
Chad Little
5cffe9e5e5 Remove "needWidgetData" from Conpherence
Summary: We no longer have widgets, don't need these calls for simplicity.

Test Plan: Add a user to a room, remove a user from a room. Grep for `needWidgetData`

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16562
2016-09-16 13:56:28 -07:00
Chad Little
f6023d17da Rebuild Conpherence Participants Pane
Summary: Mostly quality of life in renames and moving everything to the view class. Minor CSS tweaks. Fix room handles getting added when adding a new user.

Test Plan: Add to room, remove from room.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16560
2016-09-15 13:21:31 -07:00
epriestley
3d6c3c2c45 Make .ics export less scary and attach .ics files to event mail
Summary:
Ref T10747.

  - Remove the warning dialog since these files don't seem to do anything confusing/problematic in Calendar.app or Google Calendar. Those importers generally need to be defensive about how they handle random ".ics" files from arbitrary third parties anyway, and this makes testing imports easier since we have a GET-table ".ics" URI for public events.
  - Attach ".ics" files to email.

Test Plan:
  - Clicked "Export as .ics", got an ICS file.
  - Used "bin/mail show-outbound" to review an ICS attachment, although I don't actually have real mail set up locally so this may still be a little funky.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16559
2016-09-15 10:33:17 -07:00
epriestley
96f800249b Export ORGANIZER and ATTENDEE sections in ".ics" files from Calendar
Summary: Ref T10747. This exports these sections when generating an ".ics" file.

Test Plan: {F1832214}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16558
2016-09-15 08:48:23 -07:00
Chad Little
2e1c7da1bf Clean up some Conpherence header CSS
Summary: Darkens the topic, adds fun colors to action icons.

Test Plan: Hover over new action icons. See darker topic text.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16556
2016-09-14 21:13:25 -07:00
epriestley
47debbd57c Add an "Export as .ics" action to Calendar events
Summary: Ref T10747. Allows you to grab an event as a (basic) ICS file.

Test Plan:
  - Exported a normal event.
  - Exported an all-day event.

{F1830577}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10747

Differential Revision: https://secure.phabricator.com/D16553
2016-09-14 19:07:52 -07:00
Chad Little
c1c5fbce21 Rebuild Conpherence
Summary:
Minor rebuild / redesign of Conpherence. Most of this is new UX and tossing out things like widgets, device fallbacks. I expect some of the UI to get more polished after next pass, but most everything here is in place.

 - Removed "Widgets", now just a single Participants pane
 - Added "Topic"
 - New header
 - Settings, Edit are action icons
 - Removed a lot of JS
 - Simplified CSS as much as I could

Test Plan:
Desktop, Tablet, Mobile. Adding and removing people. Setting new topics, new rooms.

{F1828662}

{F1828669}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16550
2016-09-14 18:51:32 -07:00
Chad Little
98a62c9e49 Fix firefox float bug in Conphernce menu
Summary: These floats were wonky in FF, adding some hardening to make sure they clear.

Test Plan:
Firefox, Chrome, IE.

{F1815981}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16547
2016-09-13 11:43:37 -07:00
Chad Little
5d8b5c0ee3 Don't show Conpherence controls if not in a Conpherence
Summary: We currently try to build crumbs out even if the user has no membership in any. This removes these useless controls.

Test Plan: Leave all Rooms, see NUX state with no "Edit Room", blank title, or "Collapse Column" controls.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16546
2016-09-13 10:48:21 -07:00
Josh Cox
2588b4fac0 Added initial class for displaying invisible chars
Summary:
Fixes T11586. First pass at a class for displaying invisible characters. Still need to:
- Write a couple unit tests
- Add some styling to the .invisible-special spans
- Actually start using the class when displaying form errors to users

Currently this makes the string `"\nab\x00c\x01d\te\nf"` look like:

{F1812711}

Test Plan:
Unit tests all pass and run in <1ms:

{F1812998}

Reviewers: epriestley, #blessed_reviewers, chad

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T11586

Differential Revision: https://secure.phabricator.com/D16541
2016-09-12 21:57:01 -04:00
Chad Little
ff64c4e02b Add a toggle, sticky pref, for Conpherence Widget Pane
Summary: This adds a "column" icon into crumbs, like in workboards, for expanding or hiding the "Widget Pane". This is per user sticky and defaults to off.

Test Plan: View a Conpherence Room, see no widgets by default. Toggle it on, see widget. Reload page, see widget stick. Verify mobile, tablets ignore hiding.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10364

Differential Revision: https://secure.phabricator.com/D16533
2016-09-12 23:20:21 +00:00
Chad Little
d25a9530a7 Move search, new room into thread column in Conpherence
Summary:
Moves search and new room out of crumb bar and into the thread column. This opens up space to add "Edit Room" into the crumbs area as an action link. Also removed 'widget-edit' pathways and javascript.

Fixes T8972

Test Plan:
Search, New, Edit rooms. Click different rooms, see correct URL each time.

{F1813226}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8972

Differential Revision: https://secure.phabricator.com/D16543
2016-09-12 22:19:24 +00:00
epriestley
105be01d5f Just fatal for any setting of open_basedir
Summary:
Fixes T11627.

Beyond being complex, I have no real reason to believe these checks even work (and they don't test repositories, file storage, logfiles, etc).

Test Plan:
Faked the error:

{F1813433}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11627

Differential Revision: https://secure.phabricator.com/D16544
2016-09-12 14:49:48 -07:00
epriestley
1ee426e4ac Add a specialized cache for storing "has setup ever worked?"
Summary:
Ref T11613. In D16503/T11598 I refined the setup flow to improve messaging for early-stage setup issues, but failed to fully untangle things.

We sometimes still try to access a cache which uses configuration before we build configuration, which causes an error.

Instead, store "are we in flight / has setup ever worked?" in a separate cache which doesn't use the cache namespace. This stops us from trying to read config before building config.

Test Plan:
Hit bad extension error with a fake extension, got a proper setup help page:

{F1812803}

Solved the error, reloaded, broke things again, got a "friendly" page:

{F1812805}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11613

Differential Revision: https://secure.phabricator.com/D16542
2016-09-12 08:04:32 -07:00
Luke081515
9e4bca8345 Fixed inconsistency at phriction
Summary:
* All Applications are useing the description "Tags", Phriction actually uses "Projects"
* Changed "Projects" to "Tags" for phriction
Ref T11614

Test Plan:
* Edited a document, took a look at the description for that input line
* Added a project to a page and saved it

Reviewers: chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: avivey, chad, epriestley

Tags: #phriction

Maniphest Tasks: T11614

Differential Revision: https://secure.phabricator.com/D16537
2016-09-11 13:41:41 -07:00
Mukunda Modell
c0bf08058b Check for empty output from git ls-tree
Summary: Fixes T10155

Test Plan: View an empty repository in diffusion, check for the exception.
See T10155 for steps to reproduce

Reviewers: epriestley

Subscribers:
2016-09-10 06:02:48 -05:00
Chad Little
be54620b17 Refresh Conpherence UI
Summary: Cleans up a number of inconsistencies, makes Conpherence lighter, easier to read, make names larger, darker.

Test Plan: Review Conpherence chat in Main App, Durable Column, Mobile, Tablet

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16531
2016-09-09 11:27:56 -07:00
Chad Little
fe9f16ad0d Default Conpherence Room Search to All Rooms
Summary: Just changes the default here. Main reasoning is if I'm searching for a room, show me all of them first. "My Rooms" is where I just came from.

Test Plan: Click Search in Conpherence, see All Rooms as default.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16527
2016-09-09 07:17:11 -07:00
Chad Little
05628de90d Clean up random junk in Conpherence
Summary: Fixes T10781. Re-uses sidenav styles from global space, though a little hacky. Fix crumb border, fix nux experience. Fiddle spacing.

Test Plan:
Use Conpherence as new user, make a room, post some messages.

{F1805658}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10781

Differential Revision: https://secure.phabricator.com/D16528
2016-09-09 07:16:39 -07:00
Chad Little
b056b7f174 Add edit notes to Phriction emails
Summary: Fixes T9294. Adds edit notes.

Test Plan: Edit a document, see notes in email.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9294

Differential Revision: https://secure.phabricator.com/D16526
2016-09-08 19:17:49 -07:00
Chad Little
d7bc582530 Printable pages for PHUIDocumentViewPro
Summary: Fixes T10131. Adds new CSS to better present document pages for printing. Added a print link to Phriction.

Test Plan: Tested Phriction, Phame, and Legalpad.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10131

Differential Revision: https://secure.phabricator.com/D16524
2016-09-08 19:14:32 -07:00
Chad Little
8b4398f916 Update PhrictionSearchEngine, implement Projects
Summary: Implements new search engine, projects into Phriction.

Test Plan: Test new search choices, add project to Phriction page. Verify hierarchy still works, setting policy works, etc.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Luke081515.2, Korvin

Maniphest Tasks: T9622

Differential Revision: https://secure.phabricator.com/D14652
2016-09-08 17:23:37 -07:00
epriestley
8d048f06ab Fix a Herald issue where testing commits against rules with revision-related conditions would fail
Summary:
Fixes T11610. Clean up some sketchy old code from long ago.

If you had rules that use conditions like "Accepted revision exists" and ran them in the test console, we'd never load the "CommitData" and fatal.

Instead, load CommitData in `newTestAdapter()` and generally make these pathways a little more modern.

Test Plan:
  - Wrote an "Accepted Revision Exists" rule.
  - Ran a commit in the test console.
  - Before patch, got fatal from T11610.
  - After patch, got clean test result.
  - Also pushed a commit and reviewed the transcript to make sure the rule ran properly.

Reviewers: joshuaspence, chad

Reviewed By: chad

Maniphest Tasks: T11610

Differential Revision: https://secure.phabricator.com/D16522
2016-09-08 17:16:40 -07:00
Josh Cox
f712ae718c Added - to the whitelist for CSS rules
Summary: Fixes T11567. This way people can use things like `sans-serif` and `-webkit-small-control` for their "monospaced" font

Test Plan:
I added the hyphen to the regex then was able to set my Monospaced Font to be anything with a hyphen in it.

I also tried to break it pretty extensively, but couldn't find anything that would let me write malicious CSS or JS.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T11567

Differential Revision: https://secure.phabricator.com/D16519
2016-09-07 23:44:11 -04:00
Josh Cox
0030bda17e Check if app is installed for user before displying
Summary: Fixes T11595. Previously if a user didn't have permissions to view an application it would still appear in the application typeahead in various menus. This change will prevent that by checking if the app is installed for the viewer before displaying it as an option

Test Plan: I went to the "Pin Applications" menu and typed in "Conpherence" and saw it appear as an option. I then went to the "Edit Policies" menu as an admin and removed permissions for my user to use Conpherence. Once I did that, it no longer showed up in the typeahead menu

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley, yelirekim

Maniphest Tasks: T11595

Differential Revision: https://secure.phabricator.com/D16518
2016-09-07 22:42:20 -04:00
epriestley
25bd14a9b1 Respect "End Date" for recurring Calendar events in detail UI
Summary:
Fixes T11396. Currently, you can keep clicking "Next >" forever to generate infinite instances of an event, even if it has a set end date.

Likewise, you can visit `/E123/999999` or whatever to stub out the 999999th instance of an event.

Instead:

  - Before creating a new stub, make sure it happens before any end date.
  - 404 stubs if we can't create them.
  - Disable the "Next >" button if it isn't valid.

Test Plan:
  - Visited `/E123/9999` for an event with a recurrence end date, got 404.
  - Clicked "Next >" on an event with an end date, got new events until I hit the end date.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11396

Differential Revision: https://secure.phabricator.com/D16517
2016-09-08 10:20:04 -07:00
Chad Little
5a33a6743e Always show a menu on durable column
Summary: If you don't have any rooms, we currently show no menu and users have no logical means of closing the column. This lets "Hide Column" at least still appear. Fixes T9195

Test Plan: Fresh install, hit {key \}, see menu. Close Column.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9195

Differential Revision: https://secure.phabricator.com/D16516
2016-09-07 14:28:47 -07:00
epriestley
138efb2b10 Recover from a race when importing external objects (like JIRA issues) for the first time
Summary:
Fixes T11604. If we send two requests to render a brand new tag at about the same time (say, 50ms apart) but JIRA takes more than 50ms to return from its API call, the two processes will race one another and try to save the same external object.

If they do, have whichever one lost the race just load the object the other one created.

Apply this to other bridges, too.

Test Plan:
  - Created a new task in JIRA.
  - Referenced it for the first time in Differential, in a comment.
  - This causes two tag renders to fire. This //might// be a bug but I spend 30 seconds on it without figuring out what was up. Regardless, we should fix the race even if the reason it's triggering so easily legitimately is a bug.
  - Before patch: big error dialog (as in T11604).
  - After patch: smooth sailing.

{F1804008}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11604

Differential Revision: https://secure.phabricator.com/D16514
2016-09-07 11:16:42 -07:00
Chad Little
e2430d0aa5 Add a few more high contrast CSS rules
Summary: In new PHUITwoColumnLayout, some new colors were used that aren't in the High Contrast PostProcessor. Adding them and proper fallbacks.

Test Plan: High Contrast on/off on a timeline page.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16515
2016-09-07 11:03:05 -07:00
Chad Little
2dd376055a Super Pro Dexule fix for project icon timeline
Summary: It's super

Test Plan: Set lots of project icons

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16513
2016-09-07 10:48:06 -07:00
Chad Little
7368859d8d Properly set project icon in timeline
Summary: This fixes a bug where the icon won't display since it doesn't include `fa-`.

Test Plan: Change icon on a project, revisit timeline and see icon.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16512
2016-09-07 10:37:15 -07:00
epriestley
38ae81fb39 Throw when callers pass an invalid constraint to a "*.search" method
Summary:
Ref T11593. When you call a `*.search` method like `maniphest.search`, we don't currently validate that all the constraints you pass are recognized.

I think there were two very weak arguments for not doing this:

  - It makes compatibility in `arc` across versions slightly easier: if we add a new constraint, we could add it to `arc` but also do client-side filtering for a while.
  - Conduit parameter types //could//, in theory, accept multiple inputs or optional/alias inputs.

These reasons are pretty fluff and T11593 is a concrete issue caused by not validating. Just validate instead.

Test Plan:
  - Made a `maniphest.search` call with a bogus constraint, got an explicit error about the bad constraint.
  - Made a `maniphest.search` call with a valid constraint (`"ids"`).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11593

Differential Revision: https://secure.phabricator.com/D16507
2016-09-07 09:07:53 -07:00
epriestley
f82adbf0c8 Add a friendlier "in flight" error page
Summary:
Ref T11589. When we hit a fatal setup issue (essentially always a connection failure) //after// we've already survived them on at least one request, we can be pretty sure a server went down and that the problem is not a setup/configuration issue.

In this case, show a friendlier error page instead of the fairly detailed technical one.

Test Plan:
  - Broke MySQL config.
  - Restarted Apache.
  - Got the "admin/setup" error page:

{F1803268}

  - Fixed the MySQL config.
  - Loaded any page, to put us "in flight".
  - Broke MySQL config.
  - Loaded any page.
  - Got the friendly "in flight" error page:

{F1803271}

If you want to design this better, easiest way to get to it is:

  - Set `mysql.port` to `9999` in `conf/local/local.json`.
  - Reload any page while already running (don't restart).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16503
2016-09-07 06:59:48 -07:00
epriestley
00bb0c9071 Raise setup warnings immediately when failing to load configuration from the database
Summary:
Ref T11589. Previously, when we failed to load database configuration we just continued anyway, in order to get to setup checks so we could raise a better error.

There was a small chance that this could lead to pages running in a broken state, where ONLY that connection failed and everything else worked. This was accidentally fixed by narrowing the exceptions we continue on in D16489.

However, this "fix" meant that users no longer got helpful setup instructions. Instead:

  - Keep throwing these exceptions: it's bad to continue if we've failed to connect to the database.
  - However, catch them and turn them into setup errors.
  - Share all the setup code so these errors and setup check errors work the same way.

Test Plan:
  - Intentionally broke `mysql.host` and `mysql.pass`.
  - Loaded pages.
  - Got good setup errors.
  - Hit normal setup errors too.
  - Put everything back.
  - Swapped into cluster mode.
  - Intentionally broke cluster mode, saw failover to readonly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16501
2016-09-06 14:20:31 -07:00
epriestley
3099601463 Split setup check phases into "preflight" and "post-config"
Summary:
Ref T11589. This runs:

  - preflight checks (critical checks: PHP version stuff, extensions);
  - configuration;
  - normal checks.

The PHP checks are split into critical ("bad version") and noncritical ("sub-optimal config").

I tidied up the extension checks slightly, we realistically depend on `cURL` nowadays.

Test Plan:
  - Faked a preflight failure.
  - Hit preflight check.
  - Got expected error screen.
  - Loaded normal pages.
  - Hit a normal setup check.
  - Used DarkConsole "Startup" tab to verify that preflight checks take <1ms to run (we run them on every page without caching, at least for now, but they only do trivial checks like PHP versions).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16500
2016-09-06 14:20:11 -07:00