Page MenuHomePhabricator

Search Symbols by Repository, not Project
ClosedPublic

Authored by avivey on May 4 2015, 1:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 12:01 PM
Unknown Object (File)
Thu, Apr 11, 8:20 AM
Unknown Object (File)
Wed, Apr 10, 4:34 AM
Unknown Object (File)
Sat, Apr 6, 6:06 PM
Unknown Object (File)
Wed, Apr 3, 2:57 PM
Unknown Object (File)
Fri, Mar 29, 5:10 AM
Unknown Object (File)
Mar 15 2024, 3:49 PM
Unknown Object (File)
Mar 15 2024, 2:44 PM
Subscribers

Details

Summary

Fixes T7977.

  • Move Indexed Languages and See Symbols From config to Repository
  • Make symbol search skip projects

This also makes the default languages to Everything instead of Nothing.

Test Plan
  • Browse files, click symbols.
  • Use quick search to find symbols
  • Browse revision, click symbols

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey retitled this revision from to Search Symbols by Repository, not Porject.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)
avivey added reviewers: epriestley, joshuaspence.
resources/sql/autopatches/20150504.symbolsproject.1.php
27

Following naming conventions, this should be $symbol_index_projects

30

Should be $index_project

joshuaspence retitled this revision from Search Symbols by Repository, not Porject to Search Symbols by Repository, not Project.May 4 2015, 12:27 PM
joshuaspence edited edge metadata.
epriestley edited edge metadata.

I didn't really catch anything substantive either, this looks great to me.

resources/sql/autopatches/20150504.symbolsproject.1.php
16

This will potentially update each repo several times, leaving the last value we process as the effective value. I think that's basically fine, but ideally we would probably append to $sources and $languages so that each repo gets the list of all sources and all languages as its final value.

src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
38

Prefer phutil_utf8_strtolower(), which has less terrible behavior on some inputs.

This revision now requires changes to proceed.May 4 2015, 12:39 PM
resources/sql/autopatches/20150504.symbolsproject.1.php
27

I'm running this again now, and this fails on "bad getter", which makes sense. Not sure why I thought it worked yesterday.

@epriestley: @joshuaspence raised a good point - How about we eliminate the "indexed languages" completely?

It looks like any value other than all is very unlikely (Just for people who hate extra dotted underlines?)

avivey edited edge metadata.
avivey marked 4 inline comments as done.

Make migration nicer (And crash 100% less)

src/applications/repository/storage/PhabricatorRepository.php
1197–1199

This is already handled above.

src/applications/repository/storage/PhabricatorRepositoryTransaction.php
408

Add period at end of sentence.

410–411

Wrap 'None' with pht().

416–417

Wrap 'Any' with pht()

avivey marked 4 inline comments as done.
avivey edited edge metadata.

phts, redundent delete

resources/sql/autopatches/20150504.symbolsproject.1.php
4

I wonder... should this maybe use queryfx_all directly? I imagine that later we will want to remove the PhabricatorRepositoryArcanistProjectQuery class completely as a part of T7604.

13

As above.

Generally looks good. Some minor inlines.

resources/sql/autopatches/20150504.symbolsproject.1.php
18–19

I don't quite follow why you use this instead of $project.

33

Prefer phutil_json_decode, which throws an exception if there is a failure.

45

As above.

src/applications/differential/controller/DifferentialRevisionViewController.php
766

Is nonempty necessary?

771

Is empty($indexed_langs) necessary?

src/applications/diffusion/controller/DiffusionBrowseFileController.php
271

I wonder if getSymbolSources() should just always include the "self" repository? This seems logical, but might be a bit too magical.

276

Is the empty check necessary?

avivey marked an inline comment as done.
avivey edited edge metadata.

Updates to migration schema

I'm a little hesitant to make changes to the migration script, because it's finicky to test. I've made a good effort last round ("Diff 3"), but I forgot how I did it, so this round might actually be worse.

I did test it again and it probably should be fine.

Plus, this version is all about using db fields directly, which will only work if projects hadn't actually changed it's structures since whenever was the last time the install upgraded (It looks very old schema, so it might be true).

resources/sql/autopatches/20150504.symbolsproject.1.php
4

I can see that would make sense.

18–19

Are you asking "instead of $projects" here? If so, it's because symbolIndexProjects is no longer pulled with that query.

src/applications/differential/controller/DifferentialRevisionViewController.php
766

I wasn't sure if getSymbolSources can return null, and wanted to play it safe.

771

empty here means "default", which I want to be "everything"... Or remove the field completely.

src/applications/diffusion/controller/DiffusionBrowseFileController.php
271

ahh... I don't really like that.

276

Same as above (default).

epriestley edited edge metadata.
epriestley added inline comments.
src/applications/repository/storage/PhabricatorRepositoryTransaction.php
408

extra space after "to" :3

This revision is now accepted and ready to land.May 18 2015, 1:29 PM

Couple of adjustments I caught poking at this locally:

  • Hit this while editing existing Arcanist projects:

Screen Shot 2015-05-18 at 6.30.14 AM.png (406×1 px, 106 KB)

I just removed the symbol code in the if ($request->isFormPost()) body.

  • Fixed the to trivial typo.
  • Made a minor capitalization tweak for consistency ("symbols from" -> "Symbols From").
  • I just removed the highlighting note since it was pointing to the wrong place anyway, and filed T8235 to do a pass on the docs here. Another thing that might be useful is telling users what the setting does.
src/applications/diffusion/controller/DiffusionRepositorySymbolsController.php
126–139

I think this links to the wrong config setting?

src/applications/differential/controller/DifferentialRevisionViewController.php
768

This could raise a warning about $langs not being an array.

This revision was automatically updated to reflect the committed changes.