Граф коммитов

42 Коммитов

Автор SHA1 Сообщение Дата
Quinten Yearsley 96be844d43 gerrit: add RevisionInfo.Kind field
Bug: chromium:807036
Change-Id: I72f00a92641f202841a1c60bf03343e11cf3b1e1
Reviewed-on: https://go-review.googlesource.com/c/159517
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-24 23:44:35 +00:00
Baokun Lee d788e328d9 cmd/gerritbot: sync abandon message to PR
Fixes golang/go#28855

Change-Id: I769cca7a509a429fad1789a8984f62f05329196d
Reviewed-on: https://go-review.googlesource.com/c/150817
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-01-23 19:45:12 +00:00
Parminder Singh 03ea0966a8 gerrit: add messageWithFooter to RevisionInfo
I am working on a change in chromium/infra
https://chromium-review.googlesource.com/c/infra/infra/+/1379425
We use the gerrit library's structs and currently it
doesn't include the messageWithFooter property in object.
So this change adds it.

Change-Id: I95cc8c25b2997d02548df462778b2b264c2db5cf
Reviewed-on: https://go-review.googlesource.com/c/156438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-07 03:02:40 +00:00
Russ Cox d2a2c1258f gerrit: add more fields to ChangeInfo
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>
2018-11-13 05:43:49 +00:00
Giuseppe Valente 1931831e3d gerrit: add FileInfo status constants
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>
2018-10-29 21:21:50 +00:00
Giuseppe Valente 453fa3cd1b gerrit: add Client.GetProjectTags method, WebLinkInfo, TagInfo
Change-Id: Iebe0796ecd65b98b75b73b1f4008fef0177fb9c8
GitHub-Last-Rev: 5807f37ca6
GitHub-Pull-Request: golang/build#13
Reviewed-on: https://go-review.googlesource.com/c/143838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-23 20:50:23 +00:00
Andrew Bonventre 952c4101bf cmd/gerritbot: autoassign reviewers on changes
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>
2018-09-03 22:18:01 +00:00
Daniel Theophanes c1b72a71f2 gerrit: allow setAuth to fallthrough to netrc lookup
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.

Fixes golang/go#26782

Change-Id: I0ba94ff7fa4b6038d6117156dcc729ddf4616fdc
Reviewed-on: https://go-review.googlesource.com/127855
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03 18:56:37 +00:00
Michael Dorner 7feb1540b0 gerrit: add parameter for pagination in QueryChangesOpt
QueryChangesOpt has now a new pagination field Start for the number of first changes to skip, as it was already implemented for QueryAccountsOpt.

