Commit f80664d0 authored by Nick Thomas's avatar Nick Thomas 💃

Only regenerate Go and Ruby libraries at release

parent a84c4308
Pipeline #38069891 passed with stage
in 1 minute and 23 seconds
......@@ -8,11 +8,6 @@ build:
script:
- make
check-grpc-proto-clients:
script:
- "# Check for the mistake of updating .proto files but not regenerating clients"
- make check-grpc-proto-clients
pages:
script:
- make docs
......
......@@ -86,34 +86,47 @@ gRPC provides an implementation framework based on these Protobuf concepts.
## Contributing
The CI at https://gitlab.com/gitlab-org/gitaly-proto regenerates the
Your merge request should only contain updates to the `.proto` files. Each
release, the automatically-generated Ruby and Go libraries based on those
files will be rebuilt and committed to the repository. The CI run at
https://gitlab.com/gitlab-org/gitaly-proto regenerates them for your merge
request to guard against syntax errors.
client libraries to guard against the mistake of updating the .proto
files but not the client libraries. This check uses `git diff` to look
for changes. Some of the code in the Go client libraries is sensitive
to implementation details of the Go standard library (specifically,
the output of gzip). **Use the same Go version as .gitlab-ci.yml (Go
for changes. **Use the same Go version as .gitlab-ci.yml (Go
1.8)** when generating new client libraries for a merge request.
[DCO + License](CONTRIBUTING.md)
### Build process
After you change or add a .proto file you need to re-generate the Go
and Ruby libraries before committing your change.
After you change or add a .proto file, the changes won't be reflected in the
Go and Ruby libraries until they are regenerated. This happens on every release,
but if you're working with a branch of gitaly-proto, you'll need to regenerate
them manually:
```
# Re-generate Go and Ruby libraries
make generate
```
Before merging your branch, the changes to the automatically-generated files
should be removed.
## How to deprecate an RPC call
See [DEPRECATION.md](DEPRECATION.md).
## Release
This will tag and release the gitaly-proto library, including
pushing the gem to rubygems.org
This will regenerate the Go and Ruby libraries, commit them to the repository,
and tag and release the gitaly-proto library, including pushing the gem to
rubygems.org
Some of the code in the Go client libraries is sensitive to implementation
details of the Go standard library (specifically, the output of gzip). **Use the
same Go version as .gitlab-ci.yml (Go 1.10)** when performing a release.
```
make release version=X.Y.Z
......
......@@ -28,12 +28,14 @@ def main(version)
abort "Version string #{version.inspect} does not look like a semver (e.g. \"1.0.2\"). Aborting."
end
run!(%w[make generate])
puts 'Testing for changed files'
run!(%w[git diff --quiet --exit-code])
puts 'Testing for staged changes'
run!(%w[git diff --quiet --cached --exit-code])
write_autogenerated_files
write_version_files(version)
version_msg = "Version #{version}"
run!(%W[git commit -m #{version_msg}])
tag_name = "v#{version}"
......@@ -48,6 +50,11 @@ def main(version)
run!(%W[gem push #{GEM_NAME}-#{version}.gem])
end
def write_autogenerated_files
run!(%w[make generate])
run!(%w[git add go ruby])
end
def write_version_files(version)
version_file = 'VERSION'
open(version_file, 'w') { |f| f.puts version }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment