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

149 Коммитов

Автор SHA1 Сообщение Дата
Kevin Burke 9673075136 all: fix "go vet" errors
The one remaining error reported by "go vet" is the un-canceled
context in cmd/coordinator/remote.go, which isn't an error.

Change-Id: Ie8d9269fc77203cf82d0a724dd33e4871a8113a7
Reviewed-on: https://go-review.googlesource.com/39350
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-03 19:14:46 +00:00
Kevin Burke f046a80fe0 maintner: fix tests
Capitalized a value and forgot to update the tests.

Change-Id: Idd5bd6fddc4e013d64cdd428dfcbfae137e945a1
Reviewed-on: https://go-review.googlesource.com/39034
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-31 01:06:28 +00:00
Kevin Burke f2033b7b87 maintner: add Gerrit statuses, ForeachOpenCL function
When we add a meta commit to the corpus, find the CL's status (buried
in the meta commit message or one of its parent commits) and store it
on the CL object.

Add ForeachOpenCL to allow callers to take an action for each open
Gerrit CL. This requires exporting the existing Gerrit and Git
structs.

Change-Id: Ic72721e437c0281244c2d6fb2eb5435f06a7acb5
Reviewed-on: https://go-review.googlesource.com/38724
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-31 01:04:46 +00:00
Brad Fitzpatrick 059b908c7e maintner: change representation of gitHash to string, intern them
Saves a tiny amount of memory, but many fewer allocation.

name   old time/op    new time/op    delta
Get-4     4.97s ±19%     5.22s ± 9%    ~     (p=0.421 n=5+5)

name   old alloc/op   new alloc/op   delta
Get-4    1.10GB ± 0%    1.09GB ± 0%  -0.67%  (p=0.008 n=5+5)

name   old allocs/op  new allocs/op  delta
Get-4     14.2M ± 0%     12.9M ± 0%  -9.38%  (p=0.008 n=5+5)

Change-Id: Ia4d383b7115a856de517002357c069e6b3eee7ef
Reviewed-on: https://go-review.googlesource.com/38782
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-29 06:37:34 +00:00
Brad Fitzpatrick 0f8fc131b7 maintner: replace author/committer regexp with manual code
regexp was 25% of the CPU. Now it's lost in the long tail.

Change-Id: Ifc522d0690dff2e2524ec12354d3790946e5a54a
Reviewed-on: https://go-review.googlesource.com/38725
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-28 04:24:07 +00:00
Brad Fitzpatrick 4f12dc098d maintner: replace gzip-based on-disk format with uncompressed format
The log file gets 50% larger, but loads in half the time.

Change-Id: I0b163f7b39269a5b39bbd51a80a4982682e94863
Reviewed-on: https://go-review.googlesource.com/38723
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-27 23:51:52 +00:00
Brad Fitzpatrick 5bc3f1f52e maintner: add maintnerd --config=go flag to auto-config flags for Go
Change-Id: I1cfdd0d426f4d149afc86fa97aafa4606fc2e89f
Reviewed-on: https://go-review.googlesource.com/38719
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-27 19:32:25 +00:00
Brad Fitzpatrick eadb1bff22 maintner: intern git commit messages
Many revisions of git commits in Gerrit have the same commit message.
Share that memory.

Saves 11 MB (387 MB -> 376 MB).

Change-Id: I39f05cf309404f0b1d55c296a2fe551eb501ae9c
Reviewed-on: https://go-review.googlesource.com/38718
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-27 19:32:14 +00:00
Brad Fitzpatrick 1cf306ea29 maintner: reduce some log spam during init
Change-Id: I373c9aa661132dbc190a4b479b8453d2f7341375
Reviewed-on: https://go-review.googlesource.com/38711
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-03-27 17:52:10 +00:00
Brad Fitzpatrick 945e2bd615 maintner: better gerrit commit syncing
Don't update Gerrit refs until after corresponding git commit
mutations are added and processed. Do the batching earlier, so we
always make forward progress.

Also better logging so you can see what's happening.

Change-Id: I493071af7bccec5abf156025389376b9fc182dc8
Reviewed-on: https://go-review.googlesource.com/38672
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-27 16:35:17 +00:00
Brad Fitzpatrick 7d42e13eca maintner: sync gerrit commits
Change-Id: Ia77fe7f509d9b9f8e211ae4fae7591b1182b8048
Reviewed-on: https://go-review.googlesource.com/38659
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-25 20:07:41 +00:00
Brad Fitzpatrick 2ceb757052 maintner: remove Corpus.StartLogging, rename processMutation to addMutation
StartLogging seemed unnecessary. And processMutation was special in
that it added to the log. The other dozen or so methods named
processMutation or similar were just about process mutations already
in the log. Disambiguate.

Change-Id: I4b4bf46c3ae7996ad5f7e06de5456f4c06b6bb40
Reviewed-on: https://go-review.googlesource.com/38658
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-25 04:01:36 +00:00
Brad Fitzpatrick d97cc62540 maintner: create and process ref change mutations
Change-Id: Ibed845bcbde65f72b0489640cc0571c8fae73a90
Reviewed-on: https://go-review.googlesource.com/38651
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-24 23:26:42 +00:00
Kevin Burke 92164ac215 maintner: initial gerrit support
Pass --watch-gerrit on the command line to watch a Gerrit project. We
initialize a Git repository in $HOME/var/maintnerd/<gerrit-url>, then
fetch all metadata related to that project, and store it in the
Corpus.

Change-Id: I47a8b5e5af2ae1b99c97cc756790c8e21465e8ee
Reviewed-on: https://go-review.googlesource.com/38421
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-24 21:34:29 +00:00
Brad Fitzpatrick 2be5d5482b maintner: return error before crashing in disk logger
Change-Id: Icb5ff719828172bf433ff50a5aef7759a1cb7596
Reviewed-on: https://go-review.googlesource.com/38449
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-22 17:10:08 +00:00
Brad Fitzpatrick 8b0924ee2f maintner, gopherbot: remove temporary rate limiting, log noise
Change-Id: I8374c22f1a135299d1203ef7b8b3195123375ddf
Reviewed-on: https://go-review.googlesource.com/38423
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-21 18:00:30 +00:00
Brad Fitzpatrick 3dedafea71 cmd/gopher: add new gopherbot binary, using maintner
The bot has the current functionality:

* auto-lock old issues and add the "FrozenDueToAge" label.
  (this CL deletes and moves the old "issuelock" code into here)

* auto-label and auto-milestone proposals (bugs with title prefix
  "Proposal:")

* auto-milestones "x/pkg: " bugs to "Unreleased" milestone unless
  the pkg is in a whitelist of packages known to be vendored into
  std.

* auto-milestones "gccgo" bugs to milestone "Gccgo"

* auto-labels builder bugs with label "Builders"

* auto-labels documentation bugs with label "Documentation"

* auto-closes bugs sitting with "WaitingForInfo" label state for
  a month if the original author hasn't replied

Change-Id: I6cb7bfd3ade5aab62ac4973b79cc733c9b1fbfb3
Reviewed-on: https://go-review.googlesource.com/38385
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-21 16:12:40 +00:00
Brad Fitzpatrick 8da4ff01d3 maintner: split Corpus.PollLoop into Corpus.Sync + Corpus.SyncLoop
This also adds a maintnerd flag --sync-and-quit.

And unexports some internal guts.

Change-Id: I4f2a491d830550576b285a2a7df6c89cc93c2312
Reviewed-on: https://go-review.googlesource.com/38384
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-20 22:55:50 +00:00
Brad Fitzpatrick b3a49f9ff3 maintner, maintner/godata, maintner/gostats: start library-itizing maintner
This renames some types to be exported (automated using gorename), and
then adds a package "godata" to get the Go project's current
maintner.Corpus (currently a stub implementation). It then adds the
start of a "gostats" command using "godata", moving some temporary
stuff from maintnerd in the process.

Change-Id: I31f7d7af6f60892317a9f55ae44106543bfb599d
Reviewed-on: https://go-review.googlesource.com/38377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-20 21:25:43 +00:00
Brad Fitzpatrick e7ad3dff98 maintner: wire up event sync
Also, handle "renamed" events.

Change-Id: I08f20281a87713c792ad496c4d04e6adeb7323c0
Reviewed-on: https://go-review.googlesource.com/38371
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-20 18:13:46 +00:00
Brad Fitzpatrick f34b7233b7 maintner: add GithubIssueEvent proto, githubEvent.Proto method, tests
More work on syncing issue events.

This adds a new GithubIssueEvent proto type, adds ways to go both from
and to the in-memory githubEvent type, and cleans up the event tests
added in 8927fdda9.

The next commit will wire it up to the syncing.

Change-Id: Ibdd9759dab432c6eaa4c37becfbb31f1ebf8f5b9
Reviewed-on: https://go-review.googlesource.com/38370
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-20 02:25:45 +00:00
Kevin Burke e7acc3168a maintner/maintnerd: add better help text
Change-Id: I28b83e45407fabdc9159366646c1c88b1e6b3b0e
Reviewed-on: https://go-review.googlesource.com/38339
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-19 05:21:06 +00:00
Brad Fitzpatrick 8cf2b3b8dc maintner: finishing implementing label and milestone sync
Change-Id: I9c8f68ea0ca52dfd7e04becd5263d5efbf17b704
Reviewed-on: https://go-review.googlesource.com/38334
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-18 23:41:05 +00:00
Brad Fitzpatrick 8927fdda90 maintner: sync all github issue attributes, start of Events, Labels, Milestones
More remains, but this is as good of a checkpoint as any.

Change-Id: I63f6b13508562143159e92d78fc4ef60070342ae
Reviewed-on: https://go-review.googlesource.com/38163
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-17 05:45:49 +00:00
Kevin Burke 956b48b34b maintner: use passed-in directory
Currently we set GOROOT in both AddGoGit and in PollGitCommits, which
seems like a mistake - the latter should use whichever directory has
been specified in the configuration.

Fix an error in a function title.

Change-Id: I7447d06a6914b68802ebfc5a19230a39b9b9a776
Reviewed-on: https://go-review.googlesource.com/38233
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-16 16:09:31 +00:00
Kevin Burke c24f967c20 maintner: pass through context
Change-Id: I15466e1a82663f3f4f5ba0ac81bebe5444538a0c
Reviewed-on: https://go-review.googlesource.com/38234
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-16 15:47:59 +00:00
Kevin Burke 1fe9f274d2 maintner: fix tests
One of the recent commits changed the nil value for Assignees when
a new githubIssue gets created.

I used github.com/kr/pretty to determine the diff after the
reflect.DeepEqual failed; it's pretty useful and would be handy to
have every time, though it would be another dependency to add.

Change-Id: I5d71296a6caf1776fd95c9991d798dc848152aaa
Reviewed-on: https://go-review.googlesource.com/38162
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-15 15:36:33 +00:00
Brad Fitzpatrick 8e7c0db023 maintner: sync Github issue comments
Change-Id: I2f4e5ac38e940461a9a3d694ce9268a5c73a4736
Reviewed-on: https://go-review.googlesource.com/38137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-14 18:10:04 +00:00
Brad Fitzpatrick b824d8af0b maintner: create githubRepoPoller type in prep for comments and events syncing
Change-Id: Iba6a8da9df9a0136a433c4704a822e6245627336
Reviewed-on: https://go-review.googlesource.com/38075
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-11 19:35:40 +00:00
Brad Fitzpatrick 28b6b14bfa maintner: make github issue importer reliably resume anywhere and finish
Including tombstomb records.

Change-Id: I026b1a26d6867bee59705b5200dde8f42a7ba6f6
Reviewed-on: https://go-review.googlesource.com/38004
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-11 00:26:40 +00:00
Brad Fitzpatrick d1cc7bf10a maintner: keep changed files from GitCommitMutation in memory too
And add a dummy query for fun.

Change-Id: Icc3f846691b83433f4b47d68b0a6c102be275ae9
Reviewed-on: https://go-review.googlesource.com/37994
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-09 21:32:51 +00:00
Kevin Burke bdccc45797 maintner: move files to github.go
No functional changes, just moving Github related code to its own
file.

Change-Id: I9600518142202c5519984564743a1996615d693a
Reviewed-on: https://go-review.googlesource.com/37992
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-09 21:08:54 +00:00
Brad Fitzpatrick a7d233fc8d maintner: import git commits
And some misc fixes & logging elsewhere.

Change-Id: I10c9ae237a7d492173a10897938b147f5c1cb03c
Reviewed-on: https://go-review.googlesource.com/37972
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-09 18:53:09 +00:00
Brad Fitzpatrick 147e896835 maintner: start of git polling (just proto and maintner plumbing, no git)
This is just the start of git commit metadata importing, but without
any of the git-specific bits. This is just the proto changes and the
changes to wire up the guts with maintner. The guts will come in a
following CL.

Change-Id: I321590dc30ba5c62346911526fed647fc0d0b3ad
Reviewed-on: https://go-review.googlesource.com/37938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-08 05:51:05 +00:00
Kevin Burke db193c8feb maintner: add github ID field
Change-Id: Ia497734b786c4e013a5dc3b0982ad068de23138c
Reviewed-on: https://go-review.googlesource.com/37888
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-07 17:41:52 +00:00
Kevin Burke c6b4b62f21 maintner: skip duplicate id's when paging
Due to the design of the github paging API it's possible to process
messages twice in the same paging run, which can lead to early
termination since the second run of the message will have the same
"UpdatedAt" as the first time we saw it. Keep track of messages we've
seen before in this paging run and ignore them the second/third times
we see them.

Also skip subdirectories of the `--data-dir` argument; we don't want
to search any other directories for data files than the one provided.

Change-Id: Ib4b867cc50568f7bfc5a3d3a0158e284d2038808
Reviewed-on: https://go-review.googlesource.com/37794
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-06 23:45:29 +00:00
Kevin Burke 8cb8408587 maintner: add more fields
This should comprise most of the fields that are needed by the
existing godash/devapp app. Will wire up the Milestone code in
another commit.

Change-Id: I83c399afebce5865dd03c00e295be5a19e1e36b2
Reviewed-on: https://go-review.googlesource.com/37753
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-06 22:36:29 +00:00
Kevin Burke 4072d545df maintner: catch up mutations from disk
Eventually we will add other mutation sources but for the moment
let's catch up from the same proto directory we are writing changes
to.

Change-Id: I6efa3c0fb6f49cf4240d8a365f558bbb1c52602e
Reviewed-on: https://go-review.googlesource.com/37733
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-03 05:20:49 +00:00
Kevin Burke 42a091f0b0 maintner: fix context usage
If the context returns, immediately return from the function instead of
continuing to sleep. Also, remove deprecated oauth2.NoContext.

Change-Id: If92c18d9d4dc1a801be8df5ad2e78ae809b9f274
Reviewed-on: https://go-review.googlesource.com/37650
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-01 20:08:52 +00:00
Kevin Burke 9fd5f30c83 maintner: flush protobufs to disk
For now, open and close the file each time we write a protobuf. We can improve
the performance in the future as necessary.

Change-Id: Idcc75df5aa59a604c0c0aeeff6ea0e0ff0f2db8f
Reviewed-on: https://go-review.googlesource.com/37626
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-01 19:33:50 +00:00
Kevin Burke d71f595a20 maintner: start adding issue bodies to the corpus
When we get an issue from Github, add the issue and associated
details to the Corpus. Check whether the `Updated` timestamp on an
issue is newer than the one we have in the Corpus; if the timestamp
is the same, we can stop processing since we are sorting by the
updated date and no older issues will have new data.

If the mutation changes the Corpus, add it to an array of Mutations
that we will eventually flush to disk.

Adds a helper function to convert a github.Issue into a
maintpb.Mutation - this way we can reuse the logic for adding data to
the Corpus. Adds some more tests around data processing.

Change-Id: I9475e293941784179420ca7b638917943be1f29e
Reviewed-on: https://go-review.googlesource.com/37490
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-28 18:56:24 +00:00
Kevin Burke 7ebe3f6394 maintner: wire up maintnerd and PollGithub
Now you can actually pass repos to maintnerd and tell a Corpus to
track/store them. Adds a hook to "catch up" a given repo, though it's
unimplemented at the moment, so all requests hit the API. Also only
Github is implemented.

Change-Id: Ib074c02437d6530fc8d57dd433486c05cd75ee64
Reviewed-on: https://go-review.googlesource.com/37299
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-24 21:54:39 +00:00
Kevin Burke b1e8ca238f all: add contexts to go-github calls
The latest master for go-github (google/go-github@23d6cb9c) adds
Context parameters as the first argument to every function call.
Update code that calls go-github to have contexts, where appropriate,
and adds timeouts to some long-running commands that didn't
previously have them.

Fixes golang/go#19208.

Change-Id: I25203de5d10ada1dcd3a97eb5434a85bb328ce7e
Reviewed-on: https://go-review.googlesource.com/37293
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-24 21:54:04 +00:00
Brad Fitzpatrick 776028b858 maintner: start of github polling
WIP; not functional yet, but submitting so
Kevin can continue if he wants.

Change-Id: I1dab38f9845ebcbd69ec2a6f07e98793d3ed7cfb
Reviewed-on: https://go-review.googlesource.com/37053
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-19 18:03:21 +00:00
Brad Fitzpatrick 927294fed0 maintner: process a github new issue mutation, start of tests
Change-Id: I92b9d5b8ddce6b48ede67e5d5ec97c1a07d17e06
Reviewed-on: https://go-review.googlesource.com/36901
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 16:14:50 +00:00
Kevin Burke 014d9970b6 maintner/maintpb: use google.protobuf.Timestamp
Add $GOPATH/src to the --proto_path so we can import the google
Timestamp definition instead of redefining a copy in our tree.

Change-Id: I09c3554fb025a32c9db4892b702ee2bedb3c0e53
Reviewed-on: https://go-review.googlesource.com/36899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-12 18:23:36 +00:00
Brad Fitzpatrick 49a8dd97b8 cmd/maintner: start of in-memory data structure & processing mutation log
Change-Id: Id48171287b23dd88ab14912bafb3a71e942a866e
Reviewed-on: https://go-review.googlesource.com/36896
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-12 17:03:33 +00:00
Brad Fitzpatrick 279f0d275b maintner: start of proto file
Change-Id: I94f1bdc212ebb5565690df61deebc57dfcefa58e
Reviewed-on: https://go-review.googlesource.com/36895
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-12 06:43:17 +00:00
Brad Fitzpatrick b1ddf2bf7d maintner: start of package maintner and server maintainerd
This will be a package and server for working with Git, Github, and
Gerrit data.

Change-Id: I12c04d31c792d6cf752ce63b05a0b155d1f53f26
Reviewed-on: https://go-review.googlesource.com/36554
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-08 06:23:05 +00:00