this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

all: change references from cuelang/cue to cue-lang/cue

Signed-off-by: cueckoo <cueckoo@cuelang.org>

cueckoo 06484a39 20ed9abd

+446 -1043
+1
.github/CODEOWNERS
··· 1 + * @cueckoo
+1 -1
.github/ISSUE_TEMPLATE/bug_report.md
··· 34 34 35 35 For advice on how to create a good reproducer, please see: 36 36 37 - https://github.com/cuelang/cue/wiki/Creating-test-or-performance-reproducers 37 + https://github.com/cue-lang/cue/wiki/Creating-test-or-performance-reproducers 38 38 --> 39 39 40 40
-29
.github/workflows/mirror.yml
··· 1 - # Generated by internal/ci/ci_tool.cue; do not edit 2 - 3 - name: Scheduled repo mirror 4 - on: 5 - schedule: 6 - - cron: '*/30 * * * *' 7 - jobs: 8 - mirror: 9 - runs-on: ubuntu-18.04 10 - defaults: 11 - run: 12 - shell: bash 13 - steps: 14 - - name: Checkout code 15 - uses: actions/checkout@v2 16 - - name: Mirror Gerrit to GitHub 17 - run: |- 18 - cd _scripts 19 - docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 20 - set -eu; \ 21 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 22 - chmod 600 ~/.gitcookies; \ 23 - git config --global user.name cueckoo; \ 24 - git config --global user.email cueckoo@gmail.com; \ 25 - git config --global http.cookiefile \$HOME/.gitcookies; \ 26 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 27 - chmod 600 ~/.git-credentials; \ 28 - java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \ 29 - "
+1 -1
.github/workflows/new_version_triggers.yml
··· 15 15 - name: Rebuild tip.cuelang.org 16 16 run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT 17 17 }} --request POST --data-binary "{\"event_type\": \"Re-test post release of 18 - ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches' 18 + ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 19 19 - name: Trigger unity build 20 20 run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT 21 21 }} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\",
+2 -2
.github/workflows/release.yml
··· 28 28 args: release --rm-dist 29 29 version: v0.155.1 30 30 env: 31 - GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }} 31 + GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} 32 32 docker: 33 33 name: docker 34 34 runs-on: ubuntu-18.04 ··· 47 47 uses: docker/build-push-action@v1 48 48 with: 49 49 tags: ${{ env.CUE_VERSION }},latest 50 - repository: cuelang/cue 50 + repository: cue-lang/cue 51 51 username: ${{ secrets.DOCKER_USERNAME }} 52 52 password: ${{ secrets.DOCKER_PASSWORD }} 53 53 tag_with_ref: false
+10 -48
.github/workflows/repository_dispatch.yml
··· 11 11 shell: bash 12 12 if: ${{ github.event.client_payload.type == 'runtrybot' }} 13 13 steps: 14 + - name: Write netrc file for cueckoo Gerrithub 15 + run: |- 16 + cat <<EOD > ~/.netrc 17 + machine review.gerrithub.io 18 + login cueckoo 19 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 20 + EOD 21 + chmod 600 ~/.netrc 14 22 - name: Trigger trybot 15 23 run: |- 16 24 mkdir tmpgit ··· 19 27 git config user.name cueckoo 20 28 git config user.email cueckoo@gmail.com 21 29 git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)" 22 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 30 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 23 31 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 24 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 25 - mirror: 26 - runs-on: ubuntu-18.04 27 - defaults: 28 - run: 29 - shell: bash 30 - if: ${{ github.event.client_payload.type == 'mirror' }} 31 - steps: 32 - - name: Checkout code 33 - uses: actions/checkout@v2 34 - - name: Mirror Gerrit to GitHub 35 - run: |- 36 - cd _scripts 37 - docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 38 - set -eu; \ 39 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 40 - chmod 600 ~/.gitcookies; \ 41 - git config --global user.name cueckoo; \ 42 - git config --global user.email cueckoo@gmail.com; \ 43 - git config --global http.cookiefile \$HOME/.gitcookies; \ 44 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 45 - chmod 600 ~/.git-credentials; \ 46 - java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \ 47 - " 48 - importpr: 49 - runs-on: ubuntu-18.04 50 - defaults: 51 - run: 52 - shell: bash 53 - if: ${{ github.event.client_payload.type == 'importpr' }} 54 - steps: 55 - - name: Checkout code 56 - uses: actions/checkout@v2 57 - - name: 'Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit' 58 - run: |- 59 - cd _scripts 60 - docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 61 - set -eu; \ 62 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 63 - chmod 600 ~/.gitcookies; \ 64 - git config --global user.name cueckoo; \ 65 - git config --global user.email cueckoo@gmail.com; \ 66 - git config --global http.cookiefile \$HOME/.gitcookies; \ 67 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 68 - chmod 600 ~/.git-credentials; \ 69 - java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github-pr ${{ github.event.client_payload.payload.pr }}; \ 70 - " 32 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}
+36 -32
.github/workflows/test.yml
··· 7 7 - '**' 8 8 tags-ignore: 9 9 - v* 10 + pull_request: {} 10 11 jobs: 11 12 start: 12 13 runs-on: ubuntu-18.04 ··· 15 16 shell: bash 16 17 steps: 17 18 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') }} 18 - name: Write the gitcookies file 19 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 19 + name: Write netrc file for cueckoo Gerrithub 20 + run: |- 21 + cat <<EOD > ~/.netrc 22 + machine review.gerrithub.io 23 + login cueckoo 24 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 25 + EOD 26 + chmod 600 ~/.netrc 20 27 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') }} 21 28 name: Update Gerrit CL message with starting message 22 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started 23 - the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ 24 - github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 29 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 30 + ''{"tag":"trybot","message":"Started the build... see progress at ${{ github.event.repository.html_url 31 + }}/actions/runs/${{ github.run_id }}"}'' https://review.gerrithub.io/a/changes/$(basename 25 32 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 26 33 test: 27 34 needs: start ··· 29 36 fail-fast: false 30 37 matrix: 31 38 go-version: 32 - - 1.14.14 33 - - 1.15.8 34 39 - "1.16" 35 40 os: 36 41 - ubuntu-18.04 37 - - macos-10.15 38 - - windows-2019 39 42 runs-on: ${{ matrix.os }} 40 43 defaults: 41 44 run: 42 45 shell: bash 43 46 steps: 44 - - name: Write the gitcookies file 45 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 47 + - name: Write netrc file for cueckoo Gerrithub 48 + run: |- 49 + cat <<EOD > ~/.netrc 50 + machine review.gerrithub.io 51 + login cueckoo 52 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 53 + EOD 54 + chmod 600 ~/.netrc 46 55 - name: Install Go 47 56 uses: actions/setup-go@v2 48 57 with: ··· 65 74 run: go generate ./... 66 75 - name: Test 67 76 run: go test ./... 68 - - if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') 69 - && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }} 70 - name: Test with -race 71 - run: go test -race ./... 72 77 - name: gorelease check 73 78 run: go run golang.org/x/exp/cmd/gorelease 74 79 - name: Check that git is clean post generate and tests 75 80 run: test -z "$(git status --porcelain)" || (git status; git diff; false) 76 - - if: ${{ github.ref == 'refs/heads/master' }} 77 - name: Pull this commit through the proxy on master 78 - run: |- 79 - v=$(git rev-parse HEAD) 80 - cd $(mktemp -d) 81 - go mod init mod.com 82 - GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v 83 81 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }} 84 82 name: Post any failures for this matrix entry 85 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build 86 - failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url 87 - }}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}'' 88 - -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 83 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 84 + ''{"tag":"trybot","message":"Build failed for ${{ runner.os }}-${{ matrix.go-version 85 + }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id 86 + }} for more details","labels":{"TryBot-Result":-1}}'' https://review.gerrithub.io/a/changes/$(basename 89 87 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 90 88 mark_ci_success: 91 89 runs-on: ubuntu-18.04 ··· 95 93 run: 96 94 shell: bash 97 95 steps: 98 - - name: Write the gitcookies file 99 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 96 + - name: Write netrc file for cueckoo Gerrithub 97 + run: |- 98 + cat <<EOD > ~/.netrc 99 + machine review.gerrithub.io 100 + login cueckoo 101 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 102 + EOD 103 + chmod 600 ~/.netrc 100 104 - name: Update Gerrit CL message with success message 101 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build 102 - succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id 103 - }}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 105 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 106 + ''{"tag":"trybot","message":"Build succeeded for ${{ github.event.repository.html_url 107 + }}/actions/runs/${{ github.run_id }}","labels":{"TryBot-Result":1}}'' https://review.gerrithub.io/a/changes/$(basename 104 108 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 105 109 delete_build_branch: 106 110 runs-on: ubuntu-18.04 ··· 117 121 git config user.name cueckoo 118 122 git config user.email cueckoo@gmail.com 119 123 git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)" 120 - git push https://github.com/cuelang/cue :${GITHUB_REF#refs/heads/} 124 + git push https://github.com/cue-lang/cue :${GITHUB_REF#refs/heads/}
+1 -1
.goreleaser.yml
··· 59 59 commit_author: 60 60 name: cue-bot 61 61 email: noreply@cuelang.org 62 - homepage: "https://github.com/cuelang/cue" 62 + homepage: "https://cuelang.org" 63 63 description: "CUE is an open source data constraint language which aims to simplify tasks involving defining and using data." 64 64 test: | 65 65 system "#{bin}/cue version"
+4 -3
CONTRIBUTING.md
··· 20 20 ## Code reviews 21 21 22 22 All submissions, including submissions by project members, require review. We 23 - use Gerrit code reviews at https://cue-review.googlesource.com for this purpose. 24 - Please read the [Contributing Guide](./doc/contribute.md) 25 - before reading patches. 23 + use [Gerrit code 24 + reviews](https://review.gerrithub.io/q/project:cue-lang%252Fcue) for this 25 + purpose. Please read the [Contributing Guide](./doc/contribute.md) before 26 + reading patches. 26 27 27 28 ## Code of Conduct 28 29
+7 -6
README.md
··· 14 14 limitations under the License. 15 15 --> 16 16 [![Go Reference](https://pkg.go.dev/badge/cuelang.org/go.svg)](https://pkg.go.dev/cuelang.org/go) 17 - [![Github](https://github.com/cuelang/cue/workflows/Test/badge.svg)](https://github.com/cuelang/cue/actions) 18 - [![GolangCI](https://golangci.com/badges/github.com/cuelang/cue.svg)](https://golangci.com/r/github.com/cuelang/cue) 17 + [![Github](https://github.com/cue-lang/cue/workflows/Test/badge.svg)](https://github.com/cue-lang/cue/actions) 18 + [![GolangCI](https://golangci.com/badges/github.com/cue-lang/cue.svg)](https://golangci.com/r/github.com/cue-lang/cue) 19 19 [![Go 1.14+](https://img.shields.io/badge/go-1.14-9cf.svg)](https://golang.org/dl/) 20 20 [![platforms](https://img.shields.io/badge/platforms-linux|windows|macos-inactive.svg)]() 21 21 ··· 95 95 96 96 #### Release builds 97 97 98 - [Download](https://github.com/cuelang/cue/releases) the latest release from GitHub. 98 + [Download](https://github.com/cue-lang/cue/releases) the latest release from GitHub. 99 99 100 100 #### Install using Homebrew 101 101 ··· 146 146 147 147 ### Contributing 148 148 149 - Our canonical Git repository is located at https://cue.googlesource.com. 149 + Our canonical Git repository is located at 150 + https://review.gerrithub.io/q/project:cue-lang%252Fcue. 150 151 151 152 To contribute, please read the [Contribution Guide](./doc/contribute.md). 152 153 153 154 To report issues or make a feature request, use the 154 - [issue tracker](https://github.com/cuelang/cue/issues). 155 + [issue tracker](https://github.com/cue-lang/cue/issues). 155 156 156 157 Changes can be contributed using Gerrit or Github pull requests. 157 158 ··· 160 161 161 162 You can get in touch with the cuelang community in the following ways: 162 163 163 - - Ask questions via [GitHub Discussions](https://github.com/cuelang/cue/discussions) 164 + - Ask questions via [GitHub Discussions](https://github.com/cue-lang/cue/discussions) 164 165 - Chat with us on our 165 166 [Slack workspace](https://join.slack.com/t/cuelang/shared_invite/enQtNzQwODc3NzYzNTA0LTAxNWQwZGU2YWFiOWFiOWQ4MjVjNGQ2ZTNlMmIxODc4MDVjMDg5YmIyOTMyMjQ2MTkzMTU5ZjA1OGE0OGE1NmE). 166 167
-74
_scripts/copy.bara.sky
··· 1 - # Copyright 2021 The CUE Authors 2 - # 3 - # Licensed under the Apache License, Version 2.0 (the "License"); 4 - # you may not use this file except in compliance with the License. 5 - # You may obtain a copy of the License at 6 - # 7 - # http://www.apache.org/licenses/LICENSE-2.0 8 - # 9 - # Unless required by applicable law or agreed to in writing, software 10 - # distributed under the License is distributed on an "AS IS" BASIS, 11 - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 - # See the License for the specific language governing permissions and 13 - # limitations under the License. 14 - 15 - # The copybara configuration for the cuelang/cue repository 16 - # 17 - # When used in conjunction with the cueckoo/copybara Docker image this 18 - # configuration can be run in two modes: 19 - # 20 - # github 21 - # github-pr N 22 - # 23 - # The first mode mirrors Gerrit to GitHub. The second mode imports PR #N from 24 - # GitHub to Gerrit. 25 - # 26 - # See the CUE-defined copybara workflow defined in internal/ci for an example 27 - # of how to pass in Gerrit and GitHub credentials when running an instance of 28 - # the cueckoo/copybara image. 29 - 30 - github_url = "https://github.com/cuelang/cue.git" 31 - gerrit_url = "https://cue-review.googlesource.com/cue" 32 - 33 - origin_github_pr = git.github_pr_origin( 34 - baseline_from_branch = True, 35 - use_merge = True, 36 - url = github_url, 37 - ) 38 - 39 - origin_gerrit = git.origin( 40 - url = gerrit_url, 41 - ref = "master", 42 - ) 43 - 44 - destination_gerrit = git.gerrit_destination( 45 - url = gerrit_url, 46 - fetch = "master", 47 - push_to_refs_for = "master%hashtag=github-pr", 48 - ) 49 - 50 - # Mirror from Gerrit -> GitHub 51 - git.mirror( 52 - name = "github", 53 - origin = gerrit_url, 54 - destination = github_url, 55 - refspecs = ["refs/*"], 56 - prune = False, 57 - ) 58 - 59 - # Import a PR from GitHub to Gerrit 60 - core.workflow( 61 - name = "github-pr", 62 - origin = origin_github_pr, 63 - destination = destination_gerrit, 64 - authoring = authoring.pass_thru("CUE team <no-reply@google.com>"), 65 - transformations = [ 66 - metadata.replace_message( 67 - "${GITHUB_PR_TITLE}\n\n" + 68 - "${GITHUB_PR_BODY}\n\n" + 69 - "Closes #${GITHUB_PR_NUMBER}\n" + 70 - "https://github.com/cuelang/cue/pull/${GITHUB_PR_NUMBER}", 71 - ), 72 - ], 73 - mode = "CHANGE_REQUEST", 74 - )
+96 -164
cmd/cue/cmd/testdata/script/cmd_github.txt
··· 11 11 12 12 # TODO: drop cd when we solve cuelang.org/issue/708 13 13 cd ../../ 14 - cmp .github/workflows/mirror.yml .github/workflows/mirror.yml.golden 15 14 cmp .github/workflows/new_version_triggers.yml .github/workflows/new_version_triggers.yml.golden 16 15 cmp .github/workflows/release.yml .github/workflows/release.yml.golden 17 16 cmp .github/workflows/repository_dispatch.yml .github/workflows/repository_dispatch.yml.golden ··· 26 25 name: Scheduled repo mirror 27 26 on: 28 27 schedule: 29 - - cron: '*/30 * * * *' 28 + - cron: '*/15 * * * *' 30 29 jobs: 31 30 mirror: 32 31 runs-on: ubuntu-18.04 ··· 41 40 cd _scripts 42 41 docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 43 42 set -eu; \ 44 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 45 - chmod 600 ~/.gitcookies; \ 46 43 git config --global user.name cueckoo; \ 47 - git config --global user.email cueckoo@gmail.com; \ 48 - git config --global http.cookiefile \$HOME/.gitcookies; \ 49 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 50 - chmod 600 ~/.git-credentials; \ 44 + git config --global user.email cueckoo@cuelang.org; \ 45 + echo machine github.com login cueckoo password ${{ secrets.CUECKOO_GITHUB_PAT }} >> ~/.netrc; \ 46 + echo machine review.gerrithub.io login cueckoo password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} >> ~/.netrc; \ 47 + chmod 600 ~/.netrc; \ 51 48 java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \ 52 49 " 53 50 -- .github/workflows/new_version_triggers.yml.golden -- ··· 68 65 - name: Rebuild tip.cuelang.org 69 66 run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT 70 67 }} --request POST --data-binary "{\"event_type\": \"Re-test post release of 71 - ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches' 68 + ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 72 69 - name: Trigger unity build 73 70 run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT 74 71 }} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", ··· 105 102 args: release --rm-dist 106 103 version: v0.155.1 107 104 env: 108 - GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }} 105 + GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} 109 106 docker: 110 107 name: docker 111 108 runs-on: ubuntu-18.04 ··· 124 121 uses: docker/build-push-action@v1 125 122 with: 126 123 tags: ${{ env.CUE_VERSION }},latest 127 - repository: cuelang/cue 124 + repository: cue-lang/cue 128 125 username: ${{ secrets.DOCKER_USERNAME }} 129 126 password: ${{ secrets.DOCKER_PASSWORD }} 130 127 tag_with_ref: false ··· 152 149 shell: bash 153 150 if: ${{ github.event.client_payload.type == 'runtrybot' }} 154 151 steps: 152 + - name: Write netrc file for cueckoo Gerrithub 153 + run: |- 154 + cat <<EOD > ~/.netrc 155 + machine review.gerrithub.io 156 + login cueckoo 157 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 158 + EOD 159 + chmod 600 ~/.netrc 155 160 - name: Trigger trybot 156 161 run: |- 157 162 mkdir tmpgit ··· 160 165 git config user.name cueckoo 161 166 git config user.email cueckoo@gmail.com 162 167 git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)" 163 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 168 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 164 169 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 165 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 166 - mirror: 167 - runs-on: ubuntu-18.04 168 - defaults: 169 - run: 170 - shell: bash 171 - if: ${{ github.event.client_payload.type == 'mirror' }} 172 - steps: 173 - - name: Checkout code 174 - uses: actions/checkout@v2 175 - - name: Mirror Gerrit to GitHub 176 - run: |- 177 - cd _scripts 178 - docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 179 - set -eu; \ 180 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 181 - chmod 600 ~/.gitcookies; \ 182 - git config --global user.name cueckoo; \ 183 - git config --global user.email cueckoo@gmail.com; \ 184 - git config --global http.cookiefile \$HOME/.gitcookies; \ 185 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 186 - chmod 600 ~/.git-credentials; \ 187 - java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \ 188 - " 189 - importpr: 190 - runs-on: ubuntu-18.04 191 - defaults: 192 - run: 193 - shell: bash 194 - if: ${{ github.event.client_payload.type == 'importpr' }} 195 - steps: 196 - - name: Checkout code 197 - uses: actions/checkout@v2 198 - - name: 'Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit' 199 - run: |- 200 - cd _scripts 201 - docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c " \ 202 - set -eu; \ 203 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 204 - chmod 600 ~/.gitcookies; \ 205 - git config --global user.name cueckoo; \ 206 - git config --global user.email cueckoo@gmail.com; \ 207 - git config --global http.cookiefile \$HOME/.gitcookies; \ 208 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 209 - chmod 600 ~/.git-credentials; \ 210 - java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github-pr ${{ github.event.client_payload.payload.pr }}; \ 211 - " 170 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 212 171 -- .github/workflows/test.yml.golden -- 213 172 # Generated by internal/ci/ci_tool.cue; do not edit 214 173 ··· 219 178 - '**' 220 179 tags-ignore: 221 180 - v* 181 + pull_request: {} 222 182 jobs: 223 183 start: 224 184 runs-on: ubuntu-18.04 ··· 227 187 shell: bash 228 188 steps: 229 189 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') }} 230 - name: Write the gitcookies file 231 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 190 + name: Write netrc file for cueckoo Gerrithub 191 + run: |- 192 + cat <<EOD > ~/.netrc 193 + machine review.gerrithub.io 194 + login cueckoo 195 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 196 + EOD 197 + chmod 600 ~/.netrc 232 198 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') }} 233 199 name: Update Gerrit CL message with starting message 234 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started 235 - the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{ 236 - github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 200 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 201 + ''{"tag":"trybot","message":"Started the build... see progress at ${{ github.event.repository.html_url 202 + }}/actions/runs/${{ github.run_id }}"}'' https://review.gerrithub.io/a/changes/$(basename 237 203 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 238 204 test: 239 205 needs: start ··· 241 207 fail-fast: false 242 208 matrix: 243 209 go-version: 244 - - 1.14.14 245 - - 1.15.8 246 210 - "1.16" 247 211 os: 248 212 - ubuntu-18.04 249 - - macos-10.15 250 - - windows-2019 251 213 runs-on: ${{ matrix.os }} 252 214 defaults: 253 215 run: 254 216 shell: bash 255 217 steps: 256 - - name: Write the gitcookies file 257 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 218 + - name: Write netrc file for cueckoo Gerrithub 219 + run: |- 220 + cat <<EOD > ~/.netrc 221 + machine review.gerrithub.io 222 + login cueckoo 223 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 224 + EOD 225 + chmod 600 ~/.netrc 258 226 - name: Install Go 259 227 uses: actions/setup-go@v2 260 228 with: ··· 277 245 run: go generate ./... 278 246 - name: Test 279 247 run: go test ./... 280 - - if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') 281 - && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }} 282 - name: Test with -race 283 - run: go test -race ./... 284 248 - name: gorelease check 285 249 run: go run golang.org/x/exp/cmd/gorelease 286 250 - name: Check that git is clean post generate and tests 287 251 run: test -z "$(git status --porcelain)" || (git status; git diff; false) 288 - - if: ${{ github.ref == 'refs/heads/master' }} 289 - name: Pull this commit through the proxy on master 290 - run: |- 291 - v=$(git rev-parse HEAD) 292 - cd $(mktemp -d) 293 - go mod init mod.com 294 - GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v 295 252 - if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }} 296 253 name: Post any failures for this matrix entry 297 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build 298 - failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url 299 - }}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}'' 300 - -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 254 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 255 + ''{"tag":"trybot","message":"Build failed for ${{ runner.os }}-${{ matrix.go-version 256 + }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id 257 + }} for more details","labels":{"TryBot-Result":-1}}'' https://review.gerrithub.io/a/changes/$(basename 301 258 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 302 259 mark_ci_success: 303 260 runs-on: ubuntu-18.04 ··· 307 264 run: 308 265 shell: bash 309 266 steps: 310 - - name: Write the gitcookies file 311 - run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies 267 + - name: Write netrc file for cueckoo Gerrithub 268 + run: |- 269 + cat <<EOD > ~/.netrc 270 + machine review.gerrithub.io 271 + login cueckoo 272 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 273 + EOD 274 + chmod 600 ~/.netrc 312 275 - name: Update Gerrit CL message with success message 313 - run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build 314 - succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id 315 - }}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename 276 + run: 'curl -f -s -n -H "Content-Type: application/json" --request POST --data 277 + ''{"tag":"trybot","message":"Build succeeded for ${{ github.event.repository.html_url 278 + }}/actions/runs/${{ github.run_id }}","labels":{"TryBot-Result":1}}'' https://review.gerrithub.io/a/changes/$(basename 316 279 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review' 317 280 delete_build_branch: 318 281 runs-on: ubuntu-18.04 ··· 329 292 git config user.name cueckoo 330 293 git config user.email cueckoo@gmail.com 331 294 git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)" 332 - git push https://github.com/cuelang/cue :${GITHUB_REF#refs/heads/} 295 + git push https://github.com/cue-lang/cue :${GITHUB_REF#refs/heads/} 333 296 -- .github/workflows/tip_triggers.yml.golden -- 334 297 # Generated by internal/ci/ci_tool.cue; do not edit 335 298 ··· 1188 1151 }, { 1189 1152 file: "new_version_triggers.yml" 1190 1153 schema: new_version_triggers 1191 - }, { 1192 - file: "mirror.yml" 1193 - schema: mirror 1194 1154 }] 1195 1155 test: _#bashWorkflow & { 1196 1156 name: "Test" 1197 - on: push: { 1198 - branches: ["**"] 1199 - "tags-ignore": [_#releaseTagPattern] 1157 + on: { 1158 + push: { 1159 + branches: ["**"] 1160 + "tags-ignore": [_#releaseTagPattern] 1161 + } 1162 + pull_request: {} 1200 1163 } 1201 1164 jobs: { 1202 1165 start: { 1203 1166 "runs-on": _#linuxMachine 1204 1167 steps: [..._ & { 1205 1168 if: "${{ \(_#isCLCITestBranch) }}" 1206 - }] & [_#writeCookiesFile, _#startCLBuild] 1169 + }] & [_#writeNetrcFile, _#startCLBuild] 1207 1170 } 1208 1171 test: { 1209 1172 needs: "start" 1210 1173 strategy: _#testStrategy 1211 1174 "runs-on": "${{ matrix.os }}" 1212 - steps: [_#writeCookiesFile, _#installGo, _#checkoutCode, _#cacheGoModules, _#setGoBuildTags & { 1175 + steps: [_#writeNetrcFile, _#installGo, _#checkoutCode, _#cacheGoModules, _#setGoBuildTags & { 1213 1176 _#tags: "long" 1214 1177 if: "${{ \(_#isMaster) }}" 1215 - }, _#goGenerate, _#goTest, _#goTestRace & { 1216 - if: "${{ \(_#isMaster) || \(_#isCLCITestBranch) && matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)' }}" 1217 - }, _#goReleaseCheck, _#checkGitClean, _#pullThroughProxy, _#failCLBuild] 1178 + }, _#goGenerate, _#goTest, _#goReleaseCheck, _#checkGitClean, _#failCLBuild] 1218 1179 } 1219 1180 mark_ci_success: { 1220 1181 "runs-on": _#linuxMachine 1221 1182 if: "${{ \(_#isCLCITestBranch) }}" 1222 1183 needs: "test" 1223 - steps: [_#writeCookiesFile, _#passCLBuild] 1184 + steps: [_#writeNetrcFile, _#passCLBuild] 1224 1185 } 1225 1186 delete_build_branch: { 1226 1187 "runs-on": _#linuxMachine ··· 1229 1190 steps: [_#step & { 1230 1191 run: """ 1231 1192 \(_#tempCueckooGitDir) 1232 - git push https://github.com/cuelang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 1193 + git push https://github.com/cue-lang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 1233 1194 """ 1234 1195 }] 1235 1196 } ··· 1266 1227 run: (_#gerrit._#setCodeReview & { 1267 1228 #args: { 1268 1229 message: "Build failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} for more details" 1269 - labels: "Code-Review": -1 1230 + labels: "TryBot-Result": -1 1270 1231 } 1271 1232 }).res 1272 1233 } ··· 1275 1236 run: (_#gerrit._#setCodeReview & { 1276 1237 #args: { 1277 1238 message: "Build succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}" 1278 - labels: "Code-Review": 1 1239 + labels: "TryBot-Result": 1 1279 1240 } 1280 1241 }).res 1281 1242 } ··· 1286 1247 #args: { 1287 1248 tag: "trybot" 1288 1249 message: string 1289 - labels?: "Code-Review": int 1250 + labels?: "TryBot-Result": int 1290 1251 } 1291 - res: "\(_#curl) -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" 1252 + res: "\(_#curl) -n -H \"Content-Type: application/json\" --request POST --data '\(encjson.Marshal(#args))' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" 1292 1253 } 1293 1254 } 1294 1255 } 1295 1256 repository_dispatch: _#bashWorkflow & { 1296 1257 // These constants are defined by github.com/cue-sh/tools/cmd/cueckoo 1297 1258 _#runtrybot: "runtrybot" 1298 - _#mirror: "mirror" 1299 - _#importpr: "importpr" 1300 1259 _#unity: "unity" 1301 1260 _#dispatchJob: _#job & { 1302 1261 _#type: string ··· 1305 1264 } 1306 1265 name: "Repository Dispatch" 1307 1266 on: ["repository_dispatch"] 1308 - jobs: { 1309 - "\(_#runtrybot)": _#dispatchJob & { 1310 - _#type: _#runtrybot 1311 - steps: [_#step & { 1312 - name: "Trigger trybot" 1313 - run: """ 1267 + jobs: "\(_#runtrybot)": _#dispatchJob & { 1268 + _#type: _#runtrybot 1269 + steps: [_#writeNetrcFile, _#step & { 1270 + name: "Trigger trybot" 1271 + run: """ 1314 1272 \(_#tempCueckooGitDir) 1315 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 1273 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 1316 1274 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 1317 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 1275 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 1318 1276 """ 1319 - }] 1320 - } 1321 - "\(_#mirror)": _#dispatchJob & { 1322 - _#type: _#mirror 1323 - steps: _#copybaraSteps & { 1324 - _ 1325 - _#name: "Mirror Gerrit to GitHub" 1326 - _#cmd: "github" 1327 - } 1328 - } 1329 - "\(_#importpr)": _#dispatchJob & { 1330 - _#type: _#importpr 1331 - steps: _#copybaraSteps & { 1332 - _ 1333 - _#name: "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" 1334 - _#cmd: "github-pr ${{ github.event.client_payload.payload.pr }}" 1335 - } 1336 - } 1337 - } 1338 - } 1339 - mirror: _#bashWorkflow & { 1340 - name: "Scheduled repo mirror" 1341 - on: schedule: [{ 1342 - cron: "*/30 * * * *" 1343 - }] 1344 - jobs: mirror: { 1345 - "runs-on": _#linuxMachine 1346 - steps: _#copybaraSteps & { 1347 - _ 1348 - _#name: "Mirror Gerrit to GitHub" 1349 - _#cmd: "github" 1350 - } 1277 + }] 1351 1278 } 1352 1279 } 1353 1280 release: _#bashWorkflow & { ··· 1362 1289 with: version: _#latestStableGo 1363 1290 }, _#step & { 1364 1291 name: "Run GoReleaser" 1365 - env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}" 1292 + env: GITHUB_TOKEN: "${{ secrets.CUECKOO_GITHUB_PAT }}" 1366 1293 uses: "goreleaser/goreleaser-action@v2" 1367 1294 with: { 1368 1295 args: "release --rm-dist" ··· 1390 1317 uses: "docker/build-push-action@v1" 1391 1318 with: { 1392 1319 tags: "${{ env.CUE_VERSION }},latest" 1393 - repository: "cuelang/cue" 1320 + repository: "cue-lang/cue" 1394 1321 username: "${{ secrets.DOCKER_USERNAME }}" 1395 1322 password: "${{ secrets.DOCKER_PASSWORD }}" 1396 1323 tag_with_ref: false ··· 1425 1352 "runs-on": _#linuxMachine 1426 1353 steps: [{ 1427 1354 name: "Rebuild tip.cuelang.org" 1428 - run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches" 1355 + run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cue-lang/cuelang.org/dispatches" 1429 1356 }, { 1430 1357 name: "Trigger unity build" 1431 1358 run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Check against CUE ${GITHUB_REF##refs/tags/}\\\", \\\"client_payload\\\": {\\\"type\\\": \\\"unity\\\", \\\"payload\\\": {\\\"versions\\\": \\\"\\\\\\\"${GITHUB_REF##refs/tags/}\\\\\\\"\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" ··· 1457 1384 "fail-fast": false 1458 1385 matrix: { 1459 1386 // Use a stable version of 1.14.x for go generate 1460 - "go-version": [_#codeGenGo, _#latestStableGo, "1.16"] 1461 - os: [_#linuxMachine, _#macosMachine, _#windowsMachine] 1387 + "go-version": ["1.16"] 1388 + os: [_#linuxMachine] 1462 1389 } 1463 1390 } 1464 1391 _#setGoBuildTags: _#step & { ··· 1512 1439 name: "Check that git is clean post generate and tests" 1513 1440 run: "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" 1514 1441 } 1515 - _#writeCookiesFile: _#step & { 1516 - name: "Write the gitcookies file" 1517 - run: "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" 1442 + _#writeNetrcFile: _#step & { 1443 + name: "Write netrc file for cueckoo Gerrithub" 1444 + run: """ 1445 + cat <<EOD > ~/.netrc 1446 + machine review.gerrithub.io 1447 + login cueckoo 1448 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 1449 + EOD 1450 + chmod 600 ~/.netrc 1451 + """ 1518 1452 } 1519 1453 _#branchRefPrefix: "refs/heads/" 1520 1454 _#tempCueckooGitDir: """ ··· 1535 1469 cd _scripts 1536 1470 docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" \(_#cueckooCopybaraImage) bash -c " \\ 1537 1471 \tset -eu; \\ 1538 - \techo \\"${{ secrets.gerritCookie }}\\" > ~/.gitcookies; \\ 1539 - \tchmod 600 ~/.gitcookies; \\ 1540 1472 \tgit config --global user.name cueckoo; \\ 1541 - \tgit config --global user.email cueckoo@gmail.com; \\ 1542 - \tgit config --global http.cookiefile \\$HOME/.gitcookies; \\ 1543 - \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\ 1544 - \tchmod 600 ~/.git-credentials; \\ 1473 + \tgit config --global user.email cueckoo@cuelang.org; \\ 1474 + \techo machine github.com login cueckoo password ${{ secrets.CUECKOO_GITHUB_PAT }} >> ~/.netrc; \\ 1475 + \techo machine review.gerrithub.io login cueckoo password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} >> ~/.netrc; \\ 1476 + \tchmod 600 ~/.netrc; \\ 1545 1477 \tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky \(_#cmd); \\ 1546 1478 \t" 1547 1479 """
+1 -1
cmd/cue/cmd/trim.go
··· 137 137 if k != diff.Identity { 138 138 diff.Print(os.Stdout, script) 139 139 fmt.Println("Aborting trim, output differs after trimming. This is a bug! Use -i to force trim.") 140 - fmt.Println("You can file a bug here: https://github.com/cuelang/cue/issues/new?assignees=&labels=NeedsInvestigation&template=bug_report.md&title=") 140 + fmt.Println("You can file a bug here: https://github.com/cue-lang/cue/issues/new?assignees=&labels=NeedsInvestigation&template=bug_report.md&title=") 141 141 os.Exit(1) 142 142 } 143 143 }
+2 -2
codereview.cfg
··· 1 - gerrit: https://cue-review.googlesource.com/cue 2 - github: https://github.com/cuelang/cue 1 + gerrit: https://review.gerrithub.io/a/cue-lang/cue 2 + github: https://github.com/cue-lang/cue 3 3 cue-unity: https://github.com/cue-sh/unity
+125 -479
cue/testdata/eval/github.txtar
··· 34 34 }, { 35 35 file: "new_version_triggers.yml" 36 36 schema: new_version_triggers 37 - }, { 38 - file: "mirror.yml" 39 - schema: mirror 40 37 }] 41 38 test: _#bashWorkflow & { 42 39 name: "Test" 43 - on: push: { 44 - branches: ["**"] 45 - "tags-ignore": [_#releaseTagPattern] 40 + on: { 41 + push: { 42 + branches: ["**"] 43 + "tags-ignore": [_#releaseTagPattern] 44 + } 45 + pull_request: {} 46 46 } 47 47 jobs: { 48 48 start: { 49 49 "runs-on": _#linuxMachine 50 50 steps: [..._ & { 51 51 if: "${{ \(_#isCLCITestBranch) }}" 52 - }] & [_#writeCookiesFile, _#startCLBuild] 52 + }] & [_#writeNetrcFile, _#startCLBuild] 53 53 } 54 54 test: { 55 55 needs: "start" 56 56 strategy: _#testStrategy 57 57 "runs-on": "${{ matrix.os }}" 58 - steps: [_#writeCookiesFile, _#installGo, _#checkoutCode, _#cacheGoModules, _#setGoBuildTags & { 58 + steps: [_#writeNetrcFile, _#installGo, _#checkoutCode, _#cacheGoModules, _#setGoBuildTags & { 59 59 _#tags: "long" 60 60 if: "${{ \(_#isMaster) }}" 61 - }, _#goGenerate, _#goTest, _#goTestRace & { 62 - if: "${{ \(_#isMaster) || \(_#isCLCITestBranch) && matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)' }}" 63 - }, _#goReleaseCheck, _#checkGitClean, _#pullThroughProxy, _#failCLBuild] 61 + }, _#goGenerate, _#goTest, _#goReleaseCheck, _#checkGitClean, _#failCLBuild] 64 62 } 65 63 mark_ci_success: { 66 64 "runs-on": _#linuxMachine 67 65 if: "${{ \(_#isCLCITestBranch) }}" 68 66 needs: "test" 69 - steps: [_#writeCookiesFile, _#passCLBuild] 67 + steps: [_#writeNetrcFile, _#passCLBuild] 70 68 } 71 69 delete_build_branch: { 72 70 "runs-on": _#linuxMachine ··· 75 73 steps: [_#step & { 76 74 run: """ 77 75 \(_#tempCueckooGitDir) 78 - git push https://github.com/cuelang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 76 + git push https://github.com/cue-lang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 79 77 """ 80 78 }] 81 79 } ··· 112 110 run: (_#gerrit._#setCodeReview & { 113 111 #args: { 114 112 message: "Build failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} for more details" 115 - labels: "Code-Review": -1 113 + labels: "TryBot-Result": -1 116 114 } 117 115 }).res 118 116 } ··· 121 119 run: (_#gerrit._#setCodeReview & { 122 120 #args: { 123 121 message: "Build succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}" 124 - labels: "Code-Review": 1 122 + labels: "TryBot-Result": 1 125 123 } 126 124 }).res 127 125 } ··· 132 130 #args: { 133 131 tag: "trybot" 134 132 message: string 135 - labels?: "Code-Review": int 133 + labels?: "TryBot-Result": int 136 134 } 137 - res: "\(_#curl) -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" 135 + res: "\(_#curl) -n -H \"Content-Type: application/json\" --request POST --data '\(encjson.Marshal(#args))' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" 138 136 } 139 137 } 140 138 } 141 139 repository_dispatch: _#bashWorkflow & { 142 140 // These constants are defined by github.com/cue-sh/tools/cmd/cueckoo 143 141 _#runtrybot: "runtrybot" 144 - _#mirror: "mirror" 145 - _#importpr: "importpr" 146 142 _#unity: "unity" 147 143 _#dispatchJob: _#job & { 148 144 _#type: string ··· 151 147 } 152 148 name: "Repository Dispatch" 153 149 on: ["repository_dispatch"] 154 - jobs: { 155 - "\(_#runtrybot)": _#dispatchJob & { 156 - _#type: _#runtrybot 157 - steps: [_#step & { 158 - name: "Trigger trybot" 159 - run: """ 150 + jobs: "\(_#runtrybot)": _#dispatchJob & { 151 + _#type: _#runtrybot 152 + steps: [_#writeNetrcFile, _#step & { 153 + name: "Trigger trybot" 154 + run: """ 160 155 \(_#tempCueckooGitDir) 161 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 156 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 162 157 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 163 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 158 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 164 159 """ 165 - }] 166 - } 167 - "\(_#mirror)": _#dispatchJob & { 168 - _#type: _#mirror 169 - steps: _#copybaraSteps & { 170 - _ 171 - _#name: "Mirror Gerrit to GitHub" 172 - _#cmd: "github" 173 - } 174 - } 175 - "\(_#importpr)": _#dispatchJob & { 176 - _#type: _#importpr 177 - steps: _#copybaraSteps & { 178 - _ 179 - _#name: "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" 180 - _#cmd: "github-pr ${{ github.event.client_payload.payload.pr }}" 181 - } 182 - } 183 - } 184 - } 185 - mirror: _#bashWorkflow & { 186 - name: "Scheduled repo mirror" 187 - on: schedule: [{ 188 - cron: "*/30 * * * *" 189 - }] 190 - jobs: mirror: { 191 - "runs-on": _#linuxMachine 192 - steps: _#copybaraSteps & { 193 - _ 194 - _#name: "Mirror Gerrit to GitHub" 195 - _#cmd: "github" 196 - } 160 + }] 197 161 } 198 162 } 199 163 release: _#bashWorkflow & { ··· 208 172 with: version: _#latestStableGo 209 173 }, _#step & { 210 174 name: "Run GoReleaser" 211 - env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}" 175 + env: GITHUB_TOKEN: "${{ secrets.CUECKOO_GITHUB_PAT }}" 212 176 uses: "goreleaser/goreleaser-action@v2" 213 177 with: { 214 178 args: "release --rm-dist" ··· 236 200 uses: "docker/build-push-action@v1" 237 201 with: { 238 202 tags: "${{ env.CUE_VERSION }},latest" 239 - repository: "cuelang/cue" 203 + repository: "cue-lang/cue" 240 204 username: "${{ secrets.DOCKER_USERNAME }}" 241 205 password: "${{ secrets.DOCKER_PASSWORD }}" 242 206 tag_with_ref: false ··· 271 235 "runs-on": _#linuxMachine 272 236 steps: [{ 273 237 name: "Rebuild tip.cuelang.org" 274 - run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches" 238 + run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cue-lang/cuelang.org/dispatches" 275 239 }, { 276 240 name: "Trigger unity build" 277 241 run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Check against CUE ${GITHUB_REF##refs/tags/}\\\", \\\"client_payload\\\": {\\\"type\\\": \\\"unity\\\", \\\"payload\\\": {\\\"versions\\\": \\\"\\\\\\\"${GITHUB_REF##refs/tags/}\\\\\\\"\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" ··· 303 267 "fail-fast": false 304 268 matrix: { 305 269 // Use a stable version of 1.14.x for go generate 306 - "go-version": [_#codeGenGo, _#latestStableGo, "1.16"] 307 - os: [_#linuxMachine, _#macosMachine, _#windowsMachine] 270 + "go-version": ["1.16"] 271 + os: [_#linuxMachine] 308 272 } 309 273 } 310 274 _#setGoBuildTags: _#step & { ··· 358 322 name: "Check that git is clean post generate and tests" 359 323 run: "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" 360 324 } 361 - _#writeCookiesFile: _#step & { 362 - name: "Write the gitcookies file" 363 - run: "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" 325 + _#writeNetrcFile: _#step & { 326 + name: "Write netrc file for cueckoo Gerrithub" 327 + run: """ 328 + cat <<EOD > ~/.netrc 329 + machine review.gerrithub.io 330 + login cueckoo 331 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 332 + EOD 333 + chmod 600 ~/.netrc 334 + """ 364 335 } 365 336 _#branchRefPrefix: "refs/heads/" 366 337 _#tempCueckooGitDir: """ ··· 381 352 cd _scripts 382 353 docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" \(_#cueckooCopybaraImage) bash -c " \\ 383 354 \tset -eu; \\ 384 - \techo \\"${{ secrets.gerritCookie }}\\" > ~/.gitcookies; \\ 385 - \tchmod 600 ~/.gitcookies; \\ 386 355 \tgit config --global user.name cueckoo; \\ 387 - \tgit config --global user.email cueckoo@gmail.com; \\ 388 - \tgit config --global http.cookiefile \\$HOME/.gitcookies; \\ 389 - \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\ 390 - \tchmod 600 ~/.git-credentials; \\ 356 + \tgit config --global user.email cueckoo@cuelang.org; \\ 357 + \techo machine github.com login cueckoo password ${{ secrets.CUECKOO_GITHUB_PAT }} >> ~/.netrc; \\ 358 + \techo machine review.gerrithub.io login cueckoo password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} >> ~/.netrc; \\ 359 + \tchmod 600 ~/.netrc; \\ 391 360 \tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky \(_#cmd); \\ 392 361 \t" 393 362 """ ··· 1125 1094 "runs-on": (string){ "ubuntu-18.04" } 1126 1095 steps: (#list){ 1127 1096 0: (#struct){ 1128 - name: (string){ "Write the gitcookies file" } 1129 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1097 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1098 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1130 1099 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" } 1131 1100 } 1132 1101 1: (#struct){ 1133 1102 name: (string){ "Update Gerrit CL message with starting message" } 1134 - 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" } 1103 + run: (string){ "curl -f -s -n -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 }}\"}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1135 1104 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" } 1136 1105 } 1137 1106 } ··· 1147 1116 "fail-fast": (bool){ false } 1148 1117 matrix: (#struct){ 1149 1118 "go-version": (#list){ 1150 - 0: (string){ "1.14.14" } 1151 - 1: (string){ "1.15.8" } 1152 - 2: (string){ "1.16" } 1119 + 0: (string){ "1.16" } 1153 1120 } 1154 1121 os: (#list){ 1155 1122 0: (string){ "ubuntu-18.04" } 1156 - 1: (string){ "macos-10.15" } 1157 - 2: (string){ "windows-2019" } 1158 1123 } 1159 1124 } 1160 1125 } 1161 1126 "runs-on": (string){ "${{ matrix.os }}" } 1162 1127 steps: (#list){ 1163 1128 0: (#struct){ 1164 - name: (string){ "Write the gitcookies file" } 1165 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1129 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1130 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1166 1131 } 1167 1132 1: (#struct){ 1168 1133 name: (string){ "Install Go" } ··· 1201 1166 run: (string){ "go test ./..." } 1202 1167 } 1203 1168 7: (#struct){ 1204 - name: (string){ "Test with -race" } 1205 - run: (string){ "go test -race ./..." } 1206 - if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" } 1207 - } 1208 - 8: (#struct){ 1209 1169 name: (string){ "gorelease check" } 1210 1170 run: (string){ "go run golang.org/x/exp/cmd/gorelease" } 1211 1171 } 1212 - 9: (#struct){ 1172 + 8: (#struct){ 1213 1173 name: (string){ "Check that git is clean post generate and tests" } 1214 1174 run: (string){ "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" } 1215 1175 } 1216 - 10: (#struct){ 1217 - name: (string){ "Pull this commit through the proxy on master" } 1218 - run: (string){ "v=$(git rev-parse HEAD)\ncd $(mktemp -d)\ngo mod init mod.com\nGOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v" } 1219 - if: (string){ "${{ github.ref == 'refs/heads/master' }}" } 1220 - } 1221 - 11: (#struct){ 1176 + 9: (#struct){ 1222 1177 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" } 1223 1178 name: (string){ "Post any failures for this matrix entry" } 1224 - run: (string){ "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 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1179 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":-1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1225 1180 } 1226 1181 } 1227 1182 defaults: (#struct){ ··· 1236 1191 needs: (string){ "test" } 1237 1192 steps: (#list){ 1238 1193 0: (#struct){ 1239 - name: (string){ "Write the gitcookies file" } 1240 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1194 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1195 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1241 1196 } 1242 1197 1: (#struct){ 1243 1198 name: (string){ "Update Gerrit CL message with success message" } 1244 - run: (string){ "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" } 1199 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1245 1200 } 1246 1201 } 1247 1202 defaults: (#struct){ ··· 1256 1211 needs: (string){ "test" } 1257 1212 steps: (#list){ 1258 1213 0: (#struct){ 1259 - run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit push https://github.com/cuelang/cue :${GITHUB_REF#refs/heads/}" } 1214 + run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit push https://github.com/cue-lang/cue :${GITHUB_REF#refs/heads/}" } 1260 1215 } 1261 1216 } 1262 1217 defaults: (#struct){ ··· 1276 1231 0: (string){ "v*" } 1277 1232 } 1278 1233 } 1234 + pull_request: (#struct){ 1235 + } 1279 1236 } 1280 1237 _#isCLCITestBranch(:ci): (string){ "startsWith(github.ref, 'refs/heads/ci/')" } 1281 1238 _#isMaster(:ci): (string){ "github.ref == 'refs/heads/master'" } ··· 1286 1243 } 1287 1244 _#startCLBuild(:ci): (#struct){ 1288 1245 name: (string){ "Update Gerrit CL message with starting message" } 1289 - 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" } 1246 + run: (string){ "curl -f -s -n -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 }}\"}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1290 1247 } 1291 1248 _#failCLBuild(:ci): (#struct){ 1292 1249 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" } 1293 1250 name: (string){ "Post any failures for this matrix entry" } 1294 - run: (string){ "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 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1251 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":-1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1295 1252 } 1296 1253 _#passCLBuild(:ci): (#struct){ 1297 1254 name: (string){ "Update Gerrit CL message with success message" } 1298 - run: (string){ "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" } 1255 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1299 1256 } 1300 1257 _#gerrit(:ci): (#struct){ 1301 1258 _#setCodeReview(:ci): (#struct){ ··· 1305 1262 } 1306 1263 res: (_|_){ 1307 1264 // [incomplete] invalid interpolation: cannot convert incomplete value "string" to JSON: 1308 - // ./workflows.cue:129:9 1265 + // ./workflows.cue:127:9 1309 1266 } 1310 1267 } 1311 1268 } ··· 1359 1316 if: (string){ "${{ github.event.client_payload.type == 'runtrybot' }}" } 1360 1317 steps: (#list){ 1361 1318 0: (#struct){ 1362 - name: (string){ "Trigger trybot" } 1363 - run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }}\ngit checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD\ngit push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" } 1364 - } 1365 - } 1366 - defaults: (#struct){ 1367 - run: (#struct){ 1368 - shell: (string){ "bash" } 1369 - } 1370 - } 1371 - } 1372 - mirror: (#struct){ 1373 - "runs-on": (string){ "ubuntu-18.04" } 1374 - _#type(:ci): (string){ "mirror" } 1375 - if: (string){ "${{ github.event.client_payload.type == 'mirror' }}" } 1376 - steps: (#list){ 1377 - _#name(:ci): (string){ "Mirror Gerrit to GitHub" } 1378 - _#cmd(:ci): (string){ "github" } 1379 - 0: (#struct){ 1380 - name: (string){ "Checkout code" } 1381 - uses: (string){ "actions/checkout@v2" } 1382 - } 1383 - 1: (#struct){ 1384 - name: (string){ "Mirror Gerrit to GitHub" } 1385 - run: (string){ 1386 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \\\n\t\"" 1387 - _#cmd(:ci): (string){ "github" } 1388 - } 1389 - } 1390 - } 1391 - defaults: (#struct){ 1392 - run: (#struct){ 1393 - shell: (string){ "bash" } 1394 - } 1395 - } 1396 - } 1397 - importpr: (#struct){ 1398 - "runs-on": (string){ "ubuntu-18.04" } 1399 - _#type(:ci): (string){ "importpr" } 1400 - if: (string){ "${{ github.event.client_payload.type == 'importpr' }}" } 1401 - steps: (#list){ 1402 - _#name(:ci): (string){ "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" } 1403 - _#cmd(:ci): (string){ "github-pr ${{ github.event.client_payload.payload.pr }}" } 1404 - 0: (#struct){ 1405 - name: (string){ "Checkout code" } 1406 - uses: (string){ "actions/checkout@v2" } 1319 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1320 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1407 1321 } 1408 1322 1: (#struct){ 1409 - name: (string){ "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" } 1410 - run: (string){ 1411 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github-pr ${{ github.event.client_payload.payload.pr }}; \\\n\t\"" 1412 - _#cmd(:ci): (string){ "github-pr ${{ github.event.client_payload.payload.pr }}" } 1413 - } 1323 + name: (string){ "Trigger trybot" } 1324 + run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }}\ngit checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD\ngit push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" } 1414 1325 } 1415 1326 } 1416 1327 defaults: (#struct){ ··· 1421 1332 } 1422 1333 } 1423 1334 _#runtrybot(:ci): (string){ "runtrybot" } 1424 - _#mirror(:ci): (string){ "mirror" } 1425 - _#importpr(:ci): (string){ "importpr" } 1426 1335 _#unity(:ci): (string){ "unity" } 1427 1336 _#dispatchJob(:ci): (#struct){ 1428 1337 "runs-on": (string){ "ubuntu-18.04" } 1429 1338 _#type(:ci): (string){ string } 1430 1339 if: (_|_){ 1431 1340 // [incomplete] workflows.1.schema._#dispatchJob.if: invalid interpolation: non-concrete value string (type string): 1432 - // ./workflows.cue:142:14 1341 + // ./workflows.cue:138:14 1433 1342 } 1434 1343 } 1435 1344 name: (string){ "Repository Dispatch" } ··· 1502 1411 2: (#struct){ 1503 1412 name: (string){ "Run GoReleaser" } 1504 1413 env: (#struct){ 1505 - GITHUB_TOKEN: (string){ "${{ secrets.ACTIONS_GITHUB_TOKEN }}" } 1414 + GITHUB_TOKEN: (string){ "${{ secrets.CUECKOO_GITHUB_PAT }}" } 1506 1415 } 1507 1416 uses: (string){ "goreleaser/goreleaser-action@v2" } 1508 1417 with: (#struct){ ··· 1539 1448 uses: (string){ "docker/build-push-action@v1" } 1540 1449 with: (#struct){ 1541 1450 tags: (string){ "${{ env.CUE_VERSION }},latest" } 1542 - repository: (string){ "cuelang/cue" } 1451 + repository: (string){ "cue-lang/cue" } 1543 1452 username: (string){ "${{ secrets.DOCKER_USERNAME }}" } 1544 1453 password: (string){ "${{ secrets.DOCKER_PASSWORD }}" } 1545 1454 tag_with_ref: (bool){ false } ··· 1686 1595 steps: (#list){ 1687 1596 0: (#struct){ 1688 1597 name: (string){ "Rebuild tip.cuelang.org" } 1689 - run: (string){ "curl -f -s -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches" } 1598 + run: (string){ "curl -f -s -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cue-lang/cuelang.org/dispatches" } 1690 1599 } 1691 1600 1: (#struct){ 1692 1601 name: (string){ "Trigger unity build" } ··· 1710 1619 } 1711 1620 } 1712 1621 } 1713 - 5: (struct){ 1714 - file: (string){ "mirror.yml" } 1715 - schema: (#struct){ 1716 - #architecture: (string){ |((string){ "ARM32" }, (string){ "x64" }, (string){ "x86" }) } 1717 - #branch: (list){ 1718 - 0: (string){ strings.MinRunes(1) } 1719 - } 1720 - #configuration: ((bool|string|list|struct|number)){ |((string){ string }, (number){ number }, (bool){ bool }, (#struct){ 1721 - }, (list){ 1722 - }) } 1723 - #container: (#struct){ 1724 - image: (string){ string } 1725 - } 1726 - #defaults: (#struct){ 1727 - } 1728 - #env: (#struct){ 1729 - } 1730 - #environment: (#struct){ 1731 - name: (string){ string } 1732 - } 1733 - #event: (string){ |((string){ "check_run" }, (string){ "check_suite" }, (string){ "create" }, (string){ "delete" }, (string){ "deployment" }, (string){ "deployment_status" }, (string){ "fork" }, (string){ "gollum" }, (string){ "issue_comment" }, (string){ "issues" }, (string){ "label" }, (string){ "member" }, (string){ "milestone" }, (string){ "page_build" }, (string){ "project" }, (string){ "project_card" }, (string){ "project_column" }, (string){ "public" }, (string){ "pull_request" }, (string){ "pull_request_review" }, (string){ "pull_request_review_comment" }, (string){ "pull_request_target" }, (string){ "push" }, (string){ "registry_package" }, (string){ "release" }, (string){ "status" }, (string){ "watch" }, (string){ "workflow_dispatch" }, (string){ "workflow_run" }, (string){ "repository_dispatch" }) } 1734 - #eventObject: ((null|struct)){ |((null){ null }, (#struct){ 1735 - }) } 1736 - #expressionSyntax: (string){ =~"^\\$\\{\\{.*\\}\\}$" } 1737 - #globs: (list){ 1738 - 0: (string){ strings.MinRunes(1) } 1739 - } 1740 - #machine: (string){ |((string){ "linux" }, (string){ "macos" }, (string){ "windows" }) } 1741 - #name: (string){ =~"^[_a-zA-Z][a-zA-Z0-9_-]*$" } 1742 - #path: (list){ 1743 - 0: (string){ strings.MinRunes(1) } 1744 - } 1745 - #ref: ((null|struct)){ |((null){ null }, (#struct){ 1746 - }) } 1747 - #shell: (string){ |((string){ string }, (string){ "bash" }, (string){ "pwsh" }, (string){ "python" }, (string){ "sh" }, (string){ "cmd" }, (string){ "powershell" }) } 1748 - #types: (list){ 1749 - 0: (_){ _ } 1750 - } 1751 - #: (#struct){ 1752 - "working-directory": (string){ string } 1753 - } 1754 - jobs: (#struct){ 1755 - mirror: (#struct){ 1756 - "runs-on": (string){ "ubuntu-18.04" } 1757 - steps: (#list){ 1758 - _#name(:ci): (string){ "Mirror Gerrit to GitHub" } 1759 - _#cmd(:ci): (string){ "github" } 1760 - 0: (#struct){ 1761 - name: (string){ "Checkout code" } 1762 - uses: (string){ "actions/checkout@v2" } 1763 - } 1764 - 1: (#struct){ 1765 - name: (string){ "Mirror Gerrit to GitHub" } 1766 - run: (string){ 1767 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \\\n\t\"" 1768 - _#cmd(:ci): (string){ "github" } 1769 - } 1770 - } 1771 - } 1772 - defaults: (#struct){ 1773 - run: (#struct){ 1774 - shell: (string){ "bash" } 1775 - } 1776 - } 1777 - } 1778 - } 1779 - name: (string){ "Scheduled repo mirror" } 1780 - on: (#struct){ 1781 - schedule: (#list){ 1782 - 0: (#struct){ 1783 - cron: (string){ "*/30 * * * *" } 1784 - } 1785 - } 1786 - } 1787 - } 1788 - } 1789 1622 } 1790 1623 test: (#struct){ 1791 1624 #architecture: (string){ |((string){ "ARM32" }, (string){ "x64" }, (string){ "x86" }) } ··· 1831 1664 "runs-on": (string){ "ubuntu-18.04" } 1832 1665 steps: (#list){ 1833 1666 0: (#struct){ 1834 - name: (string){ "Write the gitcookies file" } 1835 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1667 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1668 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1836 1669 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" } 1837 1670 } 1838 1671 1: (#struct){ 1839 1672 name: (string){ "Update Gerrit CL message with starting message" } 1840 - 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" } 1673 + run: (string){ "curl -f -s -n -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 }}\"}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1841 1674 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') }}" } 1842 1675 } 1843 1676 } ··· 1853 1686 "fail-fast": (bool){ false } 1854 1687 matrix: (#struct){ 1855 1688 "go-version": (#list){ 1856 - 0: (string){ "1.14.14" } 1857 - 1: (string){ "1.15.8" } 1858 - 2: (string){ "1.16" } 1689 + 0: (string){ "1.16" } 1859 1690 } 1860 1691 os: (#list){ 1861 1692 0: (string){ "ubuntu-18.04" } 1862 - 1: (string){ "macos-10.15" } 1863 - 2: (string){ "windows-2019" } 1864 1693 } 1865 1694 } 1866 1695 } 1867 1696 "runs-on": (string){ "${{ matrix.os }}" } 1868 1697 steps: (#list){ 1869 1698 0: (#struct){ 1870 - name: (string){ "Write the gitcookies file" } 1871 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1699 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1700 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1872 1701 } 1873 1702 1: (#struct){ 1874 1703 name: (string){ "Install Go" } ··· 1907 1736 run: (string){ "go test ./..." } 1908 1737 } 1909 1738 7: (#struct){ 1910 - name: (string){ "Test with -race" } 1911 - run: (string){ "go test -race ./..." } 1912 - if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" } 1913 - } 1914 - 8: (#struct){ 1915 1739 name: (string){ "gorelease check" } 1916 1740 run: (string){ "go run golang.org/x/exp/cmd/gorelease" } 1917 1741 } 1918 - 9: (#struct){ 1742 + 8: (#struct){ 1919 1743 name: (string){ "Check that git is clean post generate and tests" } 1920 1744 run: (string){ "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" } 1921 1745 } 1922 - 10: (#struct){ 1923 - name: (string){ "Pull this commit through the proxy on master" } 1924 - run: (string){ "v=$(git rev-parse HEAD)\ncd $(mktemp -d)\ngo mod init mod.com\nGOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v" } 1925 - if: (string){ "${{ github.ref == 'refs/heads/master' }}" } 1926 - } 1927 - 11: (#struct){ 1746 + 9: (#struct){ 1928 1747 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" } 1929 1748 name: (string){ "Post any failures for this matrix entry" } 1930 - run: (string){ "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 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1749 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":-1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1931 1750 } 1932 1751 } 1933 1752 defaults: (#struct){ ··· 1942 1761 needs: (string){ "test" } 1943 1762 steps: (#list){ 1944 1763 0: (#struct){ 1945 - name: (string){ "Write the gitcookies file" } 1946 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 1764 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1765 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 1947 1766 } 1948 1767 1: (#struct){ 1949 1768 name: (string){ "Update Gerrit CL message with success message" } 1950 - run: (string){ "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" } 1769 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1951 1770 } 1952 1771 } 1953 1772 defaults: (#struct){ ··· 1962 1781 needs: (string){ "test" } 1963 1782 steps: (#list){ 1964 1783 0: (#struct){ 1965 - run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit push https://github.com/cuelang/cue :${GITHUB_REF#refs/heads/}" } 1784 + run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit push https://github.com/cue-lang/cue :${GITHUB_REF#refs/heads/}" } 1966 1785 } 1967 1786 } 1968 1787 defaults: (#struct){ ··· 1982 1801 0: (string){ "v*" } 1983 1802 } 1984 1803 } 1804 + pull_request: (#struct){ 1805 + } 1985 1806 } 1986 1807 _#isCLCITestBranch(:ci): (string){ "startsWith(github.ref, 'refs/heads/ci/')" } 1987 1808 _#isMaster(:ci): (string){ "github.ref == 'refs/heads/master'" } ··· 1992 1813 } 1993 1814 _#startCLBuild(:ci): (#struct){ 1994 1815 name: (string){ "Update Gerrit CL message with starting message" } 1995 - 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" } 1816 + run: (string){ "curl -f -s -n -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 }}\"}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1996 1817 } 1997 1818 _#failCLBuild(:ci): (#struct){ 1998 1819 if: (string){ "${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}" } 1999 1820 name: (string){ "Post any failures for this matrix entry" } 2000 - run: (string){ "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 $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 1821 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":-1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 2001 1822 } 2002 1823 _#passCLBuild(:ci): (#struct){ 2003 1824 name: (string){ "Update Gerrit CL message with success message" } 2004 - run: (string){ "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" } 1825 + run: (string){ "curl -f -s -n -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\":{\"TryBot-Result\":1}}' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" } 2005 1826 } 2006 1827 _#gerrit(:ci): (#struct){ 2007 1828 _#setCodeReview(:ci): (#struct){ ··· 2011 1832 } 2012 1833 res: (_|_){ 2013 1834 // [incomplete] invalid interpolation: cannot convert incomplete value "string" to JSON: 2014 - // ./workflows.cue:129:9 1835 + // ./workflows.cue:127:9 2015 1836 } 2016 1837 } 2017 1838 } ··· 2062 1883 if: (string){ "${{ github.event.client_payload.type == 'runtrybot' }}" } 2063 1884 steps: (#list){ 2064 1885 0: (#struct){ 2065 - name: (string){ "Trigger trybot" } 2066 - run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }}\ngit checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD\ngit push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" } 2067 - } 2068 - } 2069 - defaults: (#struct){ 2070 - run: (#struct){ 2071 - shell: (string){ "bash" } 2072 - } 2073 - } 2074 - } 2075 - mirror: (#struct){ 2076 - "runs-on": (string){ "ubuntu-18.04" } 2077 - _#type(:ci): (string){ "mirror" } 2078 - if: (string){ "${{ github.event.client_payload.type == 'mirror' }}" } 2079 - steps: (#list){ 2080 - _#name(:ci): (string){ "Mirror Gerrit to GitHub" } 2081 - _#cmd(:ci): (string){ "github" } 2082 - 0: (#struct){ 2083 - name: (string){ "Checkout code" } 2084 - uses: (string){ "actions/checkout@v2" } 1886 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 1887 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 2085 1888 } 2086 1889 1: (#struct){ 2087 - name: (string){ "Mirror Gerrit to GitHub" } 2088 - run: (string){ 2089 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \\\n\t\"" 2090 - _#cmd(:ci): (string){ "github" } 2091 - } 2092 - } 2093 - } 2094 - defaults: (#struct){ 2095 - run: (#struct){ 2096 - shell: (string){ "bash" } 2097 - } 2098 - } 2099 - } 2100 - importpr: (#struct){ 2101 - "runs-on": (string){ "ubuntu-18.04" } 2102 - _#type(:ci): (string){ "importpr" } 2103 - if: (string){ "${{ github.event.client_payload.type == 'importpr' }}" } 2104 - steps: (#list){ 2105 - _#name(:ci): (string){ "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" } 2106 - _#cmd(:ci): (string){ "github-pr ${{ github.event.client_payload.payload.pr }}" } 2107 - 0: (#struct){ 2108 - name: (string){ "Checkout code" } 2109 - uses: (string){ "actions/checkout@v2" } 2110 - } 2111 - 1: (#struct){ 2112 - name: (string){ "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" } 2113 - run: (string){ 2114 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github-pr ${{ github.event.client_payload.payload.pr }}; \\\n\t\"" 2115 - _#cmd(:ci): (string){ "github-pr ${{ github.event.client_payload.payload.pr }}" } 2116 - } 1890 + name: (string){ "Trigger trybot" } 1891 + run: (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"\ngit fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }}\ngit checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD\ngit push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" } 2117 1892 } 2118 1893 } 2119 1894 defaults: (#struct){ ··· 2124 1899 } 2125 1900 } 2126 1901 _#runtrybot(:ci): (string){ "runtrybot" } 2127 - _#mirror(:ci): (string){ "mirror" } 2128 - _#importpr(:ci): (string){ "importpr" } 2129 1902 _#unity(:ci): (string){ "unity" } 2130 1903 _#dispatchJob(:ci): (#struct){ 2131 1904 "runs-on": (string){ "ubuntu-18.04" } 2132 1905 _#type(:ci): (string){ string } 2133 1906 if: (_|_){ 2134 1907 // [incomplete] repository_dispatch._#dispatchJob.if: invalid interpolation: non-concrete value string (type string): 2135 - // ./workflows.cue:142:14 1908 + // ./workflows.cue:138:14 2136 1909 } 2137 1910 } 2138 1911 name: (string){ "Repository Dispatch" } ··· 2140 1913 0: (string){ "repository_dispatch" } 2141 1914 } 2142 1915 } 2143 - mirror: (#struct){ 2144 - #architecture: (string){ |((string){ "ARM32" }, (string){ "x64" }, (string){ "x86" }) } 2145 - #branch: (list){ 2146 - 0: (string){ strings.MinRunes(1) } 2147 - } 2148 - #configuration: ((bool|string|list|struct|number)){ |((string){ string }, (number){ number }, (bool){ bool }, (#struct){ 2149 - }, (list){ 2150 - }) } 2151 - #container: (#struct){ 2152 - image: (string){ string } 2153 - } 2154 - #defaults: (#struct){ 2155 - } 2156 - #env: (#struct){ 2157 - } 2158 - #environment: (#struct){ 2159 - name: (string){ string } 2160 - } 2161 - #event: (string){ |((string){ "check_run" }, (string){ "check_suite" }, (string){ "create" }, (string){ "delete" }, (string){ "deployment" }, (string){ "deployment_status" }, (string){ "fork" }, (string){ "gollum" }, (string){ "issue_comment" }, (string){ "issues" }, (string){ "label" }, (string){ "member" }, (string){ "milestone" }, (string){ "page_build" }, (string){ "project" }, (string){ "project_card" }, (string){ "project_column" }, (string){ "public" }, (string){ "pull_request" }, (string){ "pull_request_review" }, (string){ "pull_request_review_comment" }, (string){ "pull_request_target" }, (string){ "push" }, (string){ "registry_package" }, (string){ "release" }, (string){ "status" }, (string){ "watch" }, (string){ "workflow_dispatch" }, (string){ "workflow_run" }, (string){ "repository_dispatch" }) } 2162 - #eventObject: ((null|struct)){ |((null){ null }, (#struct){ 2163 - }) } 2164 - #expressionSyntax: (string){ =~"^\\$\\{\\{.*\\}\\}$" } 2165 - #globs: (list){ 2166 - 0: (string){ strings.MinRunes(1) } 2167 - } 2168 - #machine: (string){ |((string){ "linux" }, (string){ "macos" }, (string){ "windows" }) } 2169 - #name: (string){ =~"^[_a-zA-Z][a-zA-Z0-9_-]*$" } 2170 - #path: (list){ 2171 - 0: (string){ strings.MinRunes(1) } 2172 - } 2173 - #ref: ((null|struct)){ |((null){ null }, (#struct){ 2174 - }) } 2175 - #shell: (string){ |((string){ string }, (string){ "bash" }, (string){ "pwsh" }, (string){ "python" }, (string){ "sh" }, (string){ "cmd" }, (string){ "powershell" }) } 2176 - #types: (list){ 2177 - 0: (_){ _ } 2178 - } 2179 - #: (#struct){ 2180 - "working-directory": (string){ string } 2181 - } 2182 - jobs: (#struct){ 2183 - mirror: (#struct){ 2184 - "runs-on": (string){ "ubuntu-18.04" } 2185 - steps: (#list){ 2186 - _#name(:ci): (string){ "Mirror Gerrit to GitHub" } 2187 - _#cmd(:ci): (string){ "github" } 2188 - 0: (#struct){ 2189 - name: (string){ "Checkout code" } 2190 - uses: (string){ "actions/checkout@v2" } 2191 - } 2192 - 1: (#struct){ 2193 - name: (string){ "Mirror Gerrit to GitHub" } 2194 - run: (string){ 2195 - "cd _scripts\ndocker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint=\"\" cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c bash -c \" \\\n\tset -eu; \\\n\techo \\\"${{ secrets.gerritCookie }}\\\" > ~/.gitcookies; \\\n\tchmod 600 ~/.gitcookies; \\\n\tgit config --global user.name cueckoo; \\\n\tgit config --global user.email cueckoo@gmail.com; \\\n\tgit config --global http.cookiefile \\$HOME/.gitcookies; \\\n \techo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \\\n\tchmod 600 ~/.git-credentials; \\\n\tjava -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky github; \\\n\t\"" 2196 - _#cmd(:ci): (string){ "github" } 2197 - } 2198 - } 2199 - } 2200 - defaults: (#struct){ 2201 - run: (#struct){ 2202 - shell: (string){ "bash" } 2203 - } 2204 - } 2205 - } 2206 - } 2207 - name: (string){ "Scheduled repo mirror" } 2208 - on: (#struct){ 2209 - schedule: (#list){ 2210 - 0: (#struct){ 2211 - cron: (string){ "*/30 * * * *" } 2212 - } 2213 - } 2214 - } 2215 - } 2216 1916 release: (#struct){ 2217 1917 #architecture: (string){ |((string){ "ARM32" }, (string){ "x64" }, (string){ "x86" }) } 2218 1918 #branch: (list){ ··· 2275 1975 2: (#struct){ 2276 1976 name: (string){ "Run GoReleaser" } 2277 1977 env: (#struct){ 2278 - GITHUB_TOKEN: (string){ "${{ secrets.ACTIONS_GITHUB_TOKEN }}" } 1978 + GITHUB_TOKEN: (string){ "${{ secrets.CUECKOO_GITHUB_PAT }}" } 2279 1979 } 2280 1980 uses: (string){ "goreleaser/goreleaser-action@v2" } 2281 1981 with: (#struct){ ··· 2312 2012 uses: (string){ "docker/build-push-action@v1" } 2313 2013 with: (#struct){ 2314 2014 tags: (string){ "${{ env.CUE_VERSION }},latest" } 2315 - repository: (string){ "cuelang/cue" } 2015 + repository: (string){ "cue-lang/cue" } 2316 2016 username: (string){ "${{ secrets.DOCKER_USERNAME }}" } 2317 2017 password: (string){ "${{ secrets.DOCKER_PASSWORD }}" } 2318 2018 tag_with_ref: (bool){ false } ··· 2453 2153 steps: (#list){ 2454 2154 0: (#struct){ 2455 2155 name: (string){ "Rebuild tip.cuelang.org" } 2456 - run: (string){ "curl -f -s -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches" } 2156 + run: (string){ "curl -f -s -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cue-lang/cuelang.org/dispatches" } 2457 2157 } 2458 2158 1: (#struct){ 2459 2159 name: (string){ "Trigger unity build" } ··· 2552 2252 "fail-fast": (bool){ false } 2553 2253 matrix: (#struct){ 2554 2254 "go-version": (#list){ 2555 - 0: (string){ "1.14.14" } 2556 - 1: (string){ "1.15.8" } 2557 - 2: (string){ "1.16" } 2255 + 0: (string){ "1.16" } 2558 2256 } 2559 2257 os: (#list){ 2560 2258 0: (string){ "ubuntu-18.04" } 2561 - 1: (string){ "macos-10.15" } 2562 - 2: (string){ "windows-2019" } 2563 2259 } 2564 2260 } 2565 2261 } ··· 2568 2264 name: (string){ "Set go build tags" } 2569 2265 run: (_|_){ 2570 2266 // [incomplete] _#setGoBuildTags.run: invalid interpolation: non-concrete value string (type string): 2571 - // ./workflows.cue:305:10 2267 + // ./workflows.cue:269:10 2572 2268 } 2573 2269 } 2574 2270 _#installGo(:ci): (#struct){ ··· 2613 2309 name: (string){ "Check that git is clean post generate and tests" } 2614 2310 run: (string){ "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" } 2615 2311 } 2616 - _#writeCookiesFile(:ci): (#struct){ 2617 - name: (string){ "Write the gitcookies file" } 2618 - run: (string){ "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" } 2312 + _#writeNetrcFile(:ci): (#struct){ 2313 + name: (string){ "Write netrc file for cueckoo Gerrithub" } 2314 + run: (string){ "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" } 2619 2315 } 2620 2316 _#branchRefPrefix(:ci): (string){ "refs/heads/" } 2621 2317 _#tempCueckooGitDir(:ci): (string){ "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"" } 2622 2318 _#cueckooCopybaraImage(:ci): (string){ "cueckoo/copybara:afc4ae03eed00b0c9d7415141cd1b5dfa583da7c" } 2623 2319 _#copybaraCmd(:ci): (_|_){ 2624 2320 // [incomplete] _#copybaraCmd: invalid interpolation: non-concrete value string (type string): 2625 - // ./workflows.cue:372:2 2321 + // ./workflows.cue:343:2 2626 2322 _#cmd(:ci): (string){ string } 2627 2323 } 2628 2324 _#copybaraSteps(:ci): (#list){ ··· 2636 2332 name: (string){ string } 2637 2333 run: (_|_){ 2638 2334 // [incomplete] _#copybaraSteps.1.run: invalid interpolation: non-concrete value string (type string): 2639 - // ./workflows.cue:372:2 2335 + // ./workflows.cue:343:2 2640 2336 _#cmd(:ci): (string){ string } 2641 2337 } 2642 2338 } ··· 2675 2371 file: "new_version_triggers.yml" 2676 2372 schema: 〈1;new_version_triggers〉 2677 2373 }, 2678 - { 2679 - file: "mirror.yml" 2680 - schema: 〈1;mirror〉 2681 - }, 2682 2374 ]) 2683 2375 test: (〈0;_#bashWorkflow〉 & { 2684 2376 name: "Test" ··· 2691 2383 〈3;_#releaseTagPattern〉, 2692 2384 ] 2693 2385 } 2386 + pull_request: {} 2694 2387 } 2695 2388 jobs: { 2696 2389 start: { ··· 2700 2393 if: "${{ \(〈3;_#isCLCITestBranch〉) }}" 2701 2394 }), 2702 2395 ] & [ 2703 - 〈3;_#writeCookiesFile〉, 2396 + 〈3;_#writeNetrcFile〉, 2704 2397 〈2;_#startCLBuild〉, 2705 2398 ]) 2706 2399 } ··· 2709 2402 strategy: 〈3;_#testStrategy〉 2710 2403 "runs-on": "${{ matrix.os }}" 2711 2404 steps: [ 2712 - 〈3;_#writeCookiesFile〉, 2405 + 〈3;_#writeNetrcFile〉, 2713 2406 〈3;_#installGo〉, 2714 2407 〈3;_#checkoutCode〉, 2715 2408 〈3;_#cacheGoModules〉, ··· 2719 2412 }), 2720 2413 〈3;_#goGenerate〉, 2721 2414 〈3;_#goTest〉, 2722 - (〈3;_#goTestRace〉 & { 2723 - if: "${{ \(〈3;_#isMaster〉) || \(〈3;_#isCLCITestBranch〉) && matrix.go-version == '\(〈4;_#latestStableGo〉)' && matrix.os == '\(〈4;_#linuxMachine〉)' }}" 2724 - }), 2725 2415 〈3;_#goReleaseCheck〉, 2726 2416 〈3;_#checkGitClean〉, 2727 - 〈2;_#pullThroughProxy〉, 2728 2417 〈2;_#failCLBuild〉, 2729 2418 ] 2730 2419 } ··· 2733 2422 if: "${{ \(〈2;_#isCLCITestBranch〉) }}" 2734 2423 needs: "test" 2735 2424 steps: [ 2736 - 〈3;_#writeCookiesFile〉, 2425 + 〈3;_#writeNetrcFile〉, 2737 2426 〈2;_#passCLBuild〉, 2738 2427 ] 2739 2428 } ··· 2744 2433 steps: [ 2745 2434 (〈3;_#step〉 & { 2746 2435 run: "\(〈4;_#tempCueckooGitDir〉) 2747 - git push https://github.com/cuelang/cue :${GITHUB_REF#\(〈4;_#branchRefPrefix〉)}" 2436 + git push https://github.com/cue-lang/cue :${GITHUB_REF#\(〈4;_#branchRefPrefix〉)}" 2748 2437 }), 2749 2438 ] 2750 2439 } ··· 2771 2460 #args: { 2772 2461 message: "Build failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} for more details" 2773 2462 labels: { 2774 - "Code-Review": -1 2463 + "TryBot-Result": -1 2775 2464 } 2776 2465 } 2777 2466 }).res ··· 2782 2471 #args: { 2783 2472 message: "Build succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}" 2784 2473 labels: { 2785 - "Code-Review": 1 2474 + "TryBot-Result": 1 2786 2475 } 2787 2476 } 2788 2477 }).res ··· 2793 2482 tag: "trybot" 2794 2483 message: string 2795 2484 labels?: { 2796 - "Code-Review": int 2485 + "TryBot-Result": int 2797 2486 } 2798 2487 } 2799 - res: "\(〈3;_#curl〉) -H "Content-Type: application/json" --request POST --data '\(〈import;"encoding/json"〉.Marshal(〈0;#args〉))' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" 2488 + res: "\(〈3;_#curl〉) -n -H "Content-Type: application/json" --request POST --data '\(〈import;"encoding/json"〉.Marshal(〈0;#args〉))' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review" 2800 2489 } 2801 2490 } 2802 2491 }) 2803 2492 repository_dispatch: (〈0;_#bashWorkflow〉 & { 2804 2493 _#runtrybot: "runtrybot" 2805 - _#mirror: "mirror" 2806 - _#importpr: "importpr" 2807 2494 _#unity: "unity" 2808 2495 _#dispatchJob: (〈1;_#job〉 & { 2809 2496 _#type: string ··· 2818 2505 "\(〈1;_#runtrybot〉)": (〈1;_#dispatchJob〉 & { 2819 2506 _#type: 〈2;_#runtrybot〉 2820 2507 steps: [ 2508 + 〈3;_#writeNetrcFile〉, 2821 2509 (〈3;_#step〉 & { 2822 2510 name: "Trigger trybot" 2823 2511 run: "\(〈4;_#tempCueckooGitDir〉) 2824 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 2512 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 2825 2513 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 2826 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" 2514 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}" 2827 2515 }), 2828 2516 ] 2829 2517 }) 2830 - "\(〈1;_#mirror〉)": (〈1;_#dispatchJob〉 & { 2831 - _#type: 〈2;_#mirror〉 2832 - steps: (〈3;_#copybaraSteps〉 & { 2833 - _ 2834 - _#name: "Mirror Gerrit to GitHub" 2835 - _#cmd: "github" 2836 - }) 2837 - }) 2838 - "\(〈1;_#importpr〉)": (〈1;_#dispatchJob〉 & { 2839 - _#type: 〈2;_#importpr〉 2840 - steps: (〈3;_#copybaraSteps〉 & { 2841 - _ 2842 - _#name: "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" 2843 - _#cmd: "github-pr ${{ github.event.client_payload.payload.pr }}" 2844 - }) 2845 - }) 2846 - } 2847 - }) 2848 - mirror: (〈0;_#bashWorkflow〉 & { 2849 - name: "Scheduled repo mirror" 2850 - on: { 2851 - schedule: [ 2852 - { 2853 - cron: "*/30 * * * *" 2854 - }, 2855 - ] 2856 - } 2857 - jobs: { 2858 - mirror: { 2859 - "runs-on": 〈3;_#linuxMachine〉 2860 - steps: (〈3;_#copybaraSteps〉 & { 2861 - _ 2862 - _#name: "Mirror Gerrit to GitHub" 2863 - _#cmd: "github" 2864 - }) 2865 - } 2866 2518 } 2867 2519 }) 2868 2520 release: (〈0;_#bashWorkflow〉 & { ··· 2891 2543 (〈3;_#step〉 & { 2892 2544 name: "Run GoReleaser" 2893 2545 env: { 2894 - GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}" 2546 + GITHUB_TOKEN: "${{ secrets.CUECKOO_GITHUB_PAT }}" 2895 2547 } 2896 2548 uses: "goreleaser/goreleaser-action@v2" 2897 2549 with: { ··· 2920 2572 uses: "docker/build-push-action@v1" 2921 2573 with: { 2922 2574 tags: "${{ env.CUE_VERSION }},latest" 2923 - repository: "cuelang/cue" 2575 + repository: "cue-lang/cue" 2924 2576 username: "${{ secrets.DOCKER_USERNAME }}" 2925 2577 password: "${{ secrets.DOCKER_PASSWORD }}" 2926 2578 tag_with_ref: false ··· 2975 2627 steps: [ 2976 2628 { 2977 2629 name: "Rebuild tip.cuelang.org" 2978 - run: "\(〈4;_#curl〉) -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary "{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches" 2630 + run: "\(〈4;_#curl〉) -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary "{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches" 2979 2631 }, 2980 2632 { 2981 2633 name: "Trigger unity build" ··· 3013 2665 "fail-fast": false 3014 2666 matrix: { 3015 2667 "go-version": [ 3016 - 〈2;_#codeGenGo〉, 3017 - 〈2;_#latestStableGo〉, 3018 2668 "1.16", 3019 2669 ] 3020 2670 os: [ 3021 2671 〈2;_#linuxMachine〉, 3022 - 〈2;_#macosMachine〉, 3023 - 〈2;_#windowsMachine〉, 3024 2672 ] 3025 2673 } 3026 2674 } ··· 3071 2719 name: "Check that git is clean post generate and tests" 3072 2720 run: "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" 3073 2721 }) 3074 - _#writeCookiesFile: (〈0;_#step〉 & { 3075 - name: "Write the gitcookies file" 3076 - run: "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" 2722 + _#writeNetrcFile: (〈0;_#step〉 & { 2723 + name: "Write netrc file for cueckoo Gerrithub" 2724 + run: "cat <<EOD > ~/.netrc\nmachine review.gerrithub.io\nlogin cueckoo\npassword ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}\nEOD\nchmod 600 ~/.netrc" 3077 2725 }) 3078 2726 _#branchRefPrefix: "refs/heads/" 3079 2727 _#tempCueckooGitDir: "mkdir tmpgit\ncd tmpgit\ngit init\ngit config user.name cueckoo\ngit config user.email cueckoo@gmail.com\ngit config http.https://github.com/.extraheader \"AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)\"" ··· 3082 2730 "cd _scripts 3083 2731 docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" \(〈1;_#cueckooCopybaraImage〉) bash -c " \ 3084 2732 set -eu; \ 3085 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 3086 - chmod 600 ~/.gitcookies; \ 3087 2733 git config --global user.name cueckoo; \ 3088 - git config --global user.email cueckoo@gmail.com; \ 3089 - git config --global http.cookiefile \$HOME/.gitcookies; \ 3090 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 3091 - chmod 600 ~/.git-credentials; \ 2734 + git config --global user.email cueckoo@cuelang.org; \ 2735 + echo machine github.com login cueckoo password ${{ secrets.CUECKOO_GITHUB_PAT }} >> ~/.netrc; \ 2736 + echo machine review.gerrithub.io login cueckoo password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} >> ~/.netrc; \ 2737 + chmod 600 ~/.netrc; \ 3092 2738 java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky \(〈0;_#cmd〉); \ 3093 2739 "" 3094 2740 _#cmd: string
+1 -1
cue/types.go
··· 989 989 %v 990 990 991 991 You could file a bug with the above information at: 992 - https://github.com/cuelang/cue/issues/new?assignees=&labels=NeedsInvestigation&template=bug_report.md&title=. 992 + https://github.com/cue-lang/cue/issues/new?assignees=&labels=NeedsInvestigation&template=bug_report.md&title=. 993 993 ` 994 994 cg := &ast.CommentGroup{Doc: true} 995 995 msg := fmt.Sprintf(format, name, err, p, v)
+1 -1
doc/cmd/cue.md
··· 6 6 describes the `cue` command's support for various file types. 7 7 8 8 We do plan to provide a web-based version of these various help topics, 9 - something that is tracked by [#9](https://github.com/cuelang/cue/issues/9). 9 + something that is tracked by [#9](https://cuelang.org/issue/9).
+110 -128
doc/contribute.md
··· 16 16 The first step is registering as a CUE contributor and configuring your environment. 17 17 Here is a checklist of the required steps to follow: 18 18 19 - 20 - - **Step 0**: Decide on a single Google Account you will be using to contribute to CUE. 21 - Use that account for all the following steps and make sure that `git` 22 - is configured to create commits with that account's e-mail address. 23 - - **Step 1**: [Sign and submit](https://cla.developers.google.com/clas) a 24 - CLA (Contributor License Agreement). 25 - - **Step 2**: Configure authentication credentials for the CUE Git repository. 26 - Visit 27 - [cue.googlesource.com](https://cue.googlesource.com), click 28 - on "Generate Password" (top right), and follow the instructions. 29 - - **Step 3**: Register for Gerrit, the code review tool used by the CUE team, 30 - by [visiting this page](https://cue-review.googlesource.com/login/). 31 - The CLA and the registration need to be done only once for your account. 32 - - **Step 4**: Install `git-codereview` by running: `GO111MODULE=on go get 19 + - **Step 0**: Decide which email address you want to use for contributions. 20 + - **Step 1**: Read and prepare for asserting a Developer Certificate of Origin. 21 + - **Step 2**: Set up a [GerritHub](http://gerrithub.io/) account. 22 + - **Step 3**: Install `git-codereview` by running: `GO111MODULE=on go get 33 23 golang.org/x/review/git-codereview` (or just `go install 34 24 golang.org/x/review/git-codereview@latest` if you are using Go 1.16) 35 25 36 - <!-- Keep the above steps in sync with cmd/cue/cmd/testdata/script/contributing_install*.txt --> 37 - 38 - 39 - <!-- TODO 40 - If you prefer, there is an automated tool that walks through these steps. 41 - Just run: 42 - 43 - 44 - ``` 45 - $ go get -u cuelang.org/x/tools/cmd/cue-contrib-init 46 - $ cd /code/to/edit 47 - $ cue-contrib-init 48 - ``` 49 - ---> 26 + Note that if you plan to contribute via GitHub, only Steps 0 and 1 are required. 50 27 51 - The rest of this chapter elaborates on these instructions. 52 - If you have completed the steps above (either manually or through the tool), jump to 53 - Before contributing code. 28 + The rest of this chapter elaborates on these instructions. If you have 29 + completed the steps above (either manually or through the tool), jump to "Before 30 + contributing code." 54 31 55 - 56 - ### Step 0: Select a Google Account 57 - 58 - A contribution to CUE is made through a Google account with a specific 59 - e-mail address. 60 - Make sure to use the same account throughout the process and 61 - for all your subsequent contributions. 62 - You may need to decide whether to use a personal address or a corporate address. 63 - The choice will depend on who 64 - will own the copyright for the code that you will be writing 65 - and submitting. 66 - You might want to discuss this topic with your employer before deciding which 67 - account to use. 32 + ### Step 0: Decide which email address you want to use for contributions 68 33 69 - 70 - Google accounts can either be Gmail e-mail accounts, G Suite organization accounts, or 71 - accounts associated with an external e-mail address. 72 - For instance, if you need to use 73 - an existing corporate e-mail that is not managed through G Suite, you can create 74 - an account associated 75 - [with your existing 76 - e-mail address](https://accounts.google.com/SignUpWithoutGmail). 77 - 34 + A contribution to CUE is made through a specific e-mail address. Make sure to 35 + use the same account throughout the process and for all your subsequent 36 + contributions. You may need to decide whether to use a personal address or a 37 + corporate address. The choice will depend on who will own the copyright for the 38 + code that you will be writing and submitting. You might want to discuss this 39 + topic with your employer before deciding which account to use. 78 40 79 41 You also need to make sure that your Git tool is configured to create commits 80 - using your chosen e-mail address. 81 - You can either configure Git globally 82 - (as a default for all projects), or locally (for a single specific project). 83 - You can check the current configuration with this command: 42 + using your chosen e-mail address. You can either configure Git globally (as a 43 + default for all projects), or locally (for a single specific project). You can 44 + check the current configuration with this command: 84 45 85 46 86 47 ``` ··· 96 57 $ git config user.email name@example.com # change local config 97 58 ``` 98 59 60 + If the copyright holder for the code you are submitting changes&mdash;for 61 + example, if you start contributing code on behalf of a new company&mdash;please 62 + send mail to the [CUE Owners](mailto:owners@cuelang.org). This will let us know 63 + the situation so we can make sure an appropriate agreement is completed and 64 + update the `AUTHORS` file. 99 65 100 - ### Step 1: Contributor License Agreement 66 + ### Step 1: Read and prepare for asserting a Developer Certificate of Origin 101 67 102 - Before sending your first change to the CUE project 103 - you must have completed one of the following two CLAs. 104 - Which CLA you should sign depends on who owns the copyright to your work. 68 + Contributions to the CUE project must be accompanied by a [Developer Certificate 69 + of Origin](https://developercertificate.org/), the text of which is reproduced 70 + here for convenience: 105 71 72 + ``` 73 + Developer Certificate of Origin 74 + Version 1.1 106 75 107 - - If you are the copyright holder, you will need to agree to the 108 - [individual contributor license agreement](https://developers.google.com/open-source/cla/individual), 109 - which can be completed online. 110 - - If your organization is the copyright holder, the organization 111 - will need to agree to the 112 - [corporate 113 - contributor license agreement](https://developers.google.com/open-source/cla/corporate). 76 + Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 77 + 1 Letterman Drive 78 + Suite D4700 79 + San Francisco, CA, 94129 114 80 115 - You can check your currently signed agreements and sign new ones at 116 - the 117 - [Google Developers Contributor License Agreements](https://cla.developers.google.com/clas?pli=1&amp;authuser=1) website. 118 - If the copyright holder for your contribution has already completed the 119 - agreement in connection with another Google open source project, 120 - it does not need to be completed again. 81 + Everyone is permitted to copy and distribute verbatim copies of this 82 + license document, but changing it is not allowed. 121 83 122 84 123 - If the copyright holder for the code you are submitting changes&mdash;for example, 124 - if you start contributing code on behalf of a new company&mdash;please send mail 125 - to the [`cue-dev` mailing list](mailto:cue-dev@googlegroups.com). 126 - This will let us know the situation so we can make sure an appropriate agreement is 127 - completed and update the `AUTHORS` file. 85 + Developer's Certificate of Origin 1.1 128 86 87 + By making a contribution to this project, I certify that: 129 88 89 + (a) The contribution was created in whole or in part by me and I 90 + have the right to submit it under the open source license 91 + indicated in the file; or 130 92 131 - ### Step 2: Configure git authentication 93 + (b) The contribution is based upon previous work that, to the best 94 + of my knowledge, is covered under an appropriate open source 95 + license and I have the right under that license to submit that 96 + work with modifications, whether created in whole or in part 97 + by me, under the same open source license (unless I am 98 + permitted to submit under a different license), as indicated 99 + in the file; or 132 100 133 - The remaining two steps only apply if you wish to contribute through Gerrit, 134 - which is the source of truth for the CUE project. You can also send Pull 135 - Requests to the mirror at https://github.com/cuelang/cue. 101 + (c) The contribution was provided directly to me by some other 102 + person who certified (a), (b) or (c) and I have not modified 103 + it. 136 104 137 - The main CUE repository is located at 138 - [cue.googlesource.com](https://cue.googlesource.com), 139 - a Git server hosted by Google. 140 - Authentication on the web server is made through your Google account, but 141 - you also need to configure `git` on your computer to access it. 142 - Follow this steps: 105 + (d) I understand and agree that this project and the contribution 106 + are public and that a record of the contribution (including all 107 + personal information I submit with it, including my sign-off) is 108 + maintained indefinitely and may be redistributed consistent with 109 + this project or the open source license(s) involved. 110 + ``` 143 111 112 + All commit messages must contain the `Signed-off-by` line with an email address 113 + that matches the commit author. When commiting, use the `--signoff` flag: 144 114 145 - - Visit [cue.googlesource.com](https://cue.googlesource.com) 146 - and click on "Generate Password" in the page's top right menu bar. 147 - You will be redirected to accounts.google.com to sign in. 148 - - After signing in, you will be taken to a page with the title "Configure Git". 149 - This page contains a personalized script that when run locally will configure Git 150 - to hold your unique authentication key. 151 - This key is paired with one that is generated and stored on the server, 152 - analogous to how SSH keys work. 153 - - Copy and run this script locally in your terminal to store your secret 154 - authentication token in a `.gitcookies` file. 155 - If you are using a Windows computer and running `cmd`, 156 - you should instead follow the instructions in the yellow box to run the command; 157 - otherwise run the regular script. 115 + ``` 116 + git commit -s 117 + ``` 158 118 159 - ### Step 3: Create a Gerrit account 119 + ### Step 2: Setup a GerritHub account 120 + 121 + If you have not used GerritHub before, setting up an account is a simple 122 + process: 123 + 124 + - Visit [GerritHub](http://gerrithub.io/). 125 + - Click "First Time Sign In". 126 + - Clickt the green "Sign In" button, to sign in using your GitHub 127 + credentials. 128 + - When prompted "Which level of GitHub access do you need?", choose 129 + "Default" and then click "Login." 130 + - Click "Authorize gerritforge-ltd" on the GitHub auth page. 131 + - Confirm account profile details and click "Next." 160 132 161 - Gerrit is an open-source tool used by CUE maintainers to discuss and review 162 - code submissions. 133 + If you want to use SSH for authentication, SSH keys can be [configured in your 134 + user profile](https://review.gerrithub.io/settings/#SSHKeys). 163 135 136 + For HTTP Credentials, [generate a password via your user 137 + profile](https://review.gerrithub.io/settings/#HTTPCredentials). Then use an 138 + existing HTTP authentication mechanism like `.netrc`, macOS KeyChain, or some 139 + other [crendential helper](https://git-scm.com/docs/gitcredentials). If you have 140 + any troubles with this step, please [raise an 141 + issue](https://github.com/cue-lang/cue/issues/new). 164 142 165 - To register your account, visit 166 - [cue-review.googlesource.com/login/](https://cue-review.googlesource.com/login/) 167 - and sign in once using the same Google Account you used above. 143 + Then visit https://review.gerrithub.io/admin/repos/cue-lang/cue, then click 144 + "HTTP" or "SSH" then copy the corresponding "Clone" command. 168 145 169 146 170 - ### Step 4: Install the git-codereview command 147 + ### Step 3: Install the git-codereview command 171 148 172 - Changes to CUE must be reviewed before they are accepted, no matter who makes the change. 173 - A custom `git` command called `git-codereview` 174 - simplifies sending changes to Gerrit. 149 + Changes to CUE must be reviewed before they are accepted, no matter who makes 150 + the change. A custom `git` command called `git-codereview` simplifies sending 151 + changes to Gerrit. 175 152 176 153 <!-- Keep the following in sync with cmd/cue/cmd/testdata/script/contributing_install*.txt --> 177 154 ··· 203 180 `git-codereview.exe` is in your `git` exec-path. 204 181 Run `git --exec-path` to discover the right location then create a 205 182 symbolic link or just copy the executable from $GOPATH/bin to this directory. 206 - 207 183 208 184 209 185 ## Before contributing code ··· 223 199 ### Check the issue tracker 224 200 225 201 Whether you already know what contribution to make, or you are searching for 226 - an idea, the [issue tracker](https://github.com/cuelang/cue/issues) is 202 + an idea, the [issue tracker](https://github.com/cue-lang/cue/issues) is 227 203 always the first place to go. 228 204 Issues are triaged to categorize them and manage the workflow. 229 205 ··· 247 223 248 224 - Issues that need investigation: 249 225 [`is:issue is:open label:NeedsInvestigation`]( 250 - https://github.com/cuelang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsInvestigation) 226 + https://github.com/cue-lang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsInvestigation) 251 227 - Issues that need a fix: 252 - [`is:issue is:open label:NeedsFix`](https://github.com/cuelang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix) 228 + [`is:issue is:open label:NeedsFix`](https://github.com/cue-lang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix) 253 229 - Issues that need a fix and have a CL: 254 - [`is:issue is:open label:NeedsFix "cuelang.org/cl"`](https://github.com/cuelang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix+%22golang.org%2Fcl%22) 230 + [`is:issue is:open label:NeedsFix "cuelang.org/cl"`](https://github.com/cue-lang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix+%22golang.org%2Fcl%22) 255 231 - Issues that need a fix and do not have a CL: 256 - [`is:issue is:open label:NeedsFix NOT "cuelang.org/cl"`](https://github.com/cuelang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix+NOT+%22golang.org%2Fcl%22) 232 + [`is:issue is:open label:NeedsFix NOT "cuelang.org/cl"`](https://github.com/cue-lang/cue/issues?q=is%3Aissue+is%3Aopen+label%3ANeedsFix+NOT+%22golang.org%2Fcl%22) 257 233 258 234 ### Open an issue for any new problem 259 235 ··· 342 318 This is an overview of the overall process: 343 319 344 320 345 - - **Step 1:** Clone the CUE source code from cue.googlesource.com 346 - and make sure it's stable by compiling and testing it once: 321 + - **Step 1:** Clone the CUE source code from GerritHub. Visit 322 + https://review.gerrithub.io/admin/repos/cue-lang/cue, then click 323 + "SSH" or "HTTP" dependending on which authentication mechanism you configured 324 + above. Then copy and run the corresponding "Clone" command. 325 + 326 + Then make sure it's stable by compiling and testing it once: 327 + 347 328 ``` 348 - $ git clone https://cue.googlesource.com/cue 349 329 $ cd cue 350 330 $ go test ./... 351 331 $ go install ./cmd/cue ··· 395 375 checked out from the correct repository. 396 376 You can check out the CUE source repo onto your local file system anywhere 397 377 you want as long as it's outside your `GOPATH`. 398 - Either clone from 399 - `cue.googlesource.com` or from GitHub: 378 + 379 + Visit https://review.gerrithub.io/admin/repos/cue-lang/cue, then click 380 + "SSH" or "HTTP" dependending on which authentication mechanism you configured 381 + above. Then copy and run the corresponding "Clone" command. 400 382 383 + Then make sure it's stable by compiling and testing it once: 401 384 402 385 ``` 403 - $ git clone https://github.com/cuelang/cue # or https://cue.googlesource.com/cue 404 386 $ cd cue 405 387 $ go test ./... 406 388 # go install ./cmd/cue ··· 486 468 487 469 ``` 488 470 remote: New Changes: 489 - remote: https://cue-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments 471 + remote: https://review.gerrithub.io/99999 math: improved Sin, Cos and Tan precision for very large arguments 490 472 ``` 491 473 492 474 If you get an error instead, check the ··· 596 578 the fully-qualified syntax supported by GitHub to make sure the change is 597 579 linked to the issue in the main repository, not the subrepository. 598 580 All issues are tracked in the main repository's issue tracker. 599 - The correct form is "Fixes cuelang/cue#159". 581 + The correct form is "Fixes #159". 600 582 601 583 602 584 ··· 756 738 Files in the CUE repository don't list author names, both to avoid clutter 757 739 and to avoid having to keep the lists up to date. 758 740 Instead, your name will appear in the 759 - [change log](https://cue.googlesource.com/cue/+log) and in the 741 + [change log](https://review.gerrithub.io/plugins/gitiles/cue-lang/cue/+log) and in the 760 742 [`CONTRIBUTORS`](../CONTRIBUTORS) file and perhaps the 761 743 [`AUTHORS`](../AUTHORS) file. 762 744 These files are automatically generated from the commit logs periodically. ··· 938 920 939 921 940 922 ``` 941 - $ git fetch https://cue.googlesource.com/review refs/changes/21/13245/1 && git checkout FETCH_HEAD 923 + $ git fetch https://review.gerrithub.io/a/cue-lang/cue refs/changes/67/519567/1 && git checkout FETCH_HEAD 942 924 ``` 943 925 944 926 To revert, change back to the branch you were working in.
+3 -3
doc/tutorial/kubernetes/README.md
··· 1269 1269 ``` 1270 1270 1271 1271 The complete top-level model definitions can be found at 1272 - [doc/tutorial/kubernetes/manual/services/cloud.cue](https://cue.googlesource.com/cue/+/master/doc/tutorial/kubernetes/manual/services/cloud.cue). 1272 + [doc/tutorial/kubernetes/manual/services/cloud.cue](https://review.gerrithub.io/plugins/gitiles/cue-lang/cue/+/refs/heads/master/doc/tutorial/kubernetes/manual/services/cloud.cue). 1273 1273 1274 1274 The tailorings for this specific project (the labels) are defined 1275 - [here](https://cue.googlesource.com/cue/+/master/doc/tutorial/kubernetes/manual/services/kube.cue). 1275 + [here](https://review.gerrithub.io/plugins/gitiles/cue-lang/cue/+/refs/heads/master/doc/tutorial/kubernetes/manual/services/kube.cue). 1276 1276 1277 1277 1278 1278 ### Converting to Kubernetes ··· 1301 1301 1302 1302 Mapping deployments is a bit more involved, though analogous. 1303 1303 The complete definitions for Kubernetes conversions can be found at 1304 - [doc/tutorial/kubernetes/manual/services/k8s.cue](https://cue.googlesource.com/cue/+/master/doc/tutorial/kubernetes/manual/services/k8s.cue). 1304 + [doc/tutorial/kubernetes/manual/services/k8s.cue](https://review.gerrithub.io/plugins/gitiles/cue-lang/cue/+/refs/heads/master/doc/tutorial/kubernetes/manual/services/k8s.cue). 1305 1305 1306 1306 Converting the top-level definitions to concrete Kubernetes code is the hardest 1307 1307 part of this exercise.
+43 -66
internal/ci/workflows.cue
··· 46 46 file: "new_version_triggers.yml" 47 47 schema: new_version_triggers 48 48 }, 49 - { 50 - file: "mirror.yml" 51 - schema: mirror 52 - }, 53 49 ] 54 50 55 51 test: _#bashWorkflow & { ··· 60 56 branches: ["**"] // any branch (including '/' namespaced branches) 61 57 "tags-ignore": [_#releaseTagPattern] 62 58 } 59 + pull_request: {} 63 60 } 64 61 65 62 jobs: { ··· 67 64 "runs-on": _#linuxMachine 68 65 steps: [...(_ & {if: "${{ \(_#isCLCITestBranch) }}"})] 69 66 steps: [ 70 - _#writeCookiesFile, 67 + _#writeNetrcFile, 71 68 _#startCLBuild, 72 69 ] 73 70 } ··· 76 73 strategy: _#testStrategy 77 74 "runs-on": "${{ matrix.os }}" 78 75 steps: [ 79 - _#writeCookiesFile, 76 + _#writeNetrcFile, 80 77 _#installGo, 81 78 _#checkoutCode, 82 79 _#cacheGoModules, ··· 86 83 }, 87 84 _#goGenerate, 88 85 _#goTest, 89 - _#goTestRace & { 90 - if: "${{ \(_#isMaster) || \(_#isCLCITestBranch) && matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)' }}" 91 - }, 86 + // _#goTestRace & { 87 + // if: "${{ \(_#isMaster) || \(_#isCLCITestBranch) && matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)' }}" 88 + // }, 92 89 _#goReleaseCheck, 93 90 _#checkGitClean, 94 - _#pullThroughProxy, 91 + // _#pullThroughProxy, 95 92 _#failCLBuild, 96 93 ] 97 94 } ··· 100 97 if: "${{ \(_#isCLCITestBranch) }}" 101 98 needs: "test" 102 99 steps: [ 103 - _#writeCookiesFile, 100 + _#writeNetrcFile, 104 101 _#passCLBuild, 105 102 ] 106 103 } ··· 112 109 _#step & { 113 110 run: """ 114 111 \(_#tempCueckooGitDir) 115 - git push https://github.com/cuelang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 112 + git push https://github.com/cue-lang/cue :${GITHUB_REF#\(_#branchRefPrefix)} 116 113 """ 117 114 }, 118 115 ] ··· 154 151 #args: { 155 152 message: "Build failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} for more details" 156 153 labels: { 157 - "Code-Review": -1 154 + "TryBot-Result": -1 158 155 } 159 156 } 160 157 }).res ··· 166 163 #args: { 167 164 message: "Build succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}" 168 165 labels: { 169 - "Code-Review": 1 166 + "TryBot-Result": 1 170 167 } 171 168 } 172 169 }).res ··· 180 177 tag: "trybot" 181 178 message: string 182 179 labels?: { 183 - "Code-Review": int 180 + "TryBot-Result": int 184 181 } 185 182 } 186 183 res: #""" 187 - \#(_#curl) -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 184 + \#(_#curl) -n -H "Content-Type: application/json" --request POST --data '\#(encjson.Marshal(#args))' https://review.gerrithub.io/a/changes/$(basename $(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review 188 185 """# 189 186 } 190 187 } ··· 193 190 repository_dispatch: _#bashWorkflow & { 194 191 // These constants are defined by github.com/cue-sh/tools/cmd/cueckoo 195 192 _#runtrybot: "runtrybot" 196 - _#mirror: "mirror" 197 - _#importpr: "importpr" 198 193 _#unity: "unity" 199 194 200 195 _#dispatchJob: _#job & { ··· 209 204 "\(_#runtrybot)": _#dispatchJob & { 210 205 _#type: _#runtrybot 211 206 steps: [ 207 + _#writeNetrcFile, 212 208 _#step & { 213 209 name: "Trigger trybot" 214 210 run: """ 215 211 \(_#tempCueckooGitDir) 216 - git fetch https://cue-review.googlesource.com/cue ${{ github.event.client_payload.payload.ref }} 212 + git fetch https://review.gerrithub.io/a/cue-lang/cue ${{ github.event.client_payload.payload.ref }} 217 213 git checkout -b ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} FETCH_HEAD 218 - git push https://github.com/cuelang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 214 + git push https://github.com/cue-lang/cue ci/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }} 219 215 """ 220 216 }, 221 217 ] 222 218 } 223 - "\(_#mirror)": _#dispatchJob & { 224 - _#type: _#mirror 225 - steps: _#copybaraSteps & {_ 226 - _#name: "Mirror Gerrit to GitHub" 227 - _#cmd: "github" 228 - } 229 - } 230 - "\(_#importpr)": _#dispatchJob & { 231 - _#type: _#importpr 232 - steps: _#copybaraSteps & {_ 233 - _#name: "Import PR #${{ github.event.client_payload.commit }} from GitHub to Gerrit" 234 - _#cmd: "github-pr ${{ github.event.client_payload.payload.pr }}" 235 - } 236 - } 237 - } 238 - } 239 - 240 - mirror: _#bashWorkflow & { 241 - name: "Scheduled repo mirror" 242 - on: 243 - schedule: [{ 244 - cron: "*/30 * * * *" // every 30 mins 245 - }] 246 - 247 - jobs: { 248 - "mirror": { 249 - "runs-on": _#linuxMachine 250 - steps: _#copybaraSteps & {_ 251 - _#name: "Mirror Gerrit to GitHub" 252 - _#cmd: "github" 253 - } 254 - } 255 219 } 256 220 } 257 221 ··· 271 235 }, 272 236 _#step & { 273 237 name: "Run GoReleaser" 274 - env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}" 238 + env: GITHUB_TOKEN: "${{ secrets.CUECKOO_GITHUB_PAT }}" 275 239 uses: "goreleaser/goreleaser-action@v2" 276 240 with: { 277 241 args: "release --rm-dist" ··· 303 267 uses: "docker/build-push-action@v1" 304 268 with: { 305 269 tags: "${{ env.CUE_VERSION }},latest" 306 - repository: "cuelang/cue" 270 + repository: "cue-lang/cue" 307 271 username: "${{ secrets.DOCKER_USERNAME }}" 308 272 password: "${{ secrets.DOCKER_PASSWORD }}" 309 273 tag_with_ref: false ··· 350 314 { 351 315 name: "Rebuild tip.cuelang.org" 352 316 run: #""" 353 - \#(_#curl) -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary "{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches 317 + \#(_#curl) -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary "{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches 354 318 """# 355 319 }, 356 320 { ··· 386 350 "fail-fast": false 387 351 matrix: { 388 352 // Use a stable version of 1.14.x for go generate 389 - "go-version": [_#codeGenGo, _#latestStableGo, "1.16"] 390 - os: [_#linuxMachine, _#macosMachine, _#windowsMachine] 353 + "go-version": [ 354 + // _#codeGenGo, 355 + // _#latestStableGo, 356 + "1.16", 357 + ] 358 + os: [ 359 + _#linuxMachine, 360 + // _#macosMachine, 361 + // _#windowsMachine, 362 + ] 391 363 } 392 364 } 393 365 ··· 453 425 run: "test -z \"$(git status --porcelain)\" || (git status; git diff; false)" 454 426 } 455 427 456 - _#writeCookiesFile: _#step & { 457 - name: "Write the gitcookies file" 458 - run: "echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies" 428 + _#writeNetrcFile: _#step & { 429 + name: "Write netrc file for cueckoo Gerrithub" 430 + run: """ 431 + cat <<EOD > ~/.netrc 432 + machine review.gerrithub.io 433 + login cueckoo 434 + password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} 435 + EOD 436 + chmod 600 ~/.netrc 437 + """ 459 438 } 460 439 461 440 _#branchRefPrefix: "refs/heads/" ··· 479 458 cd _scripts 480 459 docker run --rm -v $PWD/cache:/root/copybara/cache -v $PWD:/usr/src/app --entrypoint="" \#(_#cueckooCopybaraImage) bash -c " \ 481 460 set -eu; \ 482 - echo \"${{ secrets.gerritCookie }}\" > ~/.gitcookies; \ 483 - chmod 600 ~/.gitcookies; \ 484 461 git config --global user.name cueckoo; \ 485 - git config --global user.email cueckoo@gmail.com; \ 486 - git config --global http.cookiefile \$HOME/.gitcookies; \ 487 - echo https://cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }}@github.com > ~/.git-credentials; \ 488 - chmod 600 ~/.git-credentials; \ 462 + git config --global user.email cueckoo@cuelang.org; \ 463 + echo machine github.com login cueckoo password ${{ secrets.CUECKOO_GITHUB_PAT }} >> ~/.netrc; \ 464 + echo machine review.gerrithub.io login cueckoo password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }} >> ~/.netrc; \ 465 + chmod 600 ~/.netrc; \ 489 466 java -jar /opt/copybara/copybara_deploy.jar migrate copy.bara.sky \#(_#cmd); \ 490 467 " 491 468 """#
+1 -1
internal/core/adt/eval.go
··· 150 150 if v.status < Finalized && v.state != nil { 151 151 // TODO: errors are slightly better if we always add addNotify, but 152 152 // in this case it is less likely to cause a performance penalty. 153 - // See https://github.com/cuelang/cue/issues/661. It may be possible to 153 + // See https://cuelang.org/issue/661. It may be possible to 154 154 // relax this again once we have proper tests to prevent regressions of 155 155 // that issue. 156 156 if !v.state.done() || v.state.errs != nil {