For details, see
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-info
Note that the field Mergable has been renamed Mergeable,
and its JSON tag has been corrected from mergable to mergeable.
If this breaks any existing code using the gerrit package,
that code should be examined, since it has never seen a
mergeable change as actually mergeable in the past.
Change-Id: I769abeed173c7afd7da7b1527f810d0a2db18236
Reviewed-on: https://go-review.googlesource.com/c/149239
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Makes it easier for users of the ListFiles() API to evaluate Status in
FileInfo objects.
Change-Id: I974fefc9ce0fc539cd678f77899630e91f68d5b9
GitHub-Last-Rev: 352dc73960
GitHub-Pull-Request: golang/build#14
Reviewed-on: https://go-review.googlesource.com/c/145657
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Look for changes that haven’t had any human aside from the author
on them and assign reviewers/CCs based on entries in golang.org/s/owners.
If no owners can be found, the tag 'no-owners' is added to the
change to prevent gopherbot from making unneeded API calls.
Also updates gopherbot's Dockerfile to use 1.11 and update deps.
Change-Id: I2650a10dd324532d86bc902be419c5f29ae980db
Reviewed-on: https://go-review.googlesource.com/121018
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When git has no http cookies, the request for http cookies
will fail because git will exit(1). Ignore this failure
because the output is properly tested either way. This allows
authentication to fallthrough to the netrc lookup.
Correct the netrc lookup under windows. git reads the netrc
file as "_netrc" in the users home directory.
Add a warning at the end of the function that no authentication
was set.
Fixesgolang/go#26782
Change-Id: I0ba94ff7fa4b6038d6117156dcc729ddf4616fdc
Reviewed-on: https://go-review.googlesource.com/127855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
QueryChangesOpt has now a new pagination field Start for the number of first changes to skip, as it was already implemented for QueryAccountsOpt.
Fixesgolang/go#24838
Change-Id: If779a404f256aca1924ce2412c79b821f4f9f639
GitHub-Last-Rev: aa79a753b6
GitHub-Pull-Request: golang/build#8
Reviewed-on: https://go-review.googlesource.com/122584
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When a Gerrit change moves into a "closed" state (merged or abandoned),
close the linked GitHub Pull Request with the appropriate message.
If the change has been merged, there is no need to mention the commit
in the message on the PR because the commit message will be linked
from the PR by virtue of the GitHub-Pull-Request: git label. See
https://github.com/golang/scratch/pull/2#issuecomment-358105675 for
an example.
Closed changes are also be cleaned up within b.pendingCLs.
Also removes a nil pointer dereference in the case where the
Gerrit CL does not exist yet, surmising its link from the output
of the push command.
Updates golang/go#18517
Change-Id: Ieb28c1b9d31216d48076b256bf6a65a099a38552
Reviewed-on: https://go-review.googlesource.com/87915
Reviewed-by: Ian Lance Taylor <iant@golang.org>
"go vet" now runs when the tests run, and errors on this test.
Change-Id: I239f23f51477530e4bda19793979e519fa371cdf
Reviewed-on: https://go-review.googlesource.com/80302
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Gerrit accepts an optional message that one can use to specify
why they’re abandoning a change. Allow a caller to utilize that.
Change-Id: I16924611275c71c164f796362ea523f05834f4a7
Reviewed-on: https://go-review.googlesource.com/67010
Reviewed-by: Kevin Burke <kev@inburke.com>
Added support for querying accounts in Gerrit. This is a pre-requisite
for golang/go#21216
Change-Id: Ic6776ddf18a23e347d0eb7edf91a934d2feb01c9
Reviewed-on: https://go-review.googlesource.com/61970
Reviewed-by: Kevin Burke <kev@inburke.com>
This mirrors TimeStamp.UnmarshalJSON. Helps in emulating a Gerrit server
in integration tests.
Add tests for TimeStamp.UnmarshalJSON and .MarshalJSON.
Fixesgolang/go#21261
Change-Id: I972164c35308f5c5c46cf68847d52da2475182c3
Reviewed-on: https://go-review.googlesource.com/52471
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We changed the API for this but I forgot to update the tests to match
the new API.
Change-Id: If31536655d99bcc403c9095198092693a05c4f02
Reviewed-on: https://go-review.googlesource.com/48598
Reviewed-by: Kevin Burke <kev@inburke.com>
Matching what's currently defined in the Gerrit package, instead of
the int32 type defined in maintner.
Change-Id: I463c7a83e9c9e7d933a2375790d35d59056ea09d
Reviewed-on: https://go-review.googlesource.com/48570
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
GetChange returns details about a specific change, and we need it for
CL 46390.
Change-Id: I0047e7170e4c9f822663640e28ee4eaf24b184de
Reviewed-on: https://go-review.googlesource.com/48553
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Total mess, but a functional mess, and a starting point for the future.
Change-Id: Ifcc72660f30a0ee2692668b4ea53acd1c4015777
Reviewed-on: https://go-review.googlesource.com/41077
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This ends support for Go 1.6.
Change-Id: If7765a15add556a5a7a881b24b1a38d96ff10841
Reviewed-on: https://go-review.googlesource.com/40938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The existing implementation doesn't support the HTTP Digest Authorization
that widely used in docker-based Gerrit configuration
Proposed code is based on http://play.golang.org/p/ABoHSHoTmu
Change-Id: Ia01d03cc849a4fcd538b05a60b83ac7e18809d5a
Reviewed-on: https://go-review.googlesource.com/29295
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This adds more utility to the Gerrit client and lets us reuse the
Gerrit API logic, instead of inventing it on an adhoc basis inside
the gitmirror code.
I added a test that this deserializes the correct data from the
Gerrit API for go.googlesource.com (and then removed it).
Change-Id: I449594b0257ed15d9b5aa7aa1eda7fb371fad6c1
Reviewed-on: https://go-review.googlesource.com/37252
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
CommentInput field is needed to post inline comments.
Fixesgolang/go#18830
Change-Id: I04a77621f0bbbc587bbeb2e050ac363c3bbc7cf5
Reviewed-on: https://go-review.googlesource.com/35991
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Switch all API methods that make requests to Gerrit to take a
context.Context as their first argument. Adds a package example and
a simple test that we make requests to the correct endpoint and that
the Client can handle correct responses and error responses from the
Gerrit server.
Switches all code in the x/build tree to use the new Gerrit
client. There are several projects outside the tree that import
x/build/gerrit; I'll submit CL's against those to pull in the new
interface once this gets merged.
Documents that the API is unstable.
Fixesgolang/go#18742.
Fixesgolang/go#18743.
Change-Id: Ifa78cbb058981e23cf5769955f6312fcbe08e174
Reviewed-on: https://go-review.googlesource.com/35559
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The existing implementation of GetChangeDetail does not allow for
an optional QueryChangesOpt. QueryChangesOpt adds the ability to
pass options such as CURRENT_FILES and CURRENT_REVISION in order
to receive a more detailed ChangeInfo struct.
Change-Id: I7925e75821538b2720fff7d62c8404ed97e18791
Reviewed-on: https://go-review.googlesource.com/34922
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is stuff needed for my Github->Gerrit bot.
Change-Id: Ie072d7b66be2b219ba48245305a8187446238c9e
Reviewed-on: https://go-review.googlesource.com/19380
Reviewed-by: Andrew Gerrand <adg@golang.org>
This adds an auth mode that fetches Gerrit authentication cookies the
same way git does: from the .gitcookies file or from .netrc. This code
is loosely based on the authentication code from git-codereview.
Change-Id: If3c4efc76300b0d2c4b69f7d8af45ebc2a222313
Reviewed-on: https://go-review.googlesource.com/16157
Reviewed-by: Andrew Gerrand <adg@golang.org>
Adds fields for the 'draft' flag, patch set number, and revision uploader.
Change-Id: I3780e2df046d9fe1065a6dc1b39400b4ea049d3a
Reviewed-on: https://go-review.googlesource.com/13936
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This adds revision creation date, git ref, and fetch info to the Gerrit
RevisionInfo type. In particular, adding fetch info allows the caller
to include "DOWNLOAD_COMMANDS" as a field to return in queries; this can
be useful in automation.
Change-Id: I407024b2d50278f7179bc589cbe29fa279d5ab78
Reviewed-on: https://go-review.googlesource.com/13896
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sample of new default output:
CL 9259 1/ 1d go 0intro bradfitz+2* archive/tar: fix error message
CL 6790 15/ 52d go vbatts@gma... bradfitz* archive/tar: fix round-trip attributes #9027
CL 9267 2/ 2d go josharian * cmd/5g, etc: prepare Node.Val to be unexported
CL 9263 2/ 3d go josharian minux* cmd/5g, etc: prepare to unexport gc.Mp*
CL 8773 1/ 14d go michael.hu... iant* cmd/6l, cmd/internal/ld: abort on shared library ABI mismatch
CL 8214 4/ 26d go aram iant+2* cmd/6l: use .plt instead of .got on Solaris
The old default behavior of "cl" is now "cl -r -url".
Change-Id: I5befaa0edffa965a041d223aa75aca7c26c6984a
Reviewed-on: https://go-review.googlesource.com/9360
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>