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

14 Коммитов

Автор SHA1 Сообщение Дата
Brad Fitzpatrick 1a1ef8e92a maintner: support for updating corpus in-place from its mutation source
And update godata package docs.

Change-Id: I781e50b20dfa1494fa7d65400cff8a2637ecf9e0
Reviewed-on: https://go-review.googlesource.com/42174
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-04-30 21:30:16 +00:00
Kevin Burke 022bf90f00 maintner: fix un-initialized github panic
Previously processGithubIssueMutation called initGithub, but
processGithubMutation did not, so if your on-disk mutation file had
a GithubMutation before a GithubIssueMutation, c.github would be nil
and Initialize() would panic.

Call initGithub from processGithubMutation and add a test to protect
against regressions.

Change-Id: Ie706fa04cb8ea87c2e0259dbee024c0005f0523f
Reviewed-on: https://go-review.googlesource.com/41298
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-21 05:53:41 +00:00
Brad Fitzpatrick 1eecef36c8 cmd/gopherbot: mention gerrit CLs on Github (cl2issue port)
This adds indexing of Github mentions to maintner, then adds gopherbot
functionality to say "CL https://golang.org/cl/NNNN mentions this issue."
on Github when a Gerrit CL references it.

Also the start of the cherry-pick milestone bot which needs the same
Github issue reference tracking. But that part's only barely started
and still disabled.

Fixes golang/go#18818
Updates golang/go#19776

Change-Id: Ie5f7f6845317a7c39cc36d7397c7539bf99c3f92
Reviewed-on: https://go-review.googlesource.com/39352
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-18 05:39:29 +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
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 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 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
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 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
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 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
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