ci: do not unset Code-Review label

We recently made a change to unset the Code-Review label when starting a
trybot build.

The Code-Review label is being overloaded for trybot builds. Therefore,
we should touch it as little as possible until such time as we can
create separate labels for the trybot and unity results.

Change-Id: I28b95697c91be3a1ee536e35a733f5fe313ce347
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9183
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 15b7e37..7bd0271 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -21,7 +21,7 @@
       name: Update Gerrit CL message with starting message
       run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
         the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
-        github.run_id }}","labels":{"Code-Review":0}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
+        github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
         $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
   test:
     needs: start
diff --git a/cmd/cue/cmd/testdata/script/cmd_github.txt b/cmd/cue/cmd/testdata/script/cmd_github.txt
index 47dc0e1..bf0b908 100644
--- a/cmd/cue/cmd/testdata/script/cmd_github.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_github.txt
@@ -196,7 +196,7 @@
       name: Update Gerrit CL message with starting message
       run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
         the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
-        github.run_id }}","labels":{"Code-Review":0}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
+        github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
         $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
   test:
     needs: start
@@ -1224,7 +1224,6 @@
 		run:  (_#gerrit._#setCodeReview & {
 			#args: {
 				message: "Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
-				labels: "Code-Review": 0
 			}
 		}).res
 	}
@@ -1254,7 +1253,7 @@
 			#args: {
 				tag:     "trybot"
 				message: string
-				labels: "Code-Review": int
+				labels?: "Code-Review": int
 			}
 			res: "curl -f -s -H \"Content-Type: application/json\" --request POST --data '\(encjson.Marshal(#args))' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review"
 		}
diff --git a/cue/testdata/eval/github.txtar b/cue/testdata/eval/github.txtar
index 10ec85c..57adf0f 100644
--- a/cue/testdata/eval/github.txtar
+++ b/cue/testdata/eval/github.txtar
@@ -100,7 +100,6 @@
 		run:  (_#gerrit._#setCodeReview & {
 			#args: {
 				message: "Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
-				labels: "Code-Review": 0
 			}
 		}).res
 	}
@@ -130,7 +129,7 @@
 			#args: {
 				tag:     "trybot"
 				message: string
-				labels: "Code-Review": int
+				labels?: "Code-Review": int
 			}
 			res: "curl -f -s -H \"Content-Type: application/json\" --request POST --data '\(encjson.Marshal(#args))' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review"
 		}
@@ -1111,7 +1110,7 @@
               }
               1: (#struct){
                 name: (string){ "Update Gerrit CL message with starting message" }
-                run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\",\"labels\":{\"Code-Review\":0}}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
+                run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\"}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
                 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" }
               }
             }
@@ -1266,7 +1265,7 @@
         }
         _#startCLBuild(:ci): (#struct){
           name: (string){ "Update Gerrit CL message with starting message" }
-          run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\",\"labels\":{\"Code-Review\":0}}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
+          run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\"}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
         }
         _#failCLBuild(:ci): (#struct){
           if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" }
@@ -1282,13 +1281,10 @@
             #args: (#struct){
               tag: (string){ "trybot" }
               message: (string){ string }
-              labels: (#struct){
-                "Code-Review": (int){ int }
-              }
             }
             res: (_|_){
               // [incomplete] invalid interpolation: cannot convert incomplete value "string" to JSON:
-              //     ./workflows.cue:127:9
+              //     ./workflows.cue:126:9
             }
           }
         }
@@ -1412,7 +1408,7 @@
           _#type(:ci): (string){ string }
           if: (_|_){
             // [incomplete] workflows.1.schema._#dispatchJob.if: invalid interpolation: non-concrete value string (type string):
-            //     ./workflows.cue:140:14
+            //     ./workflows.cue:139:14
           }
         }
         name: (string){ "Repository Dispatch" }
@@ -1745,7 +1741,7 @@
           }
           1: (#struct){
             name: (string){ "Update Gerrit CL message with starting message" }
-            run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\",\"labels\":{\"Code-Review\":0}}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
+            run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\"}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
             if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" }
           }
         }
@@ -1900,7 +1896,7 @@
     }
     _#startCLBuild(:ci): (#struct){
       name: (string){ "Update Gerrit CL message with starting message" }
-      run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\",\"labels\":{\"Code-Review\":0}}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
+      run: (string){ "curl -f -s -H \"Content-Type: application/json\" --request POST --data '{\"tag\":\"trybot\",\"message\":\"Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}\"}' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" }
     }
     _#failCLBuild(:ci): (#struct){
       if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" }
@@ -1916,13 +1912,10 @@
         #args: (#struct){
           tag: (string){ "trybot" }
           message: (string){ string }
-          labels: (#struct){
-            "Code-Review": (int){ int }
-          }
         }
         res: (_|_){
           // [incomplete] invalid interpolation: cannot convert incomplete value "string" to JSON:
-          //     ./workflows.cue:127:9
+          //     ./workflows.cue:126:9
         }
       }
     }
@@ -2043,7 +2036,7 @@
       _#type(:ci): (string){ string }
       if: (_|_){
         // [incomplete] repository_dispatch._#dispatchJob.if: invalid interpolation: non-concrete value string (type string):
-        //     ./workflows.cue:140:14
+        //     ./workflows.cue:139:14
       }
     }
     name: (string){ "Repository Dispatch" }
@@ -2407,7 +2400,7 @@
     name: (string){ "Set go build tags" }
     run: (_|_){
       // [incomplete] _#setGoBuildTags.run: invalid interpolation: non-concrete value string (type string):
-      //     ./workflows.cue:286:10
+      //     ./workflows.cue:285:10
     }
   }
   _#installGo(:ci): (#struct){
@@ -2461,7 +2454,7 @@
   _#cueckooCopybaraImage(:ci): (string){ "cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c" }
   _#copybaraCmd(:ci): (_|_){
     // [incomplete] _#copybaraCmd: invalid interpolation: non-concrete value string (type string):
-    //     ./workflows.cue:353:2
+    //     ./workflows.cue:352:2
     _#cmd(:ci): (string){ string }
   }
   _#copybaraSteps(:ci): (#list){
@@ -2475,7 +2468,7 @@
       name: (string){ string }
       run: (_|_){
         // [incomplete] _#copybaraSteps.1.run: invalid interpolation: non-concrete value string (type string):
-        //     ./workflows.cue:353:2
+        //     ./workflows.cue:352:2
         _#cmd(:ci): (string){ string }
       }
     }
@@ -2595,9 +2588,6 @@
       run: (〈1;_#gerrit〉._#setCodeReview & {
         #args: {
           message: "Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
-          labels: {
-            "Code-Review": 0
-          }
         }
       }).res
     })
@@ -2629,7 +2619,7 @@
         #args: {
           tag: "trybot"
           message: string
-          labels: {
+          labels?: {
             "Code-Review": int
           }
         }
diff --git a/internal/ci/workflows.cue b/internal/ci/workflows.cue
index 3b03ff2..e1ad34d 100644
--- a/internal/ci/workflows.cue
+++ b/internal/ci/workflows.cue
@@ -139,9 +139,6 @@
 		run:  (_#gerrit._#setCodeReview & {
 			#args: {
 				message: "Started the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
-				labels: {
-					"Code-Review": 0
-				}
 			}
 		}).res
 	}
@@ -178,7 +175,7 @@
 			#args: {
 				tag:     "trybot"
 				message: string
-				labels: {
+				labels?: {
 					"Code-Review": int
 				}
 			}