[artifacts] Revert "Read gcs_bucket from output properties, not input"
This reverts commit 2e81ae1df391e7b90b9c38f4371330de2ac316c4.
Reason for revert: May be causing system OTA test to fail
Original change's description:
> [artifacts] Read gcs_bucket from output properties, not input
>
> This is better because:
> * It's much more intuitive that something outside a build depends on its
> outputs rather than its inputs.
> * Our recipe code expects this. It's setting the output property
> gcs_bucket already, not the input property.
>
> Change-Id: Id2ad57c08e4f60a7bd20310afabec9210ca7bffb
TBR=garymm@google.com,atyfto@google.com,kylecameron@google.com
Change-Id: Ic31c219907ec65a2adc2a5f011dd7c553a96481c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
diff --git a/buildbucket/build.go b/buildbucket/build.go
index dfb9823..f7fce73 100644
--- a/buildbucket/build.go
+++ b/buildbucket/build.go
@@ -17,10 +17,10 @@
return b.Input.GitilesCommit
}
-// OutputProperty returns the output property with the given name. Returns (nil, false)
-// if not found.
-func (b Build) OutputProperty(name string) (*Property, bool) {
- prop, ok := b.Output.Properties.Fields[name]
+// Property reads a specific input Property from this builder. Returns false with a nil
+// Property if not found.
+func (b Build) Property(name string) (*Property, bool) {
+ prop, ok := b.Input.Properties.Fields[name]
if !ok {
return nil, false
}
diff --git a/cmd/artifacts/common.go b/cmd/artifacts/common.go
index 42ccd7b..e23c2b2 100644
--- a/cmd/artifacts/common.go
+++ b/cmd/artifacts/common.go
@@ -47,9 +47,9 @@
}
wrapper := buildbucket.Build(*response)
- property, ok := wrapper.OutputProperty(bucketPropertyName)
+ property, ok := wrapper.Property(bucketPropertyName)
if !ok {
- return "", fmt.Errorf("no output property %q found for build %q", bucketPropertyName, build)
+ return "", fmt.Errorf("no property %q found for build %q", bucketPropertyName, build)
}
return property.StringValue(), nil
diff --git a/cmd/artifacts/common_test.go b/cmd/artifacts/common_test.go
index b4df735..c23a3c4 100644
--- a/cmd/artifacts/common_test.go
+++ b/cmd/artifacts/common_test.go
@@ -50,7 +50,7 @@
mock: mockBuildsClient{
response: &buildbucketpb.Build{
Id: 123,
- Output: &buildbucketpb.Build_Output{
+ Input: &buildbucketpb.Build_Input{
Properties: &_struct.Struct{
Fields: map[string]*_struct.Value{
"gcs_bucket": &_struct.Value{
@@ -90,7 +90,7 @@
shouldErr: true,
response: &buildbucketpb.Build{
Id: 123,
- Output: &buildbucketpb.Build_Output{
+ Input: &buildbucketpb.Build_Input{
Properties: &_struct.Struct{
Fields: map[string]*_struct.Value{},
},
@@ -110,7 +110,7 @@
mock: mockBuildsClient{
response: &buildbucketpb.Build{
Id: 123,
- Output: &buildbucketpb.Build_Output{
+ Input: &buildbucketpb.Build_Input{
Properties: &_struct.Struct{
Fields: map[string]*_struct.Value{},
},