Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Unified Diff: logdog/client/annotee/annotation/annotation.go

Issue 2994593004: [annotee] add SOURCE_MANIFEST annotation. (Closed)
Patch Set: rename to deployment_manifests Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/proto/milo/annotations.pb.go ('k') | logdog/client/annotee/annotation/annotation_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/annotee/annotation/annotation.go
diff --git a/logdog/client/annotee/annotation/annotation.go b/logdog/client/annotee/annotation/annotation.go
index e6634009da5c6e5d13f7011ccf4bab6ee634a9d5..57859f915174a368dfa1d4c082161fcd0a2a54c7 100644
--- a/logdog/client/annotee/annotation/annotation.go
+++ b/logdog/client/annotee/annotation/annotation.go
@@ -15,6 +15,7 @@
package annotation
import (
+ "encoding/hex"
"fmt"
"strconv"
"strings"
@@ -372,10 +373,38 @@ func (s *State) Append(annotation string) error {
}
updatedIf(step, UpdateIterative, step.SetProperty(parts[0], parts[1]))
- // @@@STEP_TRIGGER@<spec>@@@
+ // @@@STEP_TRIGGER@<spec>@@@
case "STEP_TRIGGER":
// Annotee will stop short of sending an actual request to BuildBucket.
break
+
+ // This is ONLY supported by annotee, not by buildbot.
+ // @@@DEPLOYMENT_MANIFEST@<name>@<sha256>@<url>@@@
+ case "DEPLOYMENT_MANIFEST":
+ parts := strings.SplitN(params, "@", 3)
+ if len(parts) != 3 {
+ return fmt.Errorf("DEPLOYMENT_MANIFEST expected 3 params, got %q", params)
+ }
+
+ step := s.RootStep()
+ if step.DeploymentManifests == nil {
+ step.DeploymentManifests = map[string]*milo.Step_ManifestLink{}
+ }
+
+ name, hashHex, url := parts[0], parts[1], parts[2]
+ hash, err := hex.DecodeString(hashHex)
+ if err != nil {
+ return fmt.Errorf("DEPLOYMENT_MANIFEST has bad hash: %s", err)
+ }
+ if _, ok := step.DeploymentManifests[name]; ok {
+ return fmt.Errorf("repeated DEPLOYMENT_MANIFEST name %q", name)
+ }
+
+ step.DeploymentManifests[name] = &milo.Step_ManifestLink{
+ Sha256: hash,
+ Url: url,
+ }
+ updated = step
}
if updated != nil {
« no previous file with comments | « common/proto/milo/annotations.pb.go ('k') | logdog/client/annotee/annotation/annotation_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698