Fixes golang/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>
2018-07-09 13:51:24 +00:00
Andrew Bonventre 99c796b950 gerrit: add support for adding reviewers to a change
Change-Id: I9180296c6ca5d1c981c91edb87bbfefa29223685
Reviewed-on: https://go-review.googlesource.com/114838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-27 18:05:07 +00:00
Brad Fitzpatrick a9c7bdc7aa gerrit: add support for hashtags
Tested in one-off local tool:

   func main() {
       gc := gerrit.NewClient("https://go-review.googlesource.com/", gerrit.GitCookiesAuth())
       ....

Updates golang/go#24836

Change-Id: I231e3afb4a27e41f9b56968e3e97fa1c31fd8d84
Reviewed-on: https://go-review.googlesource.com/106795
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-04-13 14:30:05 +00:00
Andrew Bonventre 5adabcfcf9 cmd/gerritbot: close GitHub PR when Gerrit change is closed
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>
2018-01-17 19:46:31 +00:00
Kevin Burke d13a093a9c gerrit: fix vet error
"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>
2017-11-28 21:59:26 +00:00
Tobias Klauser c9ba2777a2 all: fix vet format string warnings
Change-Id: Iec22c99fad05b880c52c9b6d09284fe03967471b
Reviewed-on: https://go-review.googlesource.com/75070
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-11-01 15:41:47 +00:00
Andrew Bonventre f6341f92eb gerrit: add optional message param to Abandon call
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>
2017-09-29 15:02:36 +00:00
Jude Pereira ec36dd2dea x/build/gerrit: add support for querying accounts in Gerrit
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>
2017-09-07 19:25:33 +00:00
Brad Fitzpatrick 73f88a6d4c all: add README.md files where missing, and tool to keep them updated
Change-Id: I385171c415bf168c04c6c3a7a996bff88964af84
Reviewed-on: https://go-review.googlesource.com/52856
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-08-02 22:17:52 +00:00
Lann Martin be55dc02bb gerrit: add TimeStamp.MarshalJSON method
This mirrors TimeStamp.UnmarshalJSON. Helps in emulating a Gerrit server
in integration tests.

Add tests for TimeStamp.UnmarshalJSON and .MarshalJSON.

Fixes golang/go#21261

Change-Id: I972164c35308f5c5c46cf68847d52da2475182c3
Reviewed-on: https://go-review.googlesource.com/52471
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-02 03:56:33 +00:00
Kevin Burke bf074728a2 gerrit: Fix tests
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>
2017-07-15 05:15:33 +00:00
Kevin Burke fefb8562f0 gerrit: switch GetChange argument type
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>
2017-07-14 17:58:47 +00:00
Kevin Burke afc6d121f3 gerrit: add GetChange API call
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>
2017-07-14 17:27:11 +00:00
Brad Fitzpatrick 891b12dcbd cmd/gopherstats, internal/gophers: start of tool to collect community stats
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>
2017-05-03 17:36:15 +00:00
Brad Fitzpatrick bce074b887 gerrit: switch to use std context package, require Go 1.7+
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>
2017-04-18 05:16:09 +00:00
Brad Fitzpatrick c0c79826e0 gerrit: add ListProjects method
Change-Id: I04209313610b42813fc4f9697a4c5ec7366c627f
Reviewed-on: https://go-review.googlesource.com/38717
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-27 19:32:05 +00:00
Pavlo Sumkin ff20af95f9 gerrit: Add support for Digest Authorization
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>
2017-03-25 20:05:26 +00:00
Kevin Burke aaa6b3e605 cmd/gitmirror, gerrit: move GetProjects to gerrit
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>
2017-02-19 17:54:52 +00:00
haya14busa e55c76c87a gerrit: add CommentInput field to ReviewInput
CommentInput field is needed to post inline comments.

Fixes golang/go#18830

Change-Id: I04a77621f0bbbc587bbeb2e050ac363c3bbc7cf5
Reviewed-on: https://go-review.googlesource.com/35991
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-02 00:07:22 +00:00
Kevin Burke 84c3f714d2 gerrit: support contexts
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.

Fixes golang/go#18742.
Fixes golang/go#18743.

Change-Id: Ifa78cbb058981e23cf5769955f6312fcbe08e174
Reviewed-on: https://go-review.googlesource.com/35559
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-23 21:06:28 +00:00
shawnps 2610191dbd gerrit: add ability to pass QueryChangesOpt to GetChangeDetail
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>
2017-01-07 17:46:31 +00:00
Brad Fitzpatrick 5612addc94 gerrit: add Auth mode to use a specific cookie file, add more methods
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>
2016-02-08 23:00:44 +00:00
Brad Fitzpatrick 09ec8bf053 gerrit: add Client.AbandonChange
Change-Id: Ic48abd39a8a68de058595077082902f57577ce6d
Reviewed-on: https://go-review.googlesource.com/19312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-02-07 01:06:58 +00:00
Austin Clements 16adb8c13d gerrit: add GitCookies auth mode
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>
2015-10-22 01:56:53 +00:00
Austin Clements df7c940775 gerrit: add parents field to CommitInfo
Change-Id: I7cb20909d2476dc720f6c5283b48e838099fad1a
Reviewed-on: https://go-review.googlesource.com/16156
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-10-22 01:56:48 +00:00
Rob Earhart 264f8cb771 gerrit: Add additional RevisionInfo fields
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>
2015-08-27 01:32:52 +00:00
Rob Earhart 482b2ecd51 gerrit: Add GetAccountInfo
This implements the get-account Gerrit REST API method.

Change-Id: I5e9e7abaabb3e9c85798f52418fab58447960253
Reviewed-on: https://go-review.googlesource.com/13930
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-25 19:27:43 +00:00
Rob Earhart 1d862e84f2 gerrit: Add additional fields to RevisionInfo
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>
2015-08-24 21:25:00 +00:00
Andrew Gerrand 06fc01ae94 gerrit: add GetChangeInfo method to Client
Change-Id: If2eae2321b992547e4b93b1b2d3a7ecff44e6bb1
Reviewed-on: https://go-review.googlesource.com/10443
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-27 20:30:07 +00:00
Russ Cox 8f9b6de7ac cl: document, implement R= parsing, adjust default output, add -json output
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>
2015-04-27 14:35:15 +00:00
Brad Fitzpatrick 0c3bcdca16 cmd/cl: new command to print out CLs which need attention
Change-Id: Ifb314cf139ba6982ae1bc62f48cb7bebb85cec45
Reviewed-on: https://go-review.googlesource.com/8635
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-04-11 07:12:47 +00:00
Brad Fitzpatrick 421541fcd9 coordinator: trybot support
Change-Id: Ib7cd89aba1d529944120d6024c120a7b19330378
Reviewed-on: https://go-review.googlesource.com/4680
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-02-12 23:22:58 +00:00
Brad Fitzpatrick 201fc26833 gerrit: add SetReview method
Tested it at: https://go-review.googlesource.com/#/c/4460/
(the 3rd comment from gobot, at minute :18)

Change-Id: If42eebf057b15ce83d1d4ed2e14460011a8d02d4
Reviewed-on: https://go-review.googlesource.com/4532
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-02-11 05:31:17 +00:00
Brad Fitzpatrick c78912590c gerrit: start of the gerrit package, for the TryBot's Gerrit interactions
Change-Id: Ib8fc38f523058c0d8635991f8934f734253a56fc
Reviewed-on: https://go-review.googlesource.com/4531
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-02-11 04:42:22 +00:00