-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: GA release for go-sql-spanner driver (#121)
- Loading branch information
Showing
6 changed files
with
190 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
handleGHRelease: true | ||
manifest: true | ||
releaseType: go-yoshi | ||
|
||
branches: | ||
- branch: main | ||
releaseType: go-yoshi | ||
handleGHRelease: true | ||
manifest: true | ||
manifestFile: .release-please-manifest.json | ||
manifestConfig: release-please-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,136 @@ | ||
# How to Contribute | ||
# Contributing | ||
|
||
We'd love to accept your patches and contributions to this project. There are | ||
just a few small guidelines you need to follow. | ||
1. [File an issue](https://github.com/googleapis/go-sql-spanner/issues/new/choose). | ||
The issue will be used to discuss the bug or feature and should be created | ||
before sending a PR. | ||
|
||
## Contributor License Agreement | ||
1. [Install Go](https://golang.org/dl/). | ||
1. Ensure that your `GOBIN` directory (by default `$(go env GOPATH)/bin`) | ||
is in your `PATH`. | ||
1. Check it's working by running `go version`. | ||
* If it doesn't work, check the install location, usually | ||
`/usr/local/go`, is on your `PATH`. | ||
|
||
Contributions to this project must be accompanied by a Contributor License | ||
Agreement. You (or your employer) retain the copyright to your contribution; | ||
this simply gives us permission to use and redistribute your contributions as | ||
part of the project. Head over to <https://cla.developers.google.com/> to see | ||
your current agreements on file or to sign a new one. | ||
1. Sign one of the | ||
[contributor license agreements](#contributor-license-agreements) below. | ||
|
||
You generally only need to submit a CLA once, so if you've already submitted one | ||
(even if it was for a different project), you probably don't need to do it | ||
again. | ||
1. Clone the repo: | ||
`git clone https://github.com/googleapis/go-sql-spanner` | ||
|
||
## Code Reviews | ||
1. Change into the checked out source: | ||
`cd go-sql-spanner` | ||
|
||
All submissions, including submissions by project members, require review. We | ||
use GitHub pull requests for this purpose. Consult | ||
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more | ||
information on using pull requests. | ||
1. Fork the repo. | ||
|
||
## Community Guidelines | ||
1. Set your fork as a remote: | ||
`git remote add fork [email protected]:GITHUB_USERNAME/go-sql-spanner.git` | ||
|
||
This project follows [Google's Open Source Community | ||
Guidelines](https://opensource.google/conduct/). | ||
1. Make changes, commit to your fork. | ||
|
||
Commit messages should follow the | ||
[Conventional Commits Style](https://www.conventionalcommits.org). The scope | ||
portion should always be filled with the name of the package affected by the | ||
changes being made. For example: | ||
``` | ||
feat(functions): add gophers codelab | ||
``` | ||
|
||
1. Send a pull request with your changes. | ||
|
||
To minimize friction, consider setting `Allow edits from maintainers` on the | ||
PR, which will enable project committers and automation to update your PR. | ||
|
||
1. A maintainer will review the pull request and make comments. | ||
|
||
Prefer adding additional commits over amending and force-pushing since it can | ||
be difficult to follow code reviews when the commit history changes. | ||
|
||
Commits will be squashed when they're merged. | ||
|
||
## Testing | ||
|
||
We test code against two versions of Go, the minimum and maximum versions | ||
supported by our clients. To see which versions these are checkout our | ||
[README](README.md#supported-versions). | ||
|
||
### Integration Tests | ||
|
||
In addition to the unit tests, you may run the integration test suite. | ||
|
||
#### GCP Setup | ||
|
||
To run the integrations tests, creation and configuration of a project in | ||
the Google Developers Console is required. | ||
|
||
After creating the project, you must [create a service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount) | ||
for project. Ensure the project-level **Owner** | ||
[IAM role](https://console.cloud.google.com/iam-admin/iam/project) role is added to | ||
each service account. During the creation of the service account, you should | ||
download the JSON credential file for use later. | ||
|
||
#### Local Setup | ||
|
||
Once the project is created and configured, set the following environment | ||
variables: | ||
|
||
- `SPANNER_TEST_PROJECT`: Developers Console project's ID (e.g. | ||
bamboo-shift-455). | ||
|
||
Install the [gcloud command-line tool][gcloudcli] to your machine and use it to | ||
create some resources used in integration tests. | ||
|
||
From the project's root directory: | ||
|
||
``` sh | ||
# Sets the default project in your env. | ||
$ gcloud config set project $SPANNER_TEST_PROJECT | ||
|
||
# Authenticates the gcloud tool with your account. | ||
$ gcloud auth login | ||
|
||
# Creates a Spanner instance for the spanner integration tests. | ||
$ gcloud beta spanner instances create go-integration-test --config regional-us-central1 --nodes 10 --description 'Instance for go client test' | ||
# NOTE: Spanner instances are priced by the node-hour, so you may want to | ||
# delete the instance after testing with 'gcloud beta spanner instances delete'. | ||
|
||
$ export SPANNER_TEST_INSTANCE=go-integration-test | ||
``` | ||
|
||
It may be useful to add exports to your shell initialization for future use. | ||
For instance, in `.zshrc`: | ||
|
||
```sh | ||
#### START Test Variables | ||
# Developers Console project's ID (e.g. bamboo-shift-455) for the general project. | ||
export SPANNER_TEST_PROJECT=your-project | ||
|
||
# Developers Console Spanner's instance ID (e.g. spanner-instance) for the running tests. | ||
export SPANNER_TEST_INSTANCE=go-integration-test | ||
#### END Test Variables | ||
``` | ||
|
||
#### Running | ||
|
||
Once you've done the necessary setup, you can run the integration tests by | ||
running: | ||
|
||
``` sh | ||
$ go test -v ./... | ||
``` | ||
|
||
## Contributor License Agreements | ||
|
||
Before we can accept your pull requests you'll need to sign a Contributor | ||
License Agreement (CLA): | ||
|
||
- **If you are an individual writing original source code** and **you own the | ||
intellectual property**, then you'll need to sign an [individual CLA][indvcla]. | ||
- **If you work for a company that wants to allow you to contribute your | ||
work**, then you'll need to sign a [corporate CLA][corpcla]. | ||
|
||
You can sign these electronically (just scroll to the bottom). After that, | ||
we'll be able to accept your pull requests. | ||
|
||
[gcloudcli]: https://developers.google.com/cloud/sdk/gcloud/ | ||
[indvcla]: https://developers.google.com/open-source/cla/individual | ||
[corpcla]: https://developers.google.com/open-source/cla/corporate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"release-type": "go-yoshi", | ||
"separate-pull-requests": true, | ||
"include-component-in-tag": false, | ||
"packages": { | ||
".": { | ||
"component": "main" | ||
} | ||
}, | ||
"plugins": ["sentence-case"] | ||
} |