README.md 2 KB
Newer Older
tandrii@chromium.org's avatar
tandrii@chromium.org committed
1 2
# CQ Client Library.

3 4 5 6
This directory contains CQ client library to be distributed to other repos. If
you need to modify some files in this directory, please make sure that you are
changing the canonical version of the source code and not one of the copies,
which should only be updated as a whole using Glyco (when available, see
7
[chromium issue 489420](http://crbug.com/489420)).
8

tandrii@chromium.org's avatar
tandrii@chromium.org committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
The canonical version is located at
[https://chrome-internal.googlesource.com/infra/infra_internal/+/master/commit_queue/cq_client]().

When modifying cq.proto, consider adding checks to validator in
[https://chrome-internal.googlesource.com/infra/infra_internal/+/master/appengine/commit_queue/src/commitqueue/validate.go]().


## Generation of Python and Go bindings

### tl;dr
  
    make


### Details

All commands below assume you are working in a standard infra_internal gclient
checkout (e.g., after you ran `mkdir src && cd src && fetch infra_internal`) and
are in current directory of this README.md (that is, in
`cd infra_internal/commit_queue/cq_client`).
29

tandrii@chromium.org's avatar
tandrii@chromium.org committed
30 31 32 33
To generate Python's `cq_pb2.py` you'll need to get and `protoc` of version
**2.6.1**. You can get it by `make py-prepare`.
    
    make py
34

tandrii@chromium.org's avatar
tandrii@chromium.org committed
35 36
To generate Golang's protobuf file `cq.pb.go`, you'll need to bootstrap
infra/infra repository and go utilities `make go-prepare`.
37

tandrii@chromium.org's avatar
tandrii@chromium.org committed
38
    make go
39

tandrii@chromium.org's avatar
tandrii@chromium.org committed
40
## Notes
41

42
1. Please make sure to use proto3-compatible syntax, e.g. no default
tandrii@chromium.org's avatar
tandrii@chromium.org committed
43 44 45
values, no required fields. As of this writing (Jan 2016),
the Go protobuf compiler has been upgraded to 3.0.0. So, if you can generate go
bindings, all is good.
46

tandrii@chromium.org's avatar
tandrii@chromium.org committed
47
2. If after generating Python binding, CQ tests fail with:
48

tandrii@chromium.org's avatar
tandrii@chromium.org committed
49
        TypeError: __init__() got an unexpected keyword argument 'syntax'
50

tandrii@chromium.org's avatar
tandrii@chromium.org committed
51 52 53 54 55
You've probably used 3.0.0 protoc generator. We should eventually switch to 3x
Python version as well, but it requires upgrading infra's Python ENV to newer
package. See [bootstrap/README.md](../../bootstrap/README.md) for more
information.  We may end up deprecating Python before all infra's Python code
can be moved to protobuf v3.