@@ -38,9 +38,11 @@ func main() {
3838 workPath = flag .String ("work_path" , "" , "The directory to use to store temporary files (e.g. pngs and JSON)" )
3939
4040 // Provided for tryjobs
41- changelistID = flag .String ("changelist_id" , "" , "The id the Gerrit CL. Omit for primary branch." )
42- tryjobID = flag .String ("tryjob_id" , "" , "The id of the Buildbucket job for tryjobs. Omit for primary branch." )
43- patchsetOrder = flag .Int ("patchset_order" , 0 , "Represents if this is the nth patchset" )
41+ changelistID = flag .String ("changelist_id" , "" , "The id the Gerrit CL. Omit for primary branch." )
42+ tryjobID = flag .String ("tryjob_id" , "" , "The id of the Buildbucket job for tryjobs. Omit for primary branch." )
43+ // Because we pass in patchset_order via a placeholder, it can be empty string. As such, we
44+ // cannot use flag.Int, because that errors on "" being passed in.
45+ patchsetOrder = flag .String ("patchset_order" , "0" , "Represents if this is the nth patchset" )
4446
4547 // Debugging flags.
4648 local = flag .Bool ("local" , false , "True if running locally (as opposed to on the bots)" )
@@ -67,6 +69,15 @@ func main() {
6769 td .Fatal (ctx , err )
6870 }
6971
72+ patchset := 0
73+ if * patchsetOrder != "" {
74+ p , err := strconv .Atoi (* patchsetOrder )
75+ if err != nil {
76+ td .Fatalf (ctx , "Invalid patchset_order %q" , * patchsetOrder )
77+ }
78+ patchset = p
79+ }
80+
7081 keys := * goldKeys
7182 switch * webGLVersion {
7283 case 0 :
@@ -81,7 +92,7 @@ func main() {
8192
8293 // initialize goldctl
8394 if err := setupGoldctl (ctx , * local , * gitCommit , * changelistID , * tryjobID , goldctlAbsPath , goldctlWorkPath ,
84- * serviceAccountPath , keys , * patchsetOrder ); err != nil {
95+ * serviceAccountPath , keys , patchset ); err != nil {
8596 td .Fatal (ctx , err )
8697 }
8798
0 commit comments