1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-05 20:31:03 +01:00
phorge-phorge/src/applications
epriestley 5d8457a07e In the repository URI index, store Phabricator's own URIs as tokens
Summary:
Fixes T13435. If you move Phabricator or copy data from one environment to another, the repository URI index currently still references the old URI, since it writes the URI as a plain string. This may make "arc which" and similar workflows have difficulty identifying repositories.

Instead, store the "phabricator.base-uri" domain and the "diffusion.ssh-host" domain as tokens, so lookups continue to work correctly even after these values change.

Test Plan:
  - Added unit tests to cover the normalization.
  - Ran migration, ran daemons, inspected `repository_uriindex` table, saw a mixture of sensible tokens (for local domains) and static domains (like "github.com").
  - Ran this thing:

```
$ echo '{"remoteURIs": ["ssh://git@local.phacility.com/diffusion/P"]}' | ./bin/conduit call --method repository.query --trace --input -
Reading input from stdin...
>>> [2] (+0) <conduit> repository.query()
>>> [3] (+3) <connect> local_repository
<<< [3] (+3) <connect> 555 us
>>> [4] (+5) <query> SELECT `r`.* FROM `repository` `r` LEFT JOIN `local_repository`.`repository_uriindex` uri ON r.phid = uri.repositoryPHID WHERE (uri.repositoryURI IN ('<base-uri>/diffusion/P')) GROUP BY `r`.phid ORDER BY `r`.`id` DESC LIMIT 101
<<< [4] (+5) <query> 596 us
<<< [2] (+6) <conduit> 6,108 us
{
  "result": [
    {
      "id": "1",
      "name": "Phabricator",
      "phid": "PHID-REPO-2psrynlauicce7d3q7g2",
      "callsign": "P",
      "monogram": "rP",
      "vcs": "git",
      "uri": "http://local.phacility.com/source/phabricator/",
      "remoteURI": "https://github.com/phacility/phabricator.git",
      "description": "asdf",
      "isActive": true,
      "isHosted": false,
      "isImporting": false,
      "encoding": "UTF-8",
      "staging": {
        "supported": true,
        "prefix": "phabricator",
        "uri": null
      }
    }
  ]
}
```

Note the `WHERE` clause in the query normalizes the URI into "<base-uri>", and the lookup succeeds.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13435

Differential Revision: https://secure.phabricator.com/D20872
2019-10-28 14:44:06 -07:00
..
almanac Convert complex query subclasses to use internal cursors 2019-03-19 13:02:16 -07:00
aphlict Add a CLI workflow for testing that notifications are being delivered 2018-12-10 16:05:53 -08:00
arcanist/conduit
audit Fix missing link targets for "View Object" header buttons in HTML email 2019-06-18 13:20:56 -07:00
auth Persist login instructions onto flow-specific login pages (username/password and LDAP) 2019-10-24 18:38:15 -07:00
badges Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
base Give the Phortune external portal an order view 2019-08-26 07:49:17 -07:00
cache Straighten out replication/cache behavior in "bin/storage dump" 2019-08-28 08:25:40 -07:00
calendar Move web application classes into "phabricator/" 2019-09-02 07:58:59 -07:00
celerity Fix "Actions" button on Phame standalone/live pages (bonus: JX.sprintf()) 2019-04-04 06:10:14 -07:00
chatlog Replace "getRequestURI()->setQueryParams(array())" with "getPath()" 2019-02-12 14:43:33 -08:00
conduit Fix a cursor paging issue in Conduit call logs 2019-09-24 08:36:49 -07:00
config Remove the "ONLY_FULL_GROUP_BY" SQL mode setup warning and change the setup key for "STRICT_ALL_TABLES" 2019-09-09 12:17:51 -07:00
conpherence Improve Conpherence behavior for logged out users. 2019-04-02 14:03:08 -07:00
console Fix some minor errors (DarkConsole warning, unstable Ferret sort) 2018-03-18 15:12:25 -07:00
countdown Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
daemon Fix missing display cell in daemon summary table 2019-08-12 12:46:48 -07:00
dashboard Support more than 9 portals 2019-10-02 22:35:59 +03:00
differential Fix an issue where added or removed source files could incorrectly select a DocumentEngine 2019-10-26 12:16:49 -07:00
diffusion Add default branch, description, and metrics (commit count, recent commit) to "diffusion.repository.search" 2019-10-24 17:16:58 -07:00
diviner Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
doorkeeper Recognize self-URI links to Diffusion files and give them special rendering behavior 2019-05-21 13:07:37 -07:00
draft/storage When purging drafts after a transaction edit, purge all drafts 2018-02-11 06:01:09 -08:00
drydock Implement "drydock.resource.search" 2019-08-20 13:07:07 -07:00
fact Unprototype "Facts" to clear Maniphest/chart fatals 2019-09-23 13:01:18 -07:00
favorites Make "Favorites" work more like other customizable menus 2019-04-09 13:59:35 -07:00
feed Support export of feed transactions to CSV/Excel/etc 2019-05-21 12:47:46 -07:00
files Support rich diff rendering with DocumentEngine for added/removed files 2019-10-26 08:21:46 -07:00
flag Add a "Remove flag" action to Herald 2019-09-09 13:15:52 -07:00
fund Update a straggling "getAuthorities()" call in Fund 2019-09-04 07:15:20 -07:00
guides Remove legacy "DashboardInstall" table 2019-04-14 10:27:52 -07:00
harbormaster Don't present users with Herald fields/actions for uninstalled applications, unless the rule already uses them 2019-09-12 14:33:28 -07:00
help Redesign header menus and search 2017-01-17 12:13:06 -08:00
herald Don't present users with Herald fields/actions for uninstalled applications, unless the rule already uses them 2019-09-12 14:33:28 -07:00
home Make "Favorites" work more like other customizable menus 2019-04-09 13:59:35 -07:00
legalpad Don't present users with Herald fields/actions for uninstalled applications, unless the rule already uses them 2019-09-12 14:33:28 -07:00
lipsum Add "--force" and "--quickly" flags to bin/lipsum 2017-02-27 09:09:41 -08:00
macro Improve timeline rendering for old macros 2019-04-18 18:25:17 -07:00
maniphest Unprototype "Facts" to clear Maniphest/chart fatals 2019-09-23 13:01:18 -07:00
meta Fix a straggling callsite to "renderApplicationPolicy()" 2019-09-12 16:26:57 -07:00
metamta Simplify implementation of "SysetemAction->getSystemActionConstant()" 2019-07-19 15:45:37 -07:00
multimeter Fix a PhutilURI issue in Multimeter 2019-02-17 17:39:34 -08:00
notification When a task card is edited, emit update events for old boards and parent boards 2019-07-30 13:16:33 -07:00
nuance Remove "getApplicationTransactionObject()" from ApplicationTransactionInterface 2018-12-20 15:16:19 -08:00
oauthserver Lightly modernize OAuth server application view pages 2019-07-02 05:15:37 -07:00
owners Fix an issue in Owners where a transaction change could show too many effects 2019-06-20 16:08:31 -07:00
packages Remove "getApplicationTransactionObject()" from ApplicationTransactionInterface 2018-12-20 15:16:19 -08:00
passphrase Remove "Editable By" description fields in Passphrase, Phame, and Spaces 2019-09-12 09:36:50 -07:00
paste Make basic Juypter notebook rendering improvements and roughly support folding unchanged context 2019-09-30 10:41:21 -07:00
people Fix deprecated argument order for "implode()" 2019-10-17 09:11:27 -07:00
phame Remove "Editable By" description fields in Passphrase, Phame, and Spaces 2019-09-12 09:36:50 -07:00
phid Update search indexes for Dashboards and Panels to Ferret, plus various minor fixes 2019-04-14 10:28:19 -07:00
phlux Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
pholio Fix "add more metadata" fatal in Pholio 2019-07-11 15:55:56 -07:00
phortune Clean up two straggling UI issues in Phortune 2019-08-31 09:36:23 -07:00
phpast Update phpast for new UI 2016-04-05 13:52:59 -07:00
phragment Update many Phabricator queries for new %Q query semantics 2018-11-15 03:48:10 -08:00
phrequent Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
phriction Remove "Moved Document from ..." notice in Phriction 2019-09-12 09:32:26 -07:00
phurl Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
policy When users encounter a policy exception for a non-view capability with a custom policy, inline the policy rules 2019-09-12 09:49:17 -07:00
ponder Fix a missing pht() in Ponder 2019-04-12 12:18:56 -07:00
project Improve project member list behaviors related to disabled users 2019-10-24 18:41:33 -07:00
releeph Convert simple query subclasses to use internal cursors 2019-03-19 13:00:27 -07:00
remarkup Recognize self-URI links to Diffusion files and give them special rendering behavior 2019-05-21 13:07:37 -07:00
repository In the repository URI index, store Phabricator's own URIs as tokens 2019-10-28 14:44:06 -07:00
search Make minor flavor updates 2019-08-23 07:08:09 -07:00
settings Don't offer personal saved queries in global "Search Scope" settings dropdown 2019-09-09 12:21:25 -07:00
slowvote Deprecate ancient "slowvote.info" API method 2019-07-31 11:28:08 -07:00
spaces Remove "Editable By" description fields in Passphrase, Phame, and Spaces 2019-09-12 09:36:50 -07:00
subscriptions Index and show Owners packages affected by Herald rules 2019-04-17 12:17:30 -07:00
support/application
system Add a "View as..." option to diff dropdowns for selecting between document engines 2019-09-25 16:29:21 -07:00
tokens Allow tokens to be awarded to MFA-required objects 2018-12-28 00:14:48 -08:00
transactions Fix an error message when calling "transaction.search" with a non-transactional object PHID as an "objectIdentifier" 2019-10-17 09:19:54 -07:00
typeahead Make Portals indexable with Ferret 2019-04-10 13:33:54 -07:00
uiexample Reduce the cost of generating default user profile images 2018-03-01 16:53:17 -08:00
xhprof Allow XHProf profiles to be drag-and-dropped to upload them 2017-02-23 11:16:19 -08:00