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

Commit

Permalink
ci: set a "trybot" tag for trybot repository dispatch flow
Browse files Browse the repository at this point in the history
This will allow it to be distinguished from the unity reviews.

Change-Id: I5a656b9a94a7b0c1b75cfb48f8c2800dfe36ae11
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8927
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
  • Loading branch information
myitcv committed Mar 10, 2021
1 parent 1347dd4 commit f014c14
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Update Gerrit CL message with starting message
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Started
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 }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
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'
test:
needs: start
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
name: Post any failures for this matrix entry
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
Expand All @@ -98,7 +98,7 @@ jobs:
- name: Write the gitcookies file
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- name: Update Gerrit CL message with success message
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down
12 changes: 7 additions & 5 deletions cmd/cue/cmd/testdata/script/cmd_github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ jobs:
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Update Gerrit CL message with starting message
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Started
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 }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
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'
test:
needs: start
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
name: Post any failures for this matrix entry
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
Expand All @@ -273,7 +273,7 @@ jobs:
- name: Write the gitcookies file
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- name: Update Gerrit CL message with success message
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down Expand Up @@ -1224,6 +1224,7 @@ 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 @@ -1251,8 +1252,9 @@ test: _#bashWorkflow & {
// _#isCLCITestBranch is true
_#setCodeReview: {
#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
Loading

0 comments on commit f014c14

Please sign in to comment.