|
| 1 | +## Continuous Integration Testing |
| 2 | + |
| 3 | +Currently we are using two separate CI systems to test all changes and pushed commits: |
| 4 | +Tests running in Google Cloud Build (GCB) and tests running with GitHub Action. |
| 5 | +It is a temporary setup; once GCB fully supports our desired workflow that works |
| 6 | +with the Go Git repository, we plan to use the GCB-based setup for CI. |
| 7 | + |
| 8 | +### Testing via GCB |
| 9 | + |
| 10 | +This workflow is triggered for Gerrit CLs (chosen by project members) and all |
| 11 | +the commits merged into the master branch. |
| 12 | +Note that our main repository is in `go.googlesource.com/vscode-go` and |
| 13 | +`github.com/golang/vscode-go` is a mirror of the Go Git repository. |
| 14 | +All PRs sent to `github.com/golang/vscode-go` will be converted as Gerrit CLs. |
| 15 | +Currently, the results of the CI Run are visible to only project members. |
| 16 | +We are working on improving this workflow - making the results visible to |
| 17 | +public and easily accessible through our Gerrit review UI. |
| 18 | + |
| 19 | +- `build/cloudbuild.yaml`, `build/all.bash` - define the GCB workflow. |
| 20 | +- `build/cloudbuild.container.yaml`, `build/Dockerfile` - define the Docker container used for CI. |
| 21 | + |
| 22 | +Project members (currently restricted to our GCP project members) can manually |
| 23 | +trigger cloud build and test their locally made changes. |
| 24 | +Follow the [GCB instruction](https://cloud.google.com/cloud-build/docs/running-builds/start-build-manually) |
| 25 | +to set up the environment and tools, and then run |
| 26 | + |
| 27 | +``` |
| 28 | +$ gcloud builds submit --config=build/cloudbuild.yaml |
| 29 | +``` |
| 30 | + |
| 31 | +In order to modify and rebuild the docker container image, run |
| 32 | + |
| 33 | +``` |
| 34 | +$ gcloud builds submit --config=build/cloudbuild.container.yaml |
| 35 | +``` |
| 36 | + |
| 37 | +### Testing via GitHub Action |
| 38 | + |
| 39 | +This is the workflow triggered for every PR and commit made to our mirror repository in github.com/golang/vscode-go. We are using this CI to run tests |
| 40 | +in the platforms which GCB does not support yet, and allow contributors |
| 41 | +to see the test results for their PRs. This workflow is not triggered by |
| 42 | +CLs sent via Gerrit yet. |
| 43 | + |
| 44 | +Until GCB-based CI is ready for general use, we recommend contributors |
| 45 | +to send PRs to github.com/golang/vscode-go as described in |
| 46 | +[the Go project contribution guide](https://golang.org/doc/contribute.html#sending_a_change_github). The results will be posted to the PR request. |
| 47 | + |
| 48 | +- `.github/workflows/ci.yml` - define the github action based CI workflow. |
| 49 | + |
| 50 | +## Nightly Release |
| 51 | + |
| 52 | +A new version is released based on what is committed on the `master` branch, |
| 53 | +at least once a day between Monday and Thursday. If there is no new commit, |
| 54 | +release does not happen. This nightly extension is a separate extension from |
| 55 | +the official Go extension, and is available at [the VS Code market place](https://marketplace.visualstudio.com/items?itemName=golang.go-nightly). |
| 56 | + |
| 57 | +The version number encodes the last commit timestamp of the master branch |
| 58 | +in the format of `YYYY.[M]M.[D]DHH`. For example, version 2020.3.702 indicates |
| 59 | +the extension is built with the last commit committed at ~2AM 2020/03/07 (UTC). |
| 60 | + |
| 61 | +- `.github/workflows/release.yml, build/all.bash` - define the daily release process. |
| 62 | + |
| 63 | +## Sync with upstream |
| 64 | + |
| 65 | +### Merging commits from upstream |
| 66 | + |
| 67 | +This is done manually by project members, probably before each nightly release. |
| 68 | + |
| 69 | +Once we consolidate the two repositories, this process becomes unnecessary. |
| 70 | + |
| 71 | +The merge script will create a Gerrit CL for merge and issue the GCB based test workflow. |
| 72 | +The remote `origin` should be set to `https://go.googlesource.com/vscode-go`. |
| 73 | +Make sure you have access to the GCB project and `gcloud` tool |
| 74 | +is available. |
| 75 | + |
| 76 | +``` |
| 77 | +$ build/merge.sh |
| 78 | +``` |
| 79 | + |
| 80 | +In case of conflicts, you will need to check out the cl, fix, and upload the |
| 81 | +updated cl again following the usual Gerrit CL workflow. |
| 82 | + |
| 83 | +### Reflecting commits to upstream |
| 84 | + |
| 85 | +Once the feature or bug fix tested with Nightly extension is stablized, create |
| 86 | +a PR to the upstream (github.com/microsoft/vscode-go). |
| 87 | +Please make sure to include all the gerrit CL numbers so the upstream code |
| 88 | +reviewers can find reference to all prior discussion. |
0 commit comments