Page MenuHomePhabricator

Specialize rendering of self-URIs in the form "/X123"
ClosedPublic

Authored by epriestley on May 9 2019, 8:34 PM.
Tags
None
Referenced Files
F13052022: D20512.id48905.diff
Fri, Apr 19, 6:27 AM
F13050830: D20512.id48941.diff
Fri, Apr 19, 3:13 AM
F13050829: D20512.id48905.diff
Fri, Apr 19, 3:13 AM
F13050828: D20512.id.diff
Fri, Apr 19, 3:13 AM
Unknown Object (File)
Thu, Apr 11, 4:20 AM
Unknown Object (File)
Fri, Apr 5, 2:55 AM
Unknown Object (File)
Fri, Mar 29, 8:29 AM
Unknown Object (File)
Sat, Mar 23, 12:45 AM
Subscribers

Details

Summary

Depends on D20510. Ref T5378. When remarkup includes a hyperlink to the current install in the form "/X123" (which is common), load the corresponding object and specialize the rendering.

This doesn't cover everything (notably, no handling for Diffusion paths yet), but does cover a lot of the most common cases.

The "uri" form preserves the URI as written, but adds an icon, tag, and hovercard.

The "{uri}" form is more similar to {T123} and shows the object name.

Test Plan

Screen Shot 2019-05-09 at 1.32.02 PM.png (540×615 px, 51 KB)

Diff Detail

Repository
rP Phabricator
Branch
sref4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22778
Build 31243: Run Core Tests
Build 31242: arc lint + arc unit

Unit TestsFailed

TimeTest
199 msPhabricatorLibraryTestCase::testEverythingImplemented
EXCEPTION (PhutilMissingSymbolException): Failed to load class/interface "PhabricatorSelfHyperlinkEngineExtension". The symbol map for library "phabricator" (at "/core/data/drydock/workingcopy-90/repo/phabricator/src") claims this symbol (of type "class/interface") is defined in "applications/meta/engineextension/PhabricatorSelfHyperlinkEngineExtension.php", but loading that source file did not cause the symbol to become defined.
1,046 msPhabricatorLibraryTestCase::testMethodVisibility
EXCEPTION (PhutilMissingSymbolException): Failed to load class or interface "PhutilRemarkupHyperlinkEngineExtension". The class or interface "PhutilRemarkupHyperlinkEngineExtension" is not defined in the library map of any loaded library.
1 msAlmanacNamesTestCase::testServiceOrDeviceNames
30 assertions passed.
0 msAlmanacServiceTypeTestCase::testGetAllServiceTypes
1 assertion passed.
0 msAphrontHTTPSinkTestCase::testHTTPHeaderNames
2 assertions passed.
View Full Test Results (2 Failed · 362 Passed)

Event Timeline

Slightly more complete test case:

Screen Shot 2019-05-09 at 1.34.23 PM.png (563×591 px, 54 KB)

Harbormaster returned this revision to the author for changes because remote builds failed.May 9 2019, 8:35 PM
Harbormaster failed remote builds in B22778: Diff 48905!

(Test failures are because of D20511 not being landed yet.)

joshuaspence added a subscriber: joshuaspence.
joshuaspence added inline comments.
src/applications/meta/engineextension/PhabricatorSelfHyperlinkEngineExtension.php
30–41

A minor point, but this will match /robots.txt... should the regex be tightened so as to only allow monograms?

44–46

I guess it doesn't really matter since you are looking up the objects anyway.

This revision is now accepted and ready to land.May 14 2019, 12:36 AM
src/applications/meta/engineextension/PhabricatorSelfHyperlinkEngineExtension.php
44–46

Yeah, we'll match various x.y.com/thing patterns, and /D99999999999999, but I expect these to be pretty rare and the behavior will still be correct, we'll just do a little extra work (discarding thing as a possible object name, or querying for D99999999999 and failing to load it).

This revision was landed with ongoing or failed builds.May 16 2019, 7:16 PM
This revision was automatically updated to reflect the committed changes.