Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
ci: do not unset Code-Review label
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
myitcv committed Mar 29, 2021
1 parent 9b263eb commit 2e934c0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -21,7 +21,7 @@ jobs:
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
Expand Down
5 changes: 2 additions & 3 deletions cmd/cue/cmd/testdata/script/cmd_github.txt
Expand Up @@ -196,7 +196,7 @@ jobs:
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
Expand Down Expand Up @@ -1224,7 +1224,6 @@ test: _#bashWorkflow & {
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
}
Expand Down Expand Up @@ -1254,7 +1253,7 @@ test: _#bashWorkflow & {
#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"
}
Expand Down
36 changes: 13 additions & 23 deletions cue/testdata/eval/github.txtar
Expand Up @@ -100,7 +100,6 @@ test: _#bashWorkflow & {
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
}
Expand Down Expand Up @@ -130,7 +129,7 @@ test: _#bashWorkflow & {
#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"
}
Expand Down Expand Up @@ -1111,7 +1110,7 @@ import "strings"
}
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/') }}" }
}
}
Expand Down Expand Up @@ -1266,7 +1265,7 @@ import "strings"
}
_#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() }}" }
Expand All @@ -1282,13 +1281,10 @@ import "strings"
#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
}
}
}
Expand Down Expand Up @@ -1412,7 +1408,7 @@ import "strings"
_#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" }
Expand Down Expand Up @@ -1745,7 +1741,7 @@ import "strings"
}
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/') }}" }
}
}
Expand Down Expand Up @@ -1900,7 +1896,7 @@ import "strings"
}
_#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() }}" }
Expand All @@ -1916,13 +1912,10 @@ import "strings"
#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
}
}
}
Expand Down Expand Up @@ -2043,7 +2036,7 @@ import "strings"
_#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" }
Expand Down Expand Up @@ -2407,7 +2400,7 @@ import "strings"
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){
Expand Down Expand Up @@ -2461,7 +2454,7 @@ import "strings"
_#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){
Expand All @@ -2475,7 +2468,7 @@ import "strings"
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 }
}
}
Expand Down Expand Up @@ -2595,9 +2588,6 @@ import "strings"
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
})
Expand Down Expand Up @@ -2629,7 +2619,7 @@ import "strings"
#args: {
tag: "trybot"
message: string
labels: {
labels?: {
"Code-Review": int
}
}
Expand Down
5 changes: 1 addition & 4 deletions internal/ci/workflows.cue
Expand Up @@ -139,9 +139,6 @@ test: _#bashWorkflow & {
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
}
Expand Down Expand Up @@ -178,7 +175,7 @@ test: _#bashWorkflow & {
#args: {
tag: "trybot"
message: string
labels: {
labels?: {
"Code-Review": int
}
}
Expand Down

0 comments on commit 2e934c0

Please sign in to comment.