Page MenuHomeSoftware Heritage

Phabricator/plugin: Add support for commented links
ClosedPublic

Authored by ardumont on Apr 9 2019, 2:12 PM.

Diff Detail

Repository
R154 Limnoria plugins
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Apr 9 2019, 2:12 PM
ardumont updated this revision to Diff 4419.Apr 9 2019, 2:14 PM

do'h - Fix 0-0 to 0-9

ardumont planned changes to this revision.Apr 9 2019, 2:18 PM
ardumont updated this revision to Diff 4420.Apr 9 2019, 2:33 PM

Transmit object_fragment to object formatter as well

So that they can build the right url

ardumont planned changes to this revision.Apr 9 2019, 4:07 PM
ardumont updated this revision to Diff 4568.Apr 13 2019, 4:58 PM
  • Phabricator/plugin: Add support for commented links
  • Refactor: Break out of the loop prior to parse some more the id
  • Refactor: Use regexp to fetch object type, id and fragment

@olasd i finally grasped what you meant, thanks.
I iterated over multiple implementations.
In the end, i chose to use regexp consistently.

ardumont updated this revision to Diff 4569.Apr 13 2019, 5:02 PM
  • Explicit regexp fields
ardumont updated this revision to Diff 4573.Apr 15 2019, 10:48 AM
  • Phabricator/plugin: Recognize object id even in lower case
vlorentz accepted this revision.Apr 15 2019, 10:51 AM

Could you factorize this part:

url = full_XXX['uri']
if object_fragment is not None:
    url = '%s%s' % (url, object_fragment)

by moving it in get_object_by_phid?

Phabricator/plugin.py
225

Replace the last * by a ?, there's at most one fragment.

This revision is now accepted and ready to land.Apr 15 2019, 10:51 AM
ardumont added inline comments.Apr 15 2019, 10:51 AM
Phabricator/plugin.py
232–236

@vlorentz asked for this, so the bot can hint even lowered-case object

ardumont marked an inline comment as done.Apr 15 2019, 10:53 AM
ardumont added inline comments.
Phabricator/plugin.py
225

Right!

ardumont updated this revision to Diff 4574.Apr 15 2019, 10:59 AM
ardumont marked an inline comment as done.
  • phab/plugin: Change to match reality, there is at most 1 fragment
  • plugin: Factorize full uri computation in get_object_by_phid
This revision was automatically updated to reflect the committed changes.