1. 09 Sep, 2016 3 commits
    • Chad Little's avatar
      Update PhrictionSearchEngine, implement Projects · 8b4398f9
      Chad Little authored
      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
      8b4398f9
    • epriestley's avatar
      Fix a Herald issue where testing commits against rules with revision-related conditions would fail · 8d048f06
      epriestley authored
      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
      8d048f06
    • epriestley's avatar
      Add inline styles for `{key ...}` in HTML mail · 17cd119b
      epriestley authored
      Summary: Fixes T11607.
      
      Test Plan:
        - Made a comment using `{key ...}`.
        - Used `bin/mail show-outbound --id X --dump-html > test.html` to review HTML:
      
      {F1805304}
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11607
      
      Differential Revision: https://secure.phabricator.com/D16523
      17cd119b
  2. 08 Sep, 2016 3 commits
    • Josh Cox's avatar
      Added `-` to the whitelist for CSS rules · f712ae71
      Josh Cox authored
      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
      f712ae71
    • Josh Cox's avatar
      Check if app is installed for user before displying · 0030bda1
      Josh Cox authored
      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
      0030bda1
    • epriestley's avatar
      Respect "End Date" for recurring Calendar events in detail UI · 25bd14a9
      epriestley authored
      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
      25bd14a9
  3. 07 Sep, 2016 12 commits
    • Chad Little's avatar
      Always show a menu on durable column · 5a33a674
      Chad Little authored
      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
      5a33a674
    • epriestley's avatar
      Recover from a race when importing external objects (like JIRA issues) for the first time · 138efb2b
      epriestley authored
      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
      138efb2b
    • Chad Little's avatar
      Add a few more high contrast CSS rules · e2430d0a
      Chad Little authored
      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
      e2430d0a
    • Chad Little's avatar
      Super Pro Dexule fix for project icon timeline · 2dd37605
      Chad Little authored
      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
      2dd37605
    • Chad Little's avatar
      Properly set project icon in timeline · 7368859d
      Chad Little authored
      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
      7368859d
    • Chad Little's avatar
      Fix properties box layout for profiles/projects on mobile · 9f430917
      Chad Little authored
      Summary: The spacing here is incorrect and no longer needed.
      
      Test Plan: Test phone layout of project, profile.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Differential Revision: https://secure.phabricator.com/D16511
      9f430917
    • epriestley's avatar
      Add a {key ..} Remarkup rule for discussing keystrokes · 5f43abd7
      epriestley authored
      Summary: Ruleset for styles in D16506.
      
      Test Plan: {F1803883}
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Differential Revision: https://secure.phabricator.com/D16510
      5f43abd7
    • epriestley's avatar
      Make storage adjustment a little nicer, especially the first time · b7e51877
      epriestley authored
      Summary:
      Fixes T11583.
      
        - When users run `bin/storage upgrade` for the first time on a new install, we currently give them a prompt which feels rough and which they can only reasonably ever answer "yes" to.
        - We generally use cautionary language ("found issues with schema") in this workflow. Adjustments are now routine, so use more neutral and progress-oriented language ("found adjustments to apply").
      
      Test Plan:
        - Ran `bin/storage upgrade --namesapce kappa123`, got an adjustment using neutral language without prompting.
        - Dropped a key, ran `bin/storage upgrade`, got normal workflow (but with more neutral language).
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11583
      
      Differential Revision: https://secure.phabricator.com/D16509
      b7e51877
    • epriestley's avatar
      Fix ContainsConstraints for array-valued custom field constraints in "*.search" methods · 76af4d64
      epriestley authored
      Summary: Fixes T11593. We ask for a list of values when searching for custom "link" fields, but don't handle it correctly when actually construcitng a query.
      
      Test Plan:
      Added this custom field:
      
      ```
      {
        "mycompany.target-version": {
          "name": "Target Version",
          "type": "link",
          "search": true
        }
      }
      ```
      
      Set a task to "beta". Let daemons index it. Queried for:
      
      ```
      constraints: {
        "custom.mycompany.target-version": [
          "beta"
        ]
      }
      ```
      
      Got just one result back.
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11593
      
      Differential Revision: https://secure.phabricator.com/D16508
      76af4d64
    • epriestley's avatar
      Throw when callers pass an invalid constraint to a "*.search" method · 38ae81fb
      epriestley authored
      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
      38ae81fb
    • Chad Little's avatar
      Basic kbd CSS for remarkup · 9ced2d7e
      Chad Little authored
      Summary: Keyboard key CSS for Remarkup.
      
      Test Plan:
      edit test in html, see new CSS
      
      {F1803550}
      
      Reviewers: stratosgear, epriestley
      
      Reviewed By: stratosgear, epriestley
      
      Subscribers: stratosgear, Korvin
      
      Differential Revision: https://secure.phabricator.com/D16506
      9ced2d7e
    • epriestley's avatar
      Add a friendlier "in flight" error page · f82adbf0
      epriestley authored
      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
      f82adbf0
  4. 06 Sep, 2016 8 commits
    • epriestley's avatar
      Continue on bad database configuration from select scripts · 0e8ceeb6
      epriestley authored
      Summary: Ref T11589. Provide a way for scripts to say "just continue if database config fails", and use it in `bin/config` and `bin/storage`.
      
      Test Plan:
        - Broke database config.
        - Ran `bin/config`, worked fine.
        - Ran `bin/storage`, got helpful "set up the database" message.
        - Ran `bin/repository`, got fatal.
        - Ran normal site with valid/invalid config, got proper feedback.
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11589
      
      Differential Revision: https://secure.phabricator.com/D16502
      0e8ceeb6
    • epriestley's avatar
      Raise setup warnings immediately when failing to load configuration from the database · 00bb0c90
      epriestley authored
      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
      00bb0c90
    • epriestley's avatar
      Split setup check phases into "preflight" and "post-config" · 30996014
      epriestley authored
      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
      30996014
    • epriestley's avatar
      Add a "--copy" flag to "bin/files migrate" · af5769a6
      epriestley authored
      Summary:
      Ref T11596. When exporting data from the Phacility cluster, we `bin/files migrate` data from S3 into a database dump on the `aux` tier.
      
      With current semantics, this //moves// the data and destroys it in S3.
      
      Add a `--copy` flag to //copy// the data instead. This leaves the old copy around, which is what we want for exports.
      
      Test Plan:
        - Ran `bin/files migrate` to go from `blob` to `disk` with `--copy`. Verified a copy was left in the database.
        - Copied it back, verified a copy was left on disk (total: 2 database copies, 1 disk copy).
        - Moved it back without copy, verified database was destroyed and disk was created (total: 1 database copy, 2 disk copies).
        - Moved it back without copy, verified local disk was destroyed and blob was created (total: 2 datbabase copies, 1 disk copy).
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11596
      
      Differential Revision: https://secure.phabricator.com/D16497
      af5769a6
    • epriestley's avatar
      Split setup checks into "preflight" and "normal" checks · b1932f1f
      epriestley authored
      Summary:
      Ref T11589. Currently, initialization order is a bit tangled: we load configuration from the database, then later test if we can connect to the database.
      
      Instead, I'm going to do: preflight checks ("PHP Version OK?", "Extensions installed?"), then configuration, then normal setup checks.
      
      To prepare for this, flag core checks as "preflight" and add a setup panel to visually confirm that I didn't miss anything.
      
      Test Plan: {F1803210}
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11589
      
      Differential Revision: https://secure.phabricator.com/D16499
      b1932f1f
    • epriestley's avatar
      Fix two "proably" typos · 7eee5c5f
      epriestley authored
      Summary: Caught one of these while reviewing docs, grepped for the other one.
      
      Test Plan: `grep`, reading
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Differential Revision: https://secure.phabricator.com/D16498
      7eee5c5f
    • Chad's avatar
      Add Slack authentication adapter · defee938
      Chad authored
      Summary: For phabricator. Adds a Slack auth adapater and icon.
      
      Test Plan:
      Create a new Slack Application for login, generate id and secret. Activate login and registration for Slack. Create a new account with Slack credentials. Log out. Log in with Slack credentials. Set my avatar with Slack. Slack. Slack.
      
      {F1802649}
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Differential Revision: https://secure.phabricator.com/D16496
      defee938
    • epriestley's avatar
      Allow `bin/storage renamespace` to work with underscores · 7e365fd3
      epriestley authored
      If the namespace is something like "test_example" we currently fail to
      renamespace the dump.
      
      (Cowboy committing this since this is currently blocking a data export.)
      
      Test Plan:
      
        - Renamespaced a local dump, examined the output, saw 60 create / 60 use, reimported it.
        - Will export in production.
      
      Auditors: chad
      7e365fd3
  5. 05 Sep, 2016 3 commits
    • epriestley's avatar
      Clean up some log spam caused by races in VersionedDraft · 74d5ae7b
      epriestley authored
      Summary:
      Two minor issues that I caught in the log while fixing Phame permissions:
      
        - We had a JS bug which would cause us to immediately generate two comment previews at the exact same time -- one for loading the page, and one for "switching to desktop". Instead, only generate the "switch to desktop" preview if we really switched to desktop from a different device layout.
        - These two requests could end up reading/writing the VersionedDraft table at exactly the same time fairly often (e.g., after a comment submission, the page would load, send two preview requests at exactly the same time, and they'd race fairly reliably for me locally). If we do race, recover from the race.
      
      Test Plan:
      Submitted some Phame comments.
      
        - No more error log errors about VersionedDraft keys.
        - Saw only one preview request when loading the page instead of two.
      
      Here's the specific stack trace I caught:
      
      ```
      [Mon Sep 05 12:15:33.639930 2016] [:error] [pid 50608] [client 127.0.0.1:55278] [2016-09-05 14:15:33] EXCEPTION: (AphrontDuplicateKeyQueryException) #1062: Duplicate entry 'PHID-POST-fknnpzjnsdgc3rqobhst-PHID-USER-pr5rjpuilpfserepsd2k-13' for key 'key_object' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:314]
      [Mon Sep 05 12:15:33.640801 2016] [:error] [pid 50608] [client 127.0.0.1:55278] arcanist(head=master, ref.master=9e82ef979e81), corgi(head=master, ref.master=5b9171222bc9), instances(head=stable, ref.master=485bc8128198, ref.stable=2983bc917601), ledger(head=master, ref.master=4da4a24b8779), libcore(), phabricator(head=phame2, ref.master=4b6da973, ref.phame2=4b6da973), phutil(head=stable, ref.master=97f05269fdb1, ref.stable=c14343ee620e), services(head=stable, ref.master=1fcb5cdb7582, ref.stable=2d8088a5b4b3)
      [Mon Sep 05 12:15:33.640815 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #0 <#2> AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:348]
      [Mon Sep 05 12:15:33.640830 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #1 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:289]
      [Mon Sep 05 12:15:33.640833 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #2 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:185]
      [Mon Sep 05 12:15:33.640836 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #3 <#2> AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:8]
      [Mon Sep 05 12:15:33.640839 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #4 <#2> queryfx(AphrontMySQLiDatabaseConnection, string, string, string, array, string)
      [Mon Sep 05 12:15:33.640841 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #5 <#2> call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:42]
      [Mon Sep 05 12:15:33.640844 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #6 <#2> AphrontDatabaseConnection::query(string, string, string, array, string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1261]
      [Mon Sep 05 12:15:33.640846 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #7 <#2> LiskDAO::insertRecordIntoDatabase(string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1106]
      [Mon Sep 05 12:15:33.640849 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #8 <#2> LiskDAO::insert() called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1075]
      [Mon Sep 05 12:15:33.640851 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #9 <#2> LiskDAO::save() called at [<phabricator>/src/applications/draft/storage/PhabricatorVersionedDraft.php:65]
      [Mon Sep 05 12:15:33.640854 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #10 <#2> PhabricatorVersionedDraft::loadOrCreateDraft(string, string, integer) called at [<phabricator>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1669]
      [Mon Sep 05 12:15:33.640857 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #11 <#2> PhabricatorEditEngine::buildCommentResponse(PhamePost) called at [<phabricator>/src/applications/transactions/editengine/PhabricatorEditEngine.php:894]
      [Mon Sep 05 12:15:33.640859 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #12 <#2> PhabricatorEditEngine::buildResponse() called at [<phabricator>/src/applications/phame/controller/post/PhamePostEditController.php:60]
      [Mon Sep 05 12:15:33.640862 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #13 <#2> PhamePostEditController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
      [Mon Sep 05 12:15:33.640865 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #14 phlog(AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php:27]
      [Mon Sep 05 12:15:33.640868 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #15 PhabricatorAjaxRequestExceptionHandler::handleRequestException(AphrontRequest, AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:644]
      [Mon Sep 05 12:15:33.640870 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #16 AphrontApplicationConfiguration::handleException(AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:242]
      [Mon Sep 05 12:15:33.640873 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #17 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
      [Mon Sep 05 12:15:33.640879 2016] [:error] [pid 50608] [client 127.0.0.1:55278]   #18 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]
      ```
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Differential Revision: https://secure.phabricator.com/D16494
      74d5ae7b
    • epriestley's avatar
      Remove overbearing policy checks in Phame · 4b6da973
      epriestley authored
      Summary:
      Fixes T11584. This controller does unnecessary CAN_EDIT policy checks.
      
      These checks are enforced by `EditEngine`, and you can make certain types of edits (including comments) even without full-blown edit permission.
      
      Test Plan:
        - Commented as a user without edit permission.
        - Tried to edit as a user without edit permission, was rebuffed with a policy dialog.
        - Edited as a user with edit permission.
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11584
      
      Differential Revision: https://secure.phabricator.com/D16493
      4b6da973
    • epriestley's avatar
      Ignore repository versions on inactive devices in "Repository Servers" panel in Config · 4dc37bce
      epriestley authored
      Summary:
      Fixes T11590. Currently, we incorrectly consider cluster repository versions that are (or were) on devices which are no longer part of the active cluster service when building this status screen.
      
      Instead, ignore them. This is just a display bug; the actual `ClusterEngine` already had similar logic.
      
      Test Plan:
        - Added a bad leader record to `repository_workingcopyversion`.
        - Before patch, got a bad "Partial (1w)" sync:
      
      {F1802292}
      
        - After patch, got a good "Sycnchronized":
      
      {F1802293}
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11590
      
      Differential Revision: https://secure.phabricator.com/D16492
      4dc37bce
  6. 03 Sep, 2016 2 commits
    • Chad Little's avatar
      Rebuild CSS packages · c38bc398
      Chad Little authored
      Summary: Review multimeter logs for new CSS/JS resources that should be in packages.
      
      Test Plan: Review some pages in sandbox, no CSS errors.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Differential Revision: https://secure.phabricator.com/D16490
      c38bc398
    • Chad Little's avatar
      Use new Guide layout in Config->Welcome · 36fa4e53
      Chad Little authored
      Summary: Ref T11132, swaps in new UI for welcome page using guide modules
      
      Test Plan: Test instance and non instance guides. Test each setting. Unclear on how to test people / Phacility. Just change the URL link?
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Maniphest Tasks: T11132
      
      Differential Revision: https://secure.phabricator.com/D16482
      36fa4e53
  7. 02 Sep, 2016 6 commits
    • Aviv Eyal's avatar
      Show broken units in revision history · 31c5f395
      Aviv Eyal authored
      Summary:
      This is hacky, and I'm not sure I'm happy with it; Until T9365 is done, this will show up
      broken tests with an appropriate star in the Revision History.
      
      Test Plan: Created 1M messages in a couple of old diffs in a revision. The query took ~80us (On SSD drive).
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley
      
      Differential Revision: https://secure.phabricator.com/D16483
      31c5f395
    • epriestley's avatar
      Distinguish between unreachable cluster database hosts and missing MySQL databases · d0013d08
      epriestley authored
      Summary:
      Fixes T11577. When we connect to a host and try to select a database which does not exist, we currently treat it as though the host wasn't reachable.
      
      This isn't correct, and prevents storage from being initialized while already in cluster mode, since the "config" database won't exist yet the first time we connect.
      
      Instead, distinguish between `AphrontSchemaQueryException` (thrown on connection if the requested database is not present) and other errors.
      
      Test Plan:
        - Put Phabricator into cluster database mode (`cluster.databases = ...`).
        - Swapped `storage.default-namespace` to force initialization of a new install.
        - Ran `bin/storage upgrade`.
          - Before patch: Immediate fatal about unreachablility.
          - After patch: Database initialized.
        - Also ran initialization steps in tranditional single-host mode (`cluster.databases` empty, `mysql.host` configured).
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T11577
      
      Differential Revision: https://secure.phabricator.com/D16489
      d0013d08
    • epriestley's avatar
      Fix a Repository doc spelling mistake · 081081b2
      epriestley authored
      Summary: Those letters don't go there!
      
      Test Plan: O__O
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Differential Revision: https://secure.phabricator.com/D16486
      081081b2
    • Mike Riley's avatar
      Provide a workflow to restart Harbormaster builds · 403073c9
      Mike Riley authored
      Summary:
      Ref T10867 for original use case.  This workflow provides a plausible way for administrators to stop the daemons when performing upgrades or maintenance, then bring those daemons back up without resulting in the failure of builds that were running at the time.
      
      On our organization's phab install, builds are running 24/7. The majority of these builds last for at least several minutes, and contain build steps which fail if interrupted and then resumed, as happens when turning daemons on and off.
      
      Instead of allowing these build steps to resume execution as normal, this workflow will instruct active builds to restart their entire build process instead of just resuming whichever step they were on.
      
      Test Plan:
      contrived a build plan which would fail if resumed partway through:
      
       - lease a working copy
       - command `touch restart_{build.id}`
       - command `test -e restart_{build.id} && rm restart_{build.id} && sleep 60`
      
      followed old procedure:
      
       - run a few of these builds manually
       - `./bin/phd stop`
       - `./bin/phd start`
       - saw the builds fail
      
      followed new procedure:
      
       - run a few of these builds manually
       - `./bin/phd stop`
       - `./bin/harbormaster restart --active`
       - `./bin/phd start`
       - saw the builds pass
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: Korvin, epriestley
      
      Maniphest Tasks: T10867
      
      Differential Revision: https://secure.phabricator.com/D16485
      403073c9
    • Luke081515's avatar
      Fix typo at calendar transaction · 0eb5a80e
      Luke081515 authored
      Summary:
      * Fixed conveted => converted
      Ref T11576
      
      Test Plan: * Looked at a page, where somebody converted an AllDay Event to a normal one
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley
      
      Tags: #calendar
      
      Maniphest Tasks: T11576
      
      Differential Revision: https://secure.phabricator.com/D16488
      0eb5a80e
    • epriestley's avatar
      Update Diviner for array-valued `@doc-stuff` return values from DocblockParser · 1eee7549
      epriestley authored
      Summary: Ref T11575. After D16431, the parser may return arrays.
      
      Test Plan: Ran `bin/diviner generate --clean` in `phabricator/` without errors. Previously, this raised some parsing errors related to getting arrays where strings were expected.
      
      Reviewers: chad, yelirekim, joshuaspence
      
      Reviewed By: joshuaspence
      
      Maniphest Tasks: T11575
      
      Differential Revision: https://secure.phabricator.com/D16487
      1eee7549
  8. 31 Aug, 2016 3 commits
    • epriestley's avatar
      Support object mentions in Calendar Event descriptions · 27cfd8d1
      epriestley authored
      Summary:
      Ref T7924. This:
      
        - Adds support for remarkup block changes to Modular Transactions.
        - Exposes remarkup changes from the Calendar event "Description" transaction.
      
      This makes stuff like mentions and file embeds work properly.
      
      Test Plan:
      Mentioned a task in an event description, saw a mention appear on the task.
      
      Uploaded a file to an event description, saw the file become "Attached" to the event.
      
      (Neither of these worked properly before.)
      
      Reviewers: chad
      
      Reviewed By: chad
      
      Maniphest Tasks: T7924
      
      Differential Revision: https://secure.phabricator.com/D16481
      27cfd8d1
    • Aviv Eyal's avatar
      Correctly calculate "any_failed" · 25a7266d
      Aviv Eyal authored
      Summary: See T10746.
      
      Test Plan: Fail one of several builds, run `./bin/harbormaster update`, see that Build Status is Failed.
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, O14 ATC Monitoring, yelirekim
      
      Maniphest Tasks: T10746
      
      Differential Revision: https://secure.phabricator.com/D16480
      25a7266d
    • Chad Little's avatar
      Add a basic first feed story on /home/ · 4dacf4d3
      Chad Little authored
      Summary: Ref T11132. Adds a text panel to feed if no stories are present and the user is an admin. Seems ok-ish for 15 minutes. Happy to take content suggestions.
      
      Test Plan: Make a new install, see panel. Log in as new user, don't see panel.
      
      Reviewers: epriestley
      
      Reviewed By: epriestley
      
      Subscribers: Korvin
      
      Maniphest Tasks: T11132
      
      Differential Revision: https://secure.phabricator.com/D16479
      4dacf4d3