message: Add support for new odsp summary tree format
diff: @@ -158,9 +158,10 @@ export class OdspDocumentStorageManager implements IDocumentStorageManager {
  commits[decodeURIComponent(key)] = hierarchicalTree.commits[key];
  }
  - if (commits && commits[".protocol"] && commits[".app"]) {
  + if (commits && commits[".app"]) {
  // the latest snapshot is a summary
  - return this.readSummaryTree(tree.sha, commits[".protocol"] as string, commits[".app"] as string);
  + // attempt to read .protocol from commits for backwards compat
  + return this.readSummaryTree(tree.sha, commits[".protocol"] || hierarchicalTree.trees[".protocol"], commits[".app"] as string);
  }
  if (hierarchicalTree.blobs) {
  @@ -387,28 +388,40 @@ export class OdspDocumentStorageManager implements IDocumentStorageManager {
  /**
  * Reads a summary tree
  * @param snapshotTreeId - Id of the snapshot
  - * @param protocolTreeId - Id of the protocol tree
  + * @param protocolTreeOrId - Protocol snapshot tree or id of the protocol tree
  * @param appTreeId - Id of the app tree
  */
  - private async readSummaryTree(snapshotTreeId: string, protocolTreeId: string, appTreeId: string): Promise<api.ISnapshotTree> {
  + private async readSummaryTree(snapshotTreeId: string, protocolTreeOrId: api.ISnapshotTree | string, appTreeId: string): Promise<api.ISnapshotTree> {
  // load the app and protocol trees and return them
  + let hierarchicalProtocolTree: api.ISnapshotTree;
  + let appTree: resources.ITree | null;
  +
  + if (typeof (protocolTreeOrId) === "string") {
  + // backwards compat for older summaries
  const trees = await Promise.all([
  - this.readTree(protocolTreeId),
  + this.readTree(protocolTreeOrId),
  this.readTree(appTreeId),
  ]);
  - // merge trees
  const protocolTree = trees[0];
  if (!protocolTree) {
  throw new Error("Invalid protocol tree");
  }
  - const appTree = trees[1];
  + appTree = trees[1];
  +
  + hierarchicalProtocolTree = buildHierarchy(protocolTree);
  +
  + } else {
  + appTree = await this.readTree(appTreeId);
  +
  + hierarchicalProtocolTree = protocolTreeOrId;
  + }
  +
  if (!appTree) {
  throw new Error("Invalid app tree");
  }
  - const hierarchicalProtocolTree = buildHierarchy(protocolTree);
  const hierarchicalAppTree = buildHierarchy(appTree);
  if (hierarchicalProtocolTree.blobs) {
  