Page MenuHomePhabricator

Projects - add "Additional Hashtags" to projects
ClosedPublic

Authored by btrahan on May 22 2014, 1:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 3:24 PM
Unknown Object (File)
Sun, Apr 21, 3:24 PM
Unknown Object (File)
Sun, Apr 21, 3:24 PM
Unknown Object (File)
Sun, Apr 21, 3:24 PM
Unknown Object (File)
Sun, Apr 21, 1:37 PM
Unknown Object (File)
Fri, Apr 19, 5:39 AM
Unknown Object (File)
Wed, Apr 17, 12:26 PM
Unknown Object (File)
Wed, Apr 17, 12:26 PM

Details

Summary

Fixes T4021. Chooses to keep a "primary" slug based off the name - including all that lovely logic - and allow the user to specify "additional" slugs. Expose these as "hashtags" to the user.

Sets us up for a fun diff where we can delete all the Project => Phriction automagicalness. In terms of this diff, see the TODOs i added.

Test Plan

added a primary slug as an additional slug - got an error. added a slug in use on another project - got an error. added multiple good slugs and they worked. removed slugs and it worked. made some remark using multiple new slugs and they all linked to the correct project

ran epriestley's case

  • Create project "A".
  • Give it additional slug "B".
  • Try to create project "B".

and i got a nice error about hashtag collision

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan retitled this revision from to Projects - add "Additional Slugs" to projects.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.

(Maybe we should call these "hashtags" in the UI, but I guess we can see how confusing users find "slugs".)

One inline.

If you do this:

  • Create project "A".
  • Give it additional slug "B".
  • Try to create project "B".

...what does it do? Uncaught duplicate key error?

resources/sql/autopatches/20140521.projectslug.2.mig.php
18–21

This should just be a hard-coded INSERT so we can survive the addition of columns later.

This revision now requires changes to proceed.May 22 2014, 1:58 AM

That's probably an error. Let's go with hashtags in the UI.

btrahan edited edge metadata.
  • fixed migration script to do INSERTs into the ProjectSlug table
  • fixed error case brought up by epriestley on project creation colliding with existing hashtags
  • fixed error handling in general on project create, axing a TODO
  • changed "slug" to "hashtag" as far as users are concerned

I think this should be good unless you want me to change hashtag to slug in the code too? I kind of like slug slightly better - its an underlying object used to create hashtags, we have a general library for manipulating slugs, etc - but maybe its really just going to be a hashtag.

btrahan retitled this revision from Projects - add "Additional Slugs" to projects to Projects - add "Additional Hashtags" to projects.May 22 2014, 5:58 PM
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan edited edge metadata.

Screen_Shot_2014-05-22_at_10.38.42_AM.png (1×2 px, 426 KB)

resources/sql/autopatches/20140521.projectslug.2.mig.php
15

will all documents have phriction slugs?

should I skip archived projects maybe?

epriestley edited edge metadata.

Nice, this looks great.

resources/sql/autopatches/20140521.projectslug.2.mig.php
15

They all should, yes (we migrated a while ago).

We shouldn't skip archived projects, since they could be un-archived later.

src/applications/project/editor/PhabricatorProjectTransactionEditor.php
309

Maybe provide 'Invalid' or something here to help users find the error?

321

(As above.)

This revision is now accepted and ready to land.May 22 2014, 6:15 PM
btrahan edited edge metadata.

add invalid to help users see errors

btrahan updated this revision to Diff 21988.

Closed by commit rP922e5c08497d (authored by @btrahan).

Calling them Hashtags is very confusing, from the naming I thought I would set same hashtags for similar projects, for example opus for the Opus and Opusfile and other related projects. This obviously doesn't work, and I was extremely confused until I found this ticket and learned that those are actually slugs…

They are called hashtags because that is how you write them in Remarkup. They are not used or referenced in any other way. #differential points to Differential.