code: func (bs *BuildSummary) AddManifestKeysFromBuildSets(c context.Context) error {
  	if bs.BuilderID == "" {
  		return errors.New("BuilderID is empty")
  	}
  
  	for _, bsetRaw := range bs.BuildSet {
  		commit, ok := protoutil.ParseBuildSet(bsetRaw).(*buildbucketpb.GitilesCommit)
  		if !ok {
  			continue
  		}
  
  		revision, err := hex.DecodeString(commit.Id)
  		switch {
  		case err != nil:
  			logging.WithError(err).Warningf(c, "failed to decode revision: %v", commit.Id)
  
  		case len(revision) != sha1.Size:
  			logging.Warningf(c, "wrong revision size %d v %d: %q", len(revision), sha1.Size, commit.Id)
  
  		default:
  			consoles, err := common.GetAllConsoles(c, bs.BuilderID)
  			if err != nil {
  				return err
  			}
  
  			// HACK(iannucci): Until we have real manifest support, console definitions
  			// will specify their manifest as "REVISION", and we'll do lookups with null
  			// URL fields.
  			for _, con := range consoles {
  				bs.AddManifestKey(con.ProjectID(), con.ID, "REVISION", "", revision)
  
  				bs.AddManifestKey(con.ProjectID(), con.ID, "BUILD_SET/GitilesCommit",
  					protoutil.GitilesCommitURL(commit), revision)
  			}
  		}
  	}
  	return nil
  }
docs: // AddManifestKeysFromBuildSets potentially adds one or more ManifestKey's to
  // the BuildSummary for any defined BuildSets.
  //
  // This assumes that bs.BuilderID and bs.BuildSet have already been populated.
  // If BuilderID is not populated, this will return an error.