1. 23 Jul, 2014 10 commits
    • Joshua Spence's avatar
      Rename `PHIDType` classes · 97a8700e
      Joshua Spence authored
      Summary: Ref T5655. Rename `PhabricatorPHIDType` subclasses for clarity (see discussion in D9839). I'm not too keen on some of the resulting class names, so feel free to suggest alternatives.
      
      Test Plan: Ran unit tests.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin, hach-que
      
      Maniphest Tasks: T5655
      
      Differential Revision: https://secure.phabricator.com/D9986
      97a8700e
    • epriestley's avatar
      Make Phortune checkout UI a little less bad · 9a892dd9
      epriestley authored
      Summary: Ref T2787. There were some mega-uggo buttons and such; reduce the uggo-ness by a hair.
      
      Test Plan: {F179686}
      
      Reviewers: btrahan, chad
      
      Reviewed By: chad
      
      Subscribers: epriestley
      
      Maniphest Tasks: T2787
      
      Differential Revision: https://secure.phabricator.com/D10006
      9a892dd9
    • epriestley's avatar
      Phortune Cart Status, some one-time support · d6eb1c67
      epriestley authored
      Summary:
      Ref T2787. Carts need a status so we can tell if they've been purchased. Also kind of get WePay working as a one-time provider, and let charges not have a methodPHID (they won't for one-time providers).
      
      All the status stuff is still super crazy rough and you can do things like start a checkout, add a bunch of stuff to your cart, complete the checkout, and have Phabricator think you paid for all the stuff you added. But this is fine for now since you can't actually edit carts, and also none of this is at all usable anyway. I'll refine some of the workflows in future diffs, for now I'm just getting things hooked up and technically working.
      
      Test Plan:
        - Purcahsed a cart and got a sort of status/done screen instead of a "your money is gone" exception.
        - Went through the WePay flow and got a successful test checkout.
      
      Reviewers: btrahan, chad
      
      Reviewed By: chad
      
      Subscribers: epriestley
      
      Maniphest Tasks: T2787
      
      Differential Revision: https://secure.phabricator.com/D10003
      d6eb1c67
    • epriestley's avatar
      Phortune Charges · 4c0f15b9
      epriestley authored
      Summary: Ref T2787. Makes charges a real object, allows providers to apply them. We are now (just barely) capable of stealing users' money.
      
      Test Plan: {F179584}
      
      Reviewers: btrahan, chad
      
      Reviewed By: chad
      
      Subscribers: epriestley
      
      Maniphest Tasks: T2787
      
      Differential Revision: https://secure.phabricator.com/D10002
      4c0f15b9
    • epriestley's avatar
      Phortune Carts and Purchases · 6ec1f358
      epriestley authored
      Summary:
      Ref T2787. Make carts and purchases real objects, with storage, that kind-of work.
      
      Roughly, the idea here is that applications create "purchases" (like "1 large t-shirt") and add them to "carts" (a user can have a lot of different carts at the same time), then hand things off to Phortune to deal with actualy charging a card. Roughly this works like Paypal or other similar systems do, except Phortune is the thing the user gets handed off to.
      
      This doesn't do anything interesting/useful yet.
      
      Also fix some bugs and update some UI.
      
      Test Plan: Added a product to a cart, saw it in cart screen.
      
      Reviewers: btrahan, chad
      
      Reviewed By: chad
      
      Subscribers: epriestley
      
      Maniphest Tasks: T2787
      
      Differential Revision: https://secure.phabricator.com/D10001
      6ec1f358
    • epriestley's avatar
      Fix incorrect old name for Asana auth provider in provider migration · e561a5fe
      epriestley authored
      Summary: The old class name isn't quite correct.
      
      I'm just updating the migration rather than adding a new one to fix it since
      this was very recently introduced and affects only installs using Asana auth,
      so it's realistic that the number of affected installs might be 0.
      
      Affected installs can use `--apply` to safely rerun the migration.
      
      Auditors: joshuaspence
      e561a5fe
    • epriestley's avatar
      Add some missing application names · b0623305
      epriestley authored
      Summary: Add some missing methods from D10027.
      
      Test Plan: Viewed `/applications/query/all/` without hitting exceptions.
      
      Reviewers: joshuaspence
      
      Subscribers: epriestley, hach-que
      
      Differential Revision: https://secure.phabricator.com/D10029
      b0623305
    • Joshua Spence's avatar
      Implement the `getName` method in `PhabricatorApplication` subclasses · 0c8f487b
      Joshua Spence authored
      Summary: Provide an implementation for the `getName` method rather than automagically determining the application name.
      
      Test Plan: Saw reasonable application names in the launcher.
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D10027
      0c8f487b
    • Joshua Spence's avatar
      Add a missing migration for transaction actors · e0a7d47e
      Joshua Spence authored
      Summary: Add a missing migration which should have been included in D9982. Harbormaster and Herald PHIDs are used as actors in some transactions.
      
      Test Plan: Ran `./bin/storage upgrade`. Saw a transaction render correctly as "Herald assigned this task to alincoln" instead of "Unknown Object (Application) assigned this task to alincoln".
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D10028
      e0a7d47e
    • Joshua Spence's avatar
      Rename `PhabricatorApplication` subclasses · 86c399b6
      Joshua Spence authored
      Summary: Ref T5655. Some discussion in D9839. Generally speaking, `Phabricator{$name}Application` is clearer than `PhabricatorApplication{$name}`.
      
      Test Plan:
      # Pinned and uninstalled some applications.
      # Applied patch and performed migrations.
      # Verified that the pinned applications were still pinned and that the uninstalled applications were still uninstalled.
      # Performed a sanity check on the database contents.
      
      Reviewers: btrahan, epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: hach-que, epriestley, Korvin
      
      Maniphest Tasks: T5655
      
      Differential Revision: https://secure.phabricator.com/D9982
      86c399b6
  2. 22 Jul, 2014 5 commits
  3. 21 Jul, 2014 7 commits
    • Joshua Spence's avatar
      Change class names in documentation · 55fed957
      Joshua Spence authored
      Summary: Ref T5655. Update class names in documentation after D9983.
      
      Test Plan: N/A
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Maniphest Tasks: T5655
      
      Differential Revision: https://secure.phabricator.com/D9984
      55fed957
    • Joshua Spence's avatar
      Utilize `PhutilMethodNotImplementedException` · 8999a1c1
      Joshua Spence authored
      Summary: Depends on D9992. Utilize the `PhutilMethodNotImplementedException` class.
      
      Test Plan: N/A
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D10000
      8999a1c1
    • Joshua Spence's avatar
      Simplify the implementation of `PhabricatorPHIDType` subclasses · 25454223
      Joshua Spence authored
      Summary: Instead of implementing the `getTypeConstant` method in all subclasses of `PhabricatorPHIDType`, provide a `final` implementation in the base class which uses reflection. See D9837 for a similar implementation.
      
      Test Plan: Ran `arc unit`.
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin, hach-que
      
      Differential Revision: https://secure.phabricator.com/D9985
      25454223
    • Joshua Spence's avatar
      Don't explicitly name abstract base classes · 37106c1b
      Joshua Spence authored
      Summary: Ref T5655. It is superfluous to include "base" in the name of an abstract base class. Furthermore, it is not done consistently within the code base.
      
      Test Plan: Ran `arc unit`.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Maniphest Tasks: T5655
      
      Differential Revision: https://secure.phabricator.com/D9989
      37106c1b
    • Joshua Spence's avatar
      Rename `PhabricatorDestructableInterface` interface · 76ed7d1a
      Joshua Spence authored
      Summary: Ref T5655. The `PhabricatorDestructibleInterface` interface is misspelled as `PhabricatorDestructableInterface`. Fix the spelling mistake.
      
      Test Plan: `grep`. Seeing as this interface is fairly recent, I don't expect that this would cause any widespread breakages.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Maniphest Tasks: T5655
      
      Differential Revision: https://secure.phabricator.com/D9988
      76ed7d1a
    • epriestley's avatar
      Namespace `dateCreated` in Maniphest query construction · 9d64beea
      epriestley authored
      Summary: Fixes T5661. We may now pick up a conflicting `dateCreated` field from an edge table join.
      
      Test Plan: Ran a project + dateCreated filtering query, no longer got an exception.
      
      Reviewers: btrahan, joshuaspence
      
      Reviewed By: joshuaspence
      
      Subscribers: epriestley
      
      Maniphest Tasks: T5661
      
      Differential Revision: https://secure.phabricator.com/D9997
      9d64beea
    • epriestley's avatar
      Fix rendering of project slugs in tokenizer UI · af214ecb
      epriestley authored
      Summary: Fixes T5659. When building a token after a user selection, we currently use the `value` as the token text, but sometimes that's an internal name which doesn't make much sense to users. For projects, it is now "sluga slugb Proper Display Name". If available, use `displayName` instead.
      
      Test Plan: Typed some projects into a tokenizer, got display names only.
      
      Reviewers: chad, joshuaspence
      
      Reviewed By: joshuaspence
      
      Subscribers: epriestley
      
      Maniphest Tasks: T5659
      
      Differential Revision: https://secure.phabricator.com/D9996
      af214ecb
  4. 18 Jul, 2014 5 commits
    • Joshua Spence's avatar
      Allow Phriction documents to be permanently deleted · 63ce0e66
      Joshua Spence authored
      Summary: Allow `PhrictionDocument` to be permanently deleted with `./bin/remove destroy`.
      
      Test Plan:
      Deleted a Phriction document with `./bin/remove` and verified that the database was in the expected state.
      
      ```
      > ./bin/remove destroy PHID-WIKI-auj57rauigvcqvv5feh6
       IMPORTANT: OBJECTS WILL BE PERMANENTLY DESTROYED!
      
      There is no way to undo this operation or ever retrieve this data.
      
      These 1 object(s) will be completely destroyed forever:
      
          - PHID-WIKI-auj57rauigvcqvv5feh6 (PhrictionDocument)
      
          Are you absolutely certain you want to destroy these 1 object(s)? [y/N] y
      
      Destroying objects...
      Destroying PhrictionDocument PHID-WIKI-auj57rauigvcqvv5feh6...
      Permanently destroyed 1 object(s).
      ```
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D9976
      63ce0e66
    • epriestley's avatar
      Explicitly degrade edge editing for commit/task edges until T4896 · 17afcdcf
      epriestley authored
      Summary:
      Commits don't support `PhabricatorApplicationTransactionInterface` yet, so the "Edit Maniphest Tasks" dialog from the commit UI currently bombs.
      
      Hard-code it to do the correct writes in a low-level way. After T4896 we can remove this and do `ApplicationTransaction` stuff.
      
      Test Plan: Used the "Edit Maniphest Tasks" UI from Diffusion.
      
      Reviewers: joshuaspence
      
      Reviewed By: joshuaspence
      
      Subscribers: epriestley
      
      Differential Revision: https://secure.phabricator.com/D9975
      17afcdcf
    • Joshua Spence's avatar
      Allow mailing lists to be permanently deleted · 48f6189f
      Joshua Spence authored
      Summary: Allow `PhabricatorMetaMTAMailingList` to be permanently deleted with `./bin/remove destroy`.
      
      Test Plan:
      ```
      ./bin/remove destroy PHID-MLST-nseux3r55escj573shsf
       IMPORTANT: OBJECTS WILL BE PERMANENTLY DESTROYED!
      
      There is no way to undo this operation or ever retrieve this data.
      
      These 1 object(s) will be completely destroyed forever:
      
          - PHID-MLST-nseux3r55escj573shsf (PhabricatorMetaMTAMailingList)
      
          Are you absolutely certain you want to destroy these 1 object(s)? [y/N] y
      
      Destroying objects...
      Destroying PhabricatorMetaMTAMailingList PHID-MLST-nseux3r55escj573shsf...
      Permanently destroyed 1 object(s).
      ```
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D9979
      48f6189f
    • Tal Shiri's avatar
      don't add email addresses to CC if they are already in TO · 570a78d4
      Tal Shiri authored
      Summary:
      Some mailers remove the duplicate entries themselves, but some (Mailgun) don't.
      This affects installations with metamta.one-mail-per-recipient set to false, and will cause
      - ugly looking "to" entries. Gmail, for example, collapses to+cc entries to one list, so you get something that looks like "to: me me john"
      - It sometimes causes duplicate delivery of the same message when used in conjuction with Google Groups. I suspect that their message de-dup mechanism is confused by it (I fuzzed it directly with Mailgun, and saw the same message delivered twice - once directly through mailgun, and bounced again through Google Groups). This doesn't happen when the entries are not duplicated.
      
      Test Plan: Created some tasks. Added subscribers. Things seem to work reasonably well.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Differential Revision: https://secure.phabricator.com/D9978
      570a78d4
    • epriestley's avatar
      Remove a stray `setActor()` on EdgeEditor · bd3c239d
      epriestley authored
      Summary: These got removed recently but I missed one callsite.
      
      Test Plan: Used `git grep` to double check all other callsites.
      
      Reviewers: joshuaspence
      
      Reviewed By: joshuaspence
      
      Subscribers: epriestley
      
      Differential Revision: https://secure.phabricator.com/D9973
      bd3c239d
  5. 17 Jul, 2014 13 commits
    • epriestley's avatar
      Give projects a proper on-demand datasource · a1158109
      epriestley authored
      Summary:
      Fixes T5614. Ref T4420. Other than the "users" datasource and a couple of others, many datasources ignore what the user typed and just return all results, then rely on the client to filter them.
      
      This works fine for rarely used ("legalpad documents") or always small ("task priorities", "applications") datasets, but is something we should graudally move away from as datasets get larger.
      
      Add a token table to projects, populate it, and use it to drive the datasource query. Additionally, expose it on the applicationsearch UI.
      
      Test Plan:
        - Ran migration.
        - Manually checked the table.
        - Searched for projects by name from ApplicationSearch.
        - Searched for projects by name from typeahead.
        - Manually checked the typeahead response.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T5614, T4420
      
      Differential Revision: https://secure.phabricator.com/D9896
      a1158109
    • Joshua Spence's avatar
      Return a HTTP 500 instead of a HTTP 400 if an internal error occurs in the Aphlict server · f2fee5a8
      Joshua Spence authored
      Summary: Ref T5651. Only throw a HTTP 400 if the data is invalid (i.e. the request is bad). If something bad happens when trying to transmit the notification, throw a HTTP 500 instead.
      
      Test Plan: Eye-ball it.
      
      Reviewers: epriestley, #blessed_reviewers
      
      Reviewed By: epriestley, #blessed_reviewers
      
      Subscribers: epriestley, Korvin
      
      Maniphest Tasks: T5651
      
      Differential Revision: https://secure.phabricator.com/D9968
      f2fee5a8
    • Joshua Spence's avatar
      Make HTTP errors returned from the Aphlict server more specific · 41a8837f
      Joshua Spence authored
      Summary: Ref T5651. Currently, the Aphlict server returns either `200 OKAY` or `400 Bad Request`. We could return more specific errors in some cases and this may assist with debugging.
      
      Test Plan:
      Sent myself a test notification at `/notification/status/` and saw the Aphlict server process the request (running in debug mode). Also poked around with `curl`:
      
      ```
      > curl http://localhost:22281/
      405 Method Not Allowed
      
      > curl http://localhost:22281/ -d ""
      400 Bad Request
      
      > curl http://localhost:22281/foobar/
      404 Not Found
      ```
      
      Reviewers: #blessed_reviewers, epriestley
      
      Reviewed By: #blessed_reviewers, epriestley
      
      Subscribers: epriestley, Korvin
      
      Maniphest Tasks: T5651
      
      Differential Revision: https://secure.phabricator.com/D9967
      41a8837f
    • epriestley's avatar
      Add more columns to typeahead wire format debugging view · 45ea88ce
      epriestley authored
      Summary: Fixes T4420. This isn't perfect but is one step less janky, at least.
      
      Test Plan: Viewed debugging view at `/typeahead/class/`, no unlabeled columns.
      
      Reviewers: btrahan, chad
      
      Reviewed By: chad
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9903
      45ea88ce
    • epriestley's avatar
      Mostly modernize the policy control typeahead · 4135ba48
      epriestley authored
      Summary:
      Ref T4420. This doesn't share all the code it really should, and renders a little odd. Make it more standard.
      
      (Icons aren't handled totally correctly but there's no usability impact and all that code should just get cleaned up.)
      
      Test Plan: Used custom policy typeahead, had a more standard experience.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9902
      4135ba48
    • epriestley's avatar
      Support placeholder text in Herald · 0e675677
      epriestley authored
      Summary: Ref T4420. We don't currently pass placeholder text properly, but should.
      
      Test Plan: Saw placeholder text in Herald.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9901
      0e675677
    • epriestley's avatar
      Retain focused node when redrawing tokenizer/typeahead results · 962e60c5
      epriestley authored
      Summary:
      Ref T4420. Fixes T5473. Currently, when typeahead results get redrawn, you can lose your cursor position. A simple way to reproduce this is type "dif", select "Differential" using the arrow keys, then type "f". The selection will be lost.
      
      Instead: store the old selection, then look for an item with the same name in the new set and select it. In effect, this preserves any focus selection.
      
      Test Plan:
        - Typed "dif".
        - Typed "down arrow key" to select "Differential".
        - Typed "f".
        - "Differential" remained selected.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T5473, T4420
      
      Differential Revision: https://secure.phabricator.com/D9900
      962e60c5
    • epriestley's avatar
      Share more code between tokenizers and global typeahead · a592b32c
      epriestley authored
      Summary:
      Ref T4420. Fixes T5306. Currently, the main menubar search has a lot of redundant/unshared code.
      
      Move some common functions into `JX.Prefab.whatever()` and call them from the main search.
      
      The major change here is that we apply the same "only show closed/disabled/archived objects if there are no matching open objects" logic, fixing T5306.
      
      Test Plan:
        - Used normal typeaheads.
        - Used global search.
        - Searched for a prefix shared by open and archived projects, didn't see the archived ones until the open ones were exhausted.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T5306, T4420
      
      Differential Revision: https://secure.phabricator.com/D9899
      a592b32c
    • epriestley's avatar
      Remove partial objects from Lisk · c52b3c28
      epriestley authored
      Summary:
      Ref T4420. This was a performance hack introduced long ago to make typeaheads for users a little cheaper. The idea was that you could load some of an object's columns and skip other ones.
      
      We now always load users on demand, so the cost of loading the whole objects is very small. No other use cases ever arose for this, and it seems unlikely that they will in the future. Remove it all.
      
      Test Plan:
      - Grepped for `CONFIG_PARTIAL_OBJECTS`.
      - Grepped for `dirtyFields`.
      - Grepped for `missingFields`.
      - Grepped for `resetDirtyFields`.
      - Grepped for `loadColumns`.
      - Grepped for `loadColumnsWhere`.
      - Grepped for `loadRawDataWhere`.
      - Loaded and saved some lisk objects.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9895
      c52b3c28
    • epriestley's avatar
      Make typeahead datasources default to PHID type icons · b8d604ac
      epriestley authored
      Summary:
      Ref T4420. If a datasource does not specify an icon explicitly, check if the PHID type has a default, and use that.
      
      This leaves us with only Projects and some special stuff setting explicit icons, and reduces code duplication.
      
      Test Plan: Used typeahead to find all affected object types.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9894
      b8d604ac
    • epriestley's avatar
      Modernize "owner" typeahead datasource · 7f0fb63c
      epriestley authored
      Summary: Ref T4420. This one is users plus "upforgrabs". I renamed that to "none" and gave it a special visual style to make it more discoverable. Future diffs will improve this.
      
      Test Plan:
        - Used it in global search.
        - Used it in batch editor.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9891
      7f0fb63c
    • epriestley's avatar
      Remove "searchproject" typeahead datasource · 27daa116
      epriestley authored
      Summary: Ref T4420. This is just "project", plus the special "no project" token, but that doesn't actually work. Replace it with a normal project typeahead. This is only used in Maniphest's reports.
      
      Test Plan: Searched for a couple of projects in reports.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9890
      27daa116
    • epriestley's avatar
      Modernize global search typeahead datasource · 0a3a3eae
      epriestley authored
      Summary: Ref T4420. Bring the global search up to date.
      
      Test Plan: Typed various things into global search.
      
      Reviewers: btrahan
      
      Reviewed By: btrahan
      
      Subscribers: epriestley
      
      Maniphest Tasks: T4420
      
      Differential Revision: https://secure.phabricator.com/D9889
      0a3a3eae