Add the commit summary to GitHub change notifications,
to make it easier for casual followers to decide whether
it's worth following the link.
While we're here, switch from "CL" to "change"
and clean up a few comments.
Change-Id: I76eedabb79849f0db977ce1f9515e1fcd3fcdf16
Reviewed-on: https://go-review.googlesource.com/51116
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Adds two new functions to maintner:
+ (*GerritCL).Subject() returns the first line of the latest
commit message.
+ (*GitHubRepo).ForeachMilestone calls a passed function for each
milestone in the repo.
Change-Id: I08c50ea53b781064c8ab2ddaff2177f51ebb091d
Reviewed-on: https://go-review.googlesource.com/50652
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I got into a case where "make docker-prod" on cmd/gopherbot failed because
the "git reset --hard XXXXXX" hash didn't exist in my repo and it
wouldn't be downloaded by the "go get -d" because it seemed to already
exist from a previous "go get -d" (since -d also includes downloads
deps, but the cached step had downloaded older deps than required.)
That is, if we needed repo FOO at rev1 and repo BAR at rev2 and previously had:
RUN go get -d FOO && git reset --hard rev1
RUN go get -d BAR && git reset --hard rev2
... and FOO depends on BAR, the first step was downloading and caching
FOO & BAR both at rev1, and then when the "go get -d BAR" line ran, it
was doing nothing, since BAR was already downloaded, but then the "git
reset --hard rev2" was failing.
This now generates output that's robust to that case.
Change-Id: I95502d5b3c853eea3f971e47d63abc61c6809c8e
Reviewed-on: https://go-review.googlesource.com/50633
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Previously we assumed that Gerrit issued CL numbers in sequential
order: If it issued CL N, any new CL would be in the range [n+1, ∞).
However, observation shows this not to be true; I submitted a number
of CL's just now and got this ordering: 49910, 49911, 49891, 49852.
This explains why there are ten people who have yet to be
congratulated for submitting their first CL: Gerrit issued a newer
CL number and we ignored any CL's older than that. I didn't catch
this in testing because I wasn't running in daemon mode locally, so
mostRecentCL was always 0.
Change-Id: I822ca12a093bd6c186701a4d49b47b2671bcee8a
Reviewed-on: https://go-review.googlesource.com/49853
Reviewed-by: Jessie Frazelle <me@jessfraz.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
It's nice to encourage people who submit their first CL, and I figured
we could provide them useful info - the things Josh usually emails to
new contributors.
Parse Author information from Gerrit commit messages, so we can check
whether Gopherbot sent a given message (instead of another user).
Also fix a TODO involving the ordering of messages appended to
a GerritCL.
Change-Id: Ifde950ac08d76a6b4c50c356697068c6d6beb0d7
Reviewed-on: https://go-review.googlesource.com/46390
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
+ Add UpdateWithLocker method to maintner.Corpus to allow an
external locker to be passed that will be held during mutations.
+ Add OwnerID to maintner.GerritCL that returns the Gerrit user ID
of a change using its meta commits.
+ Add maintner corpus to server.
+ Add /imfeelinglucky and /imfeelinghelpful endpoints that redirect
to a random HelpWanted GitHub issue.
+ Add initial scaffold for GopherCon dashboard.
Change-Id: I2567b084f012cad5a9b4dee07e92be05088ac9d8
Reviewed-on: https://go-review.googlesource.com/47830
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
CL 46838 added the update-needs task, to remove the prior NeedsFoo
label when NeedsBar was added.
Prematurely worrying about making it cheaper, I added some last
modified tracking code to avoid running a task on an issue if it had
already been run before the issue was last modified. For unknown
reasons, that code didn't work and this task wasn't being run. Add a
TODO for now, and avoid it. Use a different check to keep it cheap
instead.
Also adds a maintner.GitHubIssue.ForeachLabel method I used to find
label IDs. Not used otherwise, but might be useful later.
Fixesgolang/go#20819
Change-Id: Ia6260661310c9f25a99b256bbf4d398853271577
Reviewed-on: https://go-review.googlesource.com/47134
Reviewed-by: Andrew Bonventre <andybons@google.com>
If we got a webhook update, we know there's new data. We're not in
polling mode, so don't use the caching transport.
The caching transport was being too agressive and we were missing
label changes to issues, since the Issues.ListByRepo call to get
issues sorted by mod time descending was being cached.
This speeds up gopherbot. Gopherbot can react in realtime to changes,
but only if they make it into maintner in realtime.
Updates golang/go#20819
Change-Id: I5c0a0bbcb4bf0d9d484b9279ff5a80732b4e1269
Reviewed-on: https://go-review.googlesource.com/47133
Reviewed-by: Andrew Bonventre <andybons@google.com>
Currently maintnerd prints
2017/06/17 15:00:16 Unknown error type <nil>: <nil>
if it successfully downloads a file. It shouldn't log if there was no
error.
Change-Id: I01c4f2bde616d709d5c081219f9c123d6ea6a678
Reviewed-on: https://go-review.googlesource.com/46007
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is "Airplane mode". I had cached the latest maintner data before
a flight, but using godata.Get in flight failed when it tried to
update it.
Instead, detect the lack of network and just use whatever's available
instead.
Change-Id: Ieea29f844353377b3c36a531642a716f91f34436
Reviewed-on: https://go-review.googlesource.com/44813
Reviewed-by: Kevin Burke <kev@inburke.com>
The contents of a Gerrit reply are stored in the body of the commit
message for a meta commit, but we currently ignore them. Parse the
message text when we walk the tree of meta commits, and return it when
we return a CL.
The API returns these in very raw fashion - what you see in a reply
in the UI is what you get in the git commit. We don't do any parsing
either. We could add helpers on the GerritMessage object to try to
return you better formatted information.
To see what the API returns for these messages, visit this URL:
https://go-review.googlesource.com/changes/42180?o=MESSAGES. The
messages attached to a specific line and file are stored a different
way and returned via a different API. It's trickier to get those so
I'll add them in a separate commit.
Change-Id: Ibd56fb828c225b57650157d08b27034ece75848a
Reviewed-on: https://go-review.googlesource.com/42452
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We previously tried to have the invariant that a Gerrit ref mutation
never was recorded in the log until all its reachable commits were
already recorded in the log.
But due to unknown bug(s) in the past, that wasn't the case.
This adds a fix-up step to the beginning of sync. The new maintnerd
--config=devgo config type has made testing this both possible and
easy: devgo clones the live config and then starts running locally
from that point. Then the existing --sync-and-quit flag now also adds
a Check step at the end. Everything checks fine now, so I think the
invariant violation has since been fixed. At least if it recurs, we'll
catch it now.
Change-Id: Ia6cfd4ff8d793904472f4f07d6eef9cb4eb3afb8
Reviewed-on: https://go-review.googlesource.com/44090
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This makes maintnerd development easier. The new "devgo" config is
like the production "go" config, but syncs the production data to
local disk before starting, so there's no crazy storm of sync activity
at the beginning.
Change-Id: I7602d7327878683f26e6a5e94c617c01143fbd67
Reviewed-on: https://go-review.googlesource.com/43615
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Also, update docs on how to re-generate.
Switches to using go4.org/grpc and go4.org/grpc-codegen/protoc-gen-go4grpc
for now.
Updates golang/go#19866
Updates golang/go#20222
Change-Id: Ifa8a123fca2a30f17270c3c558b7395a02064eae
Reviewed-on: https://go-review.googlesource.com/43560
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
For upcoming API development, permit running maintnerd in non-syncing
(no new mutations logged) mode, using only the data from the godata
package.
Updates golang/go#19866
Updates golang/go#20222
Change-Id: I8c66c7f5e29b5702b481da0fec8f270f93f484a9
Reviewed-on: https://go-review.googlesource.com/43557
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Fix a stupid bug fortunately found before production.
Add the test that caught it.
Updates golang/go#20222
Change-Id: Ie988d80dec18e5d0fede7a31e3b6cce62b050f5f
Reviewed-on: https://go-review.googlesource.com/43555
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
maintnerd will have an API to query this in a subsequent CL.
Updates golang/go#20222
Change-Id: I3cb0ce2897eea782f627c2e27c4d02ef0eb6c66b
Reviewed-on: https://go-review.googlesource.com/43554
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Addresses a TODO in the code, and removes the old 2 second poll loop.
Change-Id: Id698307bd7404e8ca3946fa16621674cca2eca6b
Reviewed-on: https://go-review.googlesource.com/42871
Reviewed-by: Kevin Burke <kev@inburke.com>
The lastUpdated field can only be used by the sync goroutine, but we
did labels and milestones concurrently in their own goroutines.
Remove the update because it was redundant with the caller's update
anyway.
Noticed in:
https://github.com/golang/go/issues/19866#issuecomment-299136538
Change-Id: I4b0270a00eaf2994ed096631e24a7bd75d0210ab
Reviewed-on: https://go-review.googlesource.com/42615
Reviewed-by: Kevin Burke <kev@inburke.com>
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 matches GitHubRepo.Issue(n) on the GitHub side.
Also document some public API's that lacked documentation.
Change-Id: I88d9ef924bfec9048c5741fb7f6098e283ac3290
Reviewed-on: https://go-review.googlesource.com/42451
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This started failing when we removed
corpus.QueryFrequentlyModifiedFiles. Instead replace that function
with a similar one that uses the Foreach functions.
Change-Id: I243975b7638f8e74c8364804bc1f1c752367cb8b
Reviewed-on: https://go-review.googlesource.com/42183
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Previously we checked for Status: flags that were indented by
4 spaces. I think this is from me running "git log" which indents
4 spaces in the UI. On disk, the messages are not stored with leading
spaces.
Verified this is correct by fetching the corpus with godata.Get,
finding a CL in the Corpus and verifying it had the correct status
set.
Change-Id: I7439c2e92f244a6f780e5f84429dd116b6d83090
Reviewed-on: https://go-review.googlesource.com/42450
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When resuming from a point, the reclog reading code would double check
the record headers offsets but because netsource MutationSource would
seek on the *os.File, what reclog saw and expected didn't match what
it read.
Also move temporary 5 second sleep to 2 seconds and adjust some
logging.
Updates golang/go#19866
Change-Id: I66d1f9df8bb36cf028b715ddd284cb10bc74b45b
Reviewed-on: https://go-review.googlesource.com/42184
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
I forgot to add this in the prior commit.
Change-Id: Ia1502c0090745c5d1023df5fd4149a9ac2dfe735
Reviewed-on: https://go-review.googlesource.com/42181
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Also, the maintner.Corpus constructor is now gone. An API is added for
maintnerd to become the leader and specify the cache dir.
Updates golang/go#19866
Change-Id: Ia726aa00ca1337b6c130cfee040ff9a1f935d0c2
Reviewed-on: https://go-review.googlesource.com/42148
Reviewed-by: Kevin Burke <kev@inburke.com>
Sometimes Github sends a webhook update (which we only use as a
wake-up signal, ignoring the payload), but when we go to run our
sync-from-last-position code, we get cache hits from GitHub indicating
that nothing's new. It seems that GitHub sends webhooks before
invalidating its own caches.
This causes us to sometimes lose updates for 15 minutes until our
regular backup poller catches them.
So, keep track of whether we've been woken up by the webhook and are
currently awaiting new data. If the subsequent poll finds nothing,
assume it's bogus and reset our poll interval to be 1 second, growing
exponentially until either we're back at 15 minutes or we have new
data.
Change-Id: Iff38517a8a8773eb13323870a80e0855084a58ef
Reviewed-on: https://go-review.googlesource.com/41392
Reviewed-by: Kevin Burke <kev@inburke.com>
You can trigger this by creating a Corpus and only adding Gerrit
repositories to it. These call parseGithubRefs, but c.github.repos
is never initialized, so that function panics when you try to get
c.github.repos.
I'm a little worried I've triggered two of these recently; maybe it's
worth it to initialize the data structures earlier instead of
lazy-loading them.
Change-Id: I8f80c0947d320aef0dd9391586c306460ac77eea
Reviewed-on: https://go-review.googlesource.com/41305
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We print the entire reponse from Github when we log messages about how
many comments were found, which seems unnecessary - the most useful
bit of information is the number of comments found. Also print the
issue number we're fetching comments for.
Change-Id: I5eca0ea1e4ea737642a535b61a8dd65838b44773
Reviewed-on: https://go-review.googlesource.com/41301
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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>
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.
Fixesgolang/go#18818
Updates golang/go#19776
Change-Id: Ie5f7f6845317a7c39cc36d7397c7539bf99c3f92
Reviewed-on: https://go-review.googlesource.com/39352
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
It's starting to pollute the package, and seems separable. I also plan
to use it more from elsewhere in upcoming CLs.
Updates golang/go#19866
Change-Id: I7b2add37f74ed42c2f78939924f19d8322179823
Reviewed-on: https://go-review.googlesource.com/40868
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Replace oauth2.NoContext (deprecated) with context.Background(),
which has been available for two consecutive releases.
Add more cloud.google.com/go packages to the cmd/coordinator
Dockerfile to fix an error building cmd/coordinator. A dependency is
not present in master of cloud.google.com/go, but was present in the
older revision, and was not getting checked out correctly during the
"go get" step. In addition, we were failing to fetch dependencies for
some packages that coordinator depends on. I added instructions for
hopefully doing this more systematically in the future.
Fix the gitmirror Dockerfile which has the same problem.
Change-Id: Id6c2220482350a686b87742ec7915c457a689e52
Reviewed-on: https://go-review.googlesource.com/40852
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Adds a Dockerfile and Makefile so maintnerd can be deployed to GKE.
Updates golang/go#19866
Change-Id: I83d8d409c2acab3022c2b74516157d32515fe28b
Reviewed-on: https://go-review.googlesource.com/40478
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
Fixesgolang/go#19208.
Change-Id: I25203de5d10ada1dcd3a97eb5434a85bb328ce7e
Reviewed-on: https://go-review.googlesource.com/37293
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
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>
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>
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>