This change fixes a copy-paste mistake from CL 38137, where the wrong
time variable was set to UTC when cmut.Updated is non-nil.
Change-Id: I4dc62abf9b70b52b700e3b6b688fa8adbc502d98
Reviewed-on: https://go-review.googlesource.com/111645
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
GitHub reviews can be assigned to teams.
Change-Id: I675944c40619635e554d083cfa4fd6e332315f9b
Reviewed-on: https://go-review.googlesource.com/101955
Reviewed-by: Chris Broadfoot <cbro@golang.org>
From the "gcloud docker" output:
WARNING: `gcloud docker` will not be supported for Docker client
versions above 18.03. Please use `gcloud auth configure-docker` to
configure `docker` to use `gcloud` as a credential helper, then use
`docker` as you would for non-GCR registries.
Not adding "gcloud auth configure-docker" to the Makefiles as it spams
and there are implicit required authentication steps already anyway.
Change-Id: I5bd1177e82d30a6590126a307bee01d0acee9d6a
Reviewed-on: https://go-review.googlesource.com/108560
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The Docker build didn't have the x/time/rate dependency. Also run Go
1.10 instead of Go 1.8.
Verified that this works by building the Dockerfile locally.
Change-Id: Id55bbb3e8cb81ba112351d4558a318939c22d8a5
Reviewed-on: https://go-review.googlesource.com/106985
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
They were of type GitCommit, but we want to hang the useful methods
off the existing GerritMeta wrapper.
This was the plan earlier (when the GerritMeta type was added), but
that earlier CL didn't go all the way and convert callers.
This will likely break some maintner-using code, but there aren't many
callers.
Also, document & enforce that Meta & Commit are always non-nil when
enumerating CLs and when looking up CLs. Previously, two deleted CLs
didn't have this property, as the Gerrit server was returning a ref
for a version of the commit, but no meta ref. Filter those out.
Fixesgolang/go#22060Fixesgolang/go#21984
Change-Id: I67727977c7a25e750f51a6ff7f3e00aaf960ef9f
Reviewed-on: https://go-review.googlesource.com/107296
Reviewed-by: Dmitri Shuralyov <dmitri@shuralyov.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
GitHub gets upset when you send it too many requests. We do have some
backoff, but it's handled per-repo, rather than across all GitHub
requests. This adds a global GitHub limiter to add more control.
Change-Id: I42898d25cf66a93970d96e922743b766f9a21c3f
Reviewed-on: https://go-review.googlesource.com/101919
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Pull requests are now in the maintner corpus via *maintner.GitHubIssue.
We don't want to count them as issues, since they're not issues in a
strict sense.
Follows https://golang.org/cl/69590
and ecd998cade.
Change-Id: Ia89e89e263626e661633f888c24070073f6fe567
Reviewed-on: https://go-review.googlesource.com/97797
Run-TryBot: Dmitri Shuralyov <dmitri@shuralyov.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
GitHub has docs on valid values. On many repos in the
GoogleCloudPlatform org, I observed that this field is indeed a string.
Change-Id: I19fd4871f741c6e44968ec7a2dda9f1ef93ae128
Reviewed-on: https://go-review.googlesource.com/96835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
As lint is moving to Gerrit for its source of truth, add it to the
appropriate whitelists.
Change-Id: I4ce4d9eb6ebd9dbe847a83030c71c38103116bc3
Reviewed-on: https://go-review.googlesource.com/96035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Previous versions were available via GerritProject.remote, but that
symbol is not exported and can't be used by callers of this package.
Update test for go-github API change in google/go-github#816, so the
tests can pass locally. Since go-github isn't vendored, it's understood
that the latest upstream version is targeted.
Change-Id: Ib4b78abacb19d73f95df2215b4a248a24376ae10
Reviewed-on: https://go-review.googlesource.com/95136
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Then use it from gitmirror and maintnerd.
Updates golang/go#23853
Change-Id: I8112f004638667894676c04fa218a7ced10422ac
Reviewed-on: https://go-review.googlesource.com/94836
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Adds an Owner() method to GerritCL that returns the GitPerson author of
the Gerrit change’s first commit, which is how Gerrit assigns the owner.
Updates golang/go#18517
Change-Id: I27cf185d5c68db44732170d583f1851491f2d8a3
Reviewed-on: https://go-review.googlesource.com/87157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
GithubIssueEvent added three new fields: Requested Reviewer, Review
Requester, and Dismissed Review. Parse these fields from the API JSON
and also handle them in the Protobuf file.
Fixesgolang/go#23151.
Change-Id: I07f2004f300223045636c3e32027468b29dd6329
Reviewed-on: https://go-review.googlesource.com/84375
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Demonstrate how to load data from a network source and how to load
data from a local disk source.
Change-Id: I1710eca8a1b3be7b7f7458de6aa5d3372934450a
Reviewed-on: https://go-review.googlesource.com/84377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Add *GitHubIssue.HasLabelID method to maintner API.
Since the text will change to “help wanted”, adjust the logic to
make it a bit more future-proof.
Updates golang/go#22329
Change-Id: I22e9f06d6e2aca8ae4da31532f9cde2317a709ff
Reviewed-on: https://go-review.googlesource.com/83297
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Currently the Dockerfile fails to build because maintner calls
github.Issue.IsPullRequest(), which was only added recently.
I'm not sure if we only want to update one dep (or if there is a way
to) or update all of them but this updates all of them.
Change-Id: I224074770512acfffbe18c8860a6361a5e78b2ff
Reviewed-on: https://go-review.googlesource.com/80475
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
As far as I can tell, the data structure inconsistency check that
panic-failed earlier has been fixed by the last few CLs (the
"finishProcessing" ones). The new tests double check.
Also, fix up Footer to not allocate by changing the requirement of its
argument.
And fix a failing test that was crashing due to its *Gerrit not being
initialized in a non-Gerrit test.
Fixesgolang/go#22753 (already fixed, but now tested)
Change-Id: If09cfad6f69d8b3c97410f3e4c3a2e2281c666a5
Reviewed-on: https://go-review.googlesource.com/78155
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We also need to call finishProcessing (added in golang.org/cl/77690) to whenever
we append to the mutation log.
Otherwise we never finish building data structures needed when
maintner is used in mutation-generation & API server mode.
Fixesgolang/go#22763 again.
Change-Id: I55270cd43f03bee0524df188c589ac01ab8fafda
Reviewed-on: https://go-review.googlesource.com/78540
Reviewed-by: Andrew Bonventre <andybons@golang.org>
A recent CL (golang.org/cl/77690) broke how labelChanges was
incremented. It needs to be renamed and tested, but this gets trybots
working again.
Fixesgolang/go#22763
Change-Id: I068fc66bbde283291191f41acdc436876232e88b
Reviewed-on: https://go-review.googlesource.com/78536
Reviewed-by: Andrew Bonventre <andybons@golang.org>
+ Adds a Footer method to maintner.GerritCL that returns the value
of a git footer with the given name.
+ Iterates through whitelisted GitHub repos and Gerrit projects
looking for changes to update. Handles the case where no update
is required.
Update: golang/go#18517
Change-Id: Id133df6956b7213752059a0b0e84dd76ee8ea620
Reviewed-on: https://go-review.googlesource.com/76374
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
A previous bug in maintner caused Gerrit ref meta updates occuring in
the mutation log before the git meta hash was added to the log. This
CL handles such entries. We add CLs to a dirty set when we see a ref
update and wait until the end of the mutations to parse the fields out
of the meta commits, at which time the git commits will have appeared
in the log.
Also, don't enumerate over private CLs in ForeachOpenCL, which I
thought was the same bug but turned out to be different.
Fixesgolang/go#22653
Change-Id: I79120f06b13c5e74c7761d04494215bf0da2e53d
Reviewed-on: https://go-review.googlesource.com/77690
Reviewed-by: Andrew Bonventre <andybons@golang.org>
For use in testing.
Change-Id: I2806cdad11da7075ff27a23091293a925576e09a
Reviewed-on: https://go-review.googlesource.com/69651
Reviewed-by: Sarah Adams <shadams@google.com>
All GitHub Pull Requests are Issues, but not all Issues are PRs.
Add a boolean field to track whether a GitHub issue is a Pull Request.
Update golang/go#18517
Change-Id: I5e61254f956ca90459ef0aafc4211fd3ee33f337
Reviewed-on: https://go-review.googlesource.com/69590
Reviewed-by: Sarah Adams <shadams@google.com>
Removed cmd/cl's dependency on godash (which was deleted recently), in
favour of using the Corpus to find open CLs.
Fixesgolang/go#21216
Change-Id: Idc748feb10c81c92ffab941d6d43abff9b93e9e4
Reviewed-on: https://go-review.googlesource.com/65770
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Make the naming a little more consistent.
Change-Id: Icd40d3818c490fa0bd1562a924a684d79c17c4a4
Reviewed-on: https://go-review.googlesource.com/59590
Reviewed-by: Andrew Bonventre <andybons@golang.org>
To easily get the name of the original author of a change.
Change-Id: Id006b6520fd72657252cbbf934aaf8fd10202fbf
Reviewed-on: https://go-review.googlesource.com/65073
Reviewed-by: Francesc Campoy Flores <campoy@golang.org>
When a push is made, the latest image is pushed to the registry
with the git hash of the repo and also the same image is pushed
with the :latest tag. This ensures that :latest always points to
the most recent image and that kubectl set image will trigger an
update on the pods without having to delete them.
Fixesgolang/go#21772
Change-Id: I97c893f181cdd8891eb87efb3f9ab42ede107d97
Reviewed-on: https://go-review.googlesource.com/61730
Reviewed-by: Sarah Adams <shadams@google.com>
When Gerrit emails are not sent, maintner polls Gerrit every
15 minutes. We can safely reduce this to every 5 min given the
relatively small number of bots using maintner and the current
quota of 0.2 qps per day that Gerrit permits for unauthenticated
requests.
Update golang/go#21192
Change-Id: I233bc50998927daedb34d81436e182579d2b4031
Reviewed-on: https://go-review.googlesource.com/57710
Reviewed-by: Sarah Adams <shadams@google.com>
There was a typo in the redirection code, causing invalid logic.
This change fixes it.
Change-Id: I71f1e98fff488689c988eb72a83b37e031d35b87
Reviewed-on: https://go-review.googlesource.com/56251
Reviewed-by: Kevin Burke <kev@inburke.com>
Fixesgolang/go#21383
Change-Id: I58582709fd83bb5c6ee452bdc7e53658f58dcad8
Reviewed-on: https://go-review.googlesource.com/54751
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
maintserve is a program that serves Go issues over HTTP, so they
can be viewed in a browser. It uses x/build/maintner/godata as
its backing source of data.
Note that it statically embeds all the resources it uses, so it's
possible to use it when offline. During that time, the corpus will
not be able to update, and GitHub user profile pictures won't load.
This is an iteration of an existing command named servegoissues,
with import path github.com/bradfitz/go-issue-mirror/cmd/servegoissues.
That program served the same purpose, but was located in another
repository. It used a "previous generation" approach to having
a corpus of GitHub issues data for Go projects, namely the
github.com/bradfitz/go-issue-mirror/issues package, which used
github.com/bradfitz/issuemirror technology.
The intent of maintserve is to replace servegoissues. It uses
the golang.org/x/build/maintner/godata package as its source of
data, which is built on top of the golang.org/x/build/maintner
technology.
Currently, maintserve has 2 types of pages:
- Index page, which lists repositories.
- Issues pages, which display a read-only version of issues.
This functionality is implemented in external issuesapp package.
By default, maintserve starts as an HTTP server at on port 8080,
so you should visit http://localhost:8080/ in a browser after
running the command. Note that the first run may take a while,
since godata.Get will need to download the entire corprus:
The initial call to Get will download approximately 350-400 MB
of data into a directory "golang-maintner" under your operating
system's user cache directory. Subsequent calls will only
download what's changed since the previous call.
Helps bradfitz/go-issue-mirror#7.
Depends on shurcooL/issues#5.
Change-Id: I421147df08c6f664afff0e70abb5d6aa6a42b2d5
Reviewed-on: https://go-review.googlesource.com/52932
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
"Dev" should refer to local development, not the staging server.
Change-Id: Icb02095ee24b7f890ca1c867a13cbdc45d1232bc
Reviewed-on: https://go-review.googlesource.com/52290
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
In https://golang.org/cl/51590 I tried to calculate the Run-TryBot and
TryBot-Result vote sums using the Gerrit NoteDB mirror we have in
maintner, but after two days of fighting it now, I've concluded it's
tricky. While I work on the tricky bits in parallel, this CL partially
reverts CL 51590, which had enough other cleanup and progress that it
wasn't worth reverting in its entirety.
Instead, move the Gerrit querying to maintnerd (instead of coordinator).
This isn't bad because maintnerd already queries Gerrit.
And coordinator will still be polling every second (introduced in
51590) instead of the old 60 seconds, but this CL now adds caching in
the RPC handler.
Change-Id: I80a519d9026a0981e3abf43d54a32b4684bda0e5
Reviewed-on: https://go-review.googlesource.com/51970
Reviewed-by: Kevin Burke <kev@inburke.com>
Instead of polling Gerrit every 60 seconds, poll maintnerd every
second. This should improve TryBot-requested to TryBot-running latency
by 30 seconds on average.
(Ideally it'd long poll for changes and not even have ~500ms delay,
but this is an improvement.)
Also, in the process this does most of the work for golang/go#17626.
And this cleans up the repo head tracking complication in the coordinator
and just asks maintner for it instead.
Running benchmarks in the coordinator has been disabled since
2017-06-23 but this CL disables it further, removing some code it'd
need to work. But considering that benchmarking would need code
repairs to get working again anyway, I consider this acceptable in the
short term. I left TODO notes.
Updates golang/go#17626
Updates golang/go#19871
Change-Id: Idab43f65a9cca861bffb37748b036a5c9baee864
Reviewed-on: https://go-review.googlesource.com/51590
Reviewed-by: Andrew Bonventre <andybons@golang.org>