Merge branch 'stable-3.7' into stable-3.8

* stable-3.7:
  Use project and changeNum for listing files in a patch-set
  Document ChecksApi.updateResult()
  Document `check-result-expanded` plugin endpoint
  Fix type of RevisionInfo.commit_with_footers

Release-Notes: skip
Change-Id: I2fe2b8f514d62bd565ffe6c50415c0a264c1b5af
diff --git a/Documentation/pg-plugin-checks-api.txt b/Documentation/pg-plugin-checks-api.txt
index e4cb5d0..39e2c9d 100644
--- a/Documentation/pg-plugin-checks-api.txt
+++ b/Documentation/pg-plugin-checks-api.txt
@@ -46,3 +46,23 @@
 `checksApi.announceUpdate()`
 
 Tells Gerrit to call `provider.fetch()`.
+
+[[updateResult]]
+== updateResult
+`checksApi.updateResult(run: CheckRun, result: CheckResult)`
+
+Updates an individual result. This can be used for lazy laoding detailled
+information. For example, if you are using the
+link:pg-plugin-endpoints.html#_check_result_expanded[`check-result-expanded`
+endpoint], then you can load more result details when the user expands a result
+row.
+
+The parameter `run` is only used to *find* the correct run for updating the
+result. It will only be used for comparing `change`, `patchset`, `attempt` and
+`checkName`. Its properties other than `results` will not be updated.
+
+For us being able to identify the result that you want to update you have to
+set the `externalId` property. An undefined `externalId` will result in an
+error.
+
+An example usage can be found in link:https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/main/web/checks-result.ts[Chromium Buildbucket Plugin].
diff --git a/Documentation/pg-plugin-endpoints.txt b/Documentation/pg-plugin-endpoints.txt
index dd82f27..0429f91 100644
--- a/Documentation/pg-plugin-endpoints.txt
+++ b/Documentation/pg-plugin-endpoints.txt
@@ -86,6 +86,25 @@
 labels with scores applied to the change, map of the label names to
 link:rest-api-changes.html#label-info[LabelInfo] entries
 
+=== check-result-expanded
+The `check-result-expanded` extension point is attached to a result
+of the link:pg-plugin-checks-api.html[ChecksAPI] when it is expanded. This can
+be used to attach a Web Component displaying results instead of the
+`CheckResult.message` field which is limited to raw unformatted text.
+
+In addition to default parameters, the following are available:
+
+* `result`
++
+The `CheckResult` object for the currently expanded result row.
+
+* `run`
++
+Same as `result`. The `CheckRun` object is not passed to the endpoint.
+
+The end point contains the `<gr-formatted-text>` element holding the
+`CheckResult.message` (if any was set).
+
 === robot-comment-controls
 The `robot-comment-controls` extension point is located inside each comment
 rendered on the diff page, and is only visible when the comment is a robot
@@ -246,4 +265,4 @@
 
 * `accountId`
 +
-the Id of the account that the status icon should correspond to.
\ No newline at end of file
+the Id of the account that the status icon should correspond to.
diff --git a/java/com/google/gerrit/server/restapi/change/Files.java b/java/com/google/gerrit/server/restapi/change/Files.java
index 7699873..96e5645 100644
--- a/java/com/google/gerrit/server/restapi/change/Files.java
+++ b/java/com/google/gerrit/server/restapi/change/Files.java
@@ -173,7 +173,7 @@
       } else if (parentNum != 0) {
         int parents =
             gApi.changes()
-                .id(resource.getChange().getChangeId())
+                .id(resource.getChange().getProject().get(), resource.getChange().getChangeId())
                 .revision(resource.getPatchSet().id().get())
                 .commit(false)
                 .parents
diff --git a/polygerrit-ui/app/api/checks.ts b/polygerrit-ui/app/api/checks.ts
index 98aaa9c..f66c373 100644
--- a/polygerrit-ui/app/api/checks.ts
+++ b/polygerrit-ui/app/api/checks.ts
@@ -375,9 +375,11 @@
    * responsible for not killing the browser. :-)
    *
    * For now this is just a plain unformatted string. The only formatting
-   * applied is the one that Gerrit also applies to human comments. TBD: Both
-   * human comments and check result messages should get richer formatting
-   * options.
+   * applied is the one that Gerrit also applies to human comments.
+   *
+   * To provide richer formatting to the check result messages you should use
+   * the `check-result-expanded` plugin endpoint to attach a Web Component.
+   * See `Documentation/pg-plugin-endpoints.txt`.
    */
   message?: string;
 
diff --git a/polygerrit-ui/app/api/rest-api.ts b/polygerrit-ui/app/api/rest-api.ts
index 244002e..993f24d 100644
--- a/polygerrit-ui/app/api/rest-api.ts
+++ b/polygerrit-ui/app/api/rest-api.ts
@@ -987,7 +987,7 @@
   commit?: CommitInfo;
   files?: {[filename: string]: FileInfo};
   reviewed?: boolean;
-  commit_with_footers?: boolean;
+  commit_with_footers?: string;
   push_certificate?: PushCertificateInfo;
   description?: string;
   basePatchNum?: BasePatchSetNum;