Fix `COMMENT` route for change numbers with unknown repo

The `RestApiService` has a cached map for looking up the repo by
change number. This is usually populated in either the router's
`setState()` method or when change information was fetched from the
Rest API.

The `COMMENT` route is special, because it requires dedicated Rest
API calls for looking up where to redirect the user. This happens
before `setState()` is executed. Thus the repo lookup cache is not
yet populated. There is a fallback of looking up the repo by making
an index query, which was working ok until 3.7 (just making routing
a bit slower than desired), but this fallback won't work, if the
repo was imported and change numbers are not unique across the
entire Gerrit instance.

So the easy fix is to manually populate the repo cache in
`handleCommentRoute()` before making any Rest API calls.

Release-Notes: Fix comment directly link pointing to a change imported from other Gerrit server-ids
Bug: Issue 312895375
Change-Id: I2fc29df3f29718b47a019d4a82b6b4abaf52e69f
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 1982ee2..ff2f7a5 100644
--- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
+++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -1361,6 +1361,7 @@
     const repo = ctx.params[0] as RepoName;
     const commentId = ctx.params[2] as UrlEncodedCommentId;
 
+    this.restApiService.setInProjectLookup(changeNum, repo);
     const [comments, robotComments, drafts, change] = await Promise.all([
       this.restApiService.getDiffComments(changeNum),
       this.restApiService.getDiffRobotComments(changeNum),