Rename getFromProjectLookup to getRepoName

ProjectLookup is the implementation detail and it's not relevant to the
caller of the interface.

It's still valuable to have some information about the implementation so
updated the documentation and mentioned it's relationship to
setInProjectLookup

Google-Bug-Id: b/297849592
Release-Notes: skip
Change-Id: Ica48efc7e66a80ddd989a7223ba64e18c772af96
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
index ff2f7a5..a3cb0ee 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -401,7 +401,7 @@
   setState(state: AppElementParams) {
     // TODO: Move this logic into the change model.
     if ('repo' in state && state.repo !== undefined && 'changeNum' in state)
-      this.restApiService.setInProjectLookup(state.changeNum, state.repo);
+      this.restApiService.addRepoNameToCache(state.changeNum, state.repo);
 
     this.routerModel.setState({view: state.view});
     // We are trying to reset the change (view) model when navigating to other
@@ -1361,7 +1361,7 @@
     const repo = ctx.params[0] as RepoName;
     const commentId = ctx.params[2] as UrlEncodedCommentId;
 
-    this.restApiService.setInProjectLookup(changeNum, repo);
+    this.restApiService.addRepoNameToCache(changeNum, repo);
     const [comments, robotComments, drafts, change] = await Promise.all([
       this.restApiService.getDiffComments(changeNum),
       this.restApiService.getDiffRobotComments(changeNum),
@@ -1474,7 +1474,7 @@
       this.show404();
       return;
     }
-    this.restApiService.getFromProjectLookup(changeNum).then(project => {
+    this.restApiService.getRepoName(changeNum).then(project => {
       // Show a 404 and terminate if the lookup request failed. Attempting
       // to redirect after failing to get the project loops infinitely.
       if (!project) {
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
index 50e506b..fbc0338 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router_test.ts
@@ -263,7 +263,7 @@
     let urlPromise: MockPromise<string>;
 
     setup(() => {
-      stubRestApi('setInProjectLookup');
+      stubRestApi('addRepoNameToCache');
       urlPromise = mockPromise<string>();
       redirectStub = sinon
         .stub(router, 'redirect')
@@ -374,7 +374,7 @@
     }
 
     setup(() => {
-      stubRestApi('setInProjectLookup');
+      stubRestApi('addRepoNameToCache');
       redirectStub = sinon.stub(router, 'redirect');
       redirectToLoginStub = sinon.stub(router, 'redirectToLogin');
       setStateStub = sinon.stub(router, 'setState');
@@ -863,7 +863,7 @@
 
       test('CHANGE_LEGACY', async () => {
         // CHANGE_LEGACY: /^\/c\/(\d+)\/?(.*)$/,
-        stubRestApi('getFromProjectLookup').resolves('project' as RepoName);
+        stubRestApi('getRepoName').resolves('project' as RepoName);
         await checkRedirect('/c/1234', '/c/project/+/1234/');
         await checkRedirect(
           '/c/1234/comment/6789',