Page MenuHomePhabricator

Allow Phurl URLs to reference objects
Open, NormalPublic

Description

We should allow Phurl URLs to be bound directly to objects instead of URLs. For example, you should be able to type T123 instead of http://whatever.com/ as the URL for a Phurl.

When a Phurl is bound to an object like T123, it can work a lot like it is bound to http://whatever.install.com/T123, but we can improve the behavior in some cases in the future. For example:

  • Hovercards should show the target object;
  • URLs bound to other URLs could redirect through a sequence of URLs, allowing you to alias ((problem)) and ((problems)) to the same place.
  • Objects could show URLs that link to them.

To do this, we should probably:

  • Add an objectPHID column.
  • When a user sets a URL, check if it names an object. If it does, save an objectPHID. Otherwise, if it's a valid URL, save a URL. (Otherwise, error.)
  • When a URL bound to an object is followed, load the object handle and redirect to $handle->getURI().

Event Timeline

avivey raised the priority of this task from to Needs Triage.
avivey updated the task description. (Show Details)
avivey added a project: Phurl.
avivey added a subscriber: avivey.
epriestley triaged this task as Wishlist priority.Nov 21 2015, 4:15 PM
epriestley added a subscriber: epriestley.

If we do this, one has to be designated "primary" (like Projects) so we can get a consistent default /u/xyz when rendering. This broadly seems like a lot of work for not a lot of payoff, to me, at least today.

Some possible alternatives:

  • Do nothing; this doesn't really cause any problems today, even if using two different URLs isn't as purely correct as it could be.
  • Warn users when creating a URL which is the same as another URL?
  • Add a "Disabled" state which just serves as a visual hint that a URL is not preferred.
  • We just point U200 at U100 (that is, change the URL to /u/100) so it redirects through the earlier link.
    • Maybe later, Phurl gets better at recognizing/understanding this.

Of these approaches, my first thought is to favor the internal aliasing by just pointing one URL at another URL. I think this generalizes well into Phurl getting smarter when ((whatever)) points at a task or revision or wiki page or JIRA issue (if it recognizes that it knows about the targets, it can do stuff like smarter hovercard/preview rendering).

In a broader sense, this problem may be very rare, and our use case may be unusual. In the long term, our use case will largely remove to "Common Responses" or similar in Nuance anyway.

joshuaspence renamed this task from allow multiple aliases to a phurl to Allow multiple aliases to a Phurl URL.Nov 22 2015, 2:34 AM
epriestley renamed this task from Allow multiple aliases to a Phurl URL to Allow Phurl URLs to reference objects.Mar 25 2016, 8:06 PM
epriestley raised the priority of this task from Wishlist to Normal.
epriestley updated the task description. (Show Details)
eadler added a project: Restricted Project.Jul 25 2016, 5:08 PM