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

517 Коммитов

Автор SHA1 Сообщение Дата
Julie Qiu 20d68f94ee README.markdown: add archive note
Change-Id: I2109156753cecc7d4664a47ecba096fdf9bc86b6
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/282132
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-15 22:23:49 +00:00
Julie Qiu 17b648fae2 gddo-server: redirect invalid import paths to homepage
When a URL path for a package page fails the check for
module.CheckImportPath, redirect to the homepage. Otherwise, the page
will 400 on pkg.go.dev.

Change-Id: Ic337b968a3919b2e4fcd0ab4dd6b76c631f5edf9
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/279035
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-22 20:49:13 +00:00
Julie Qiu 5b05951d42 gddo-server: change redirect for github.com/golang/go requests
Requests to github.com/golang/go and github.com/golang/go/src are now
redirected to pkg.go.dev/std.

Requests to github.com/golang/go/src/<path> are redirected to
pkg.go.dev/<path>.

Change-Id: Iaf9f52d17fc19c3e6c325c260de3f070da32a21b
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/279036
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-22 15:09:50 +00:00
Julie Qiu 9cf165be3e gddo-server: fetch path on pkg.go.dev 404
When a godoc.org requests results in a 200, but a 404 on pkg.go.dev,
make a fetch request to pkg.go.dev to fetch that path and log the
output.

Change-Id: I1ca12732317d7e90b42eff022357067d21f84f9b
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/279038
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-22 15:05:20 +00:00
Julie Qiu c1279c47a3 gddo-server: delete unused teeproxy code
Code used to tee traffic from godoc.org to the pkgsite teeproxy is
deleted, since requests are now teed directly to pkg.go.dev.

Change-Id: Icf89a310afec7cb225e5e88be6b1265fc4bee4f5
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/279037
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-22 15:03:36 +00:00
Julie Qiu 137aa8055c gddo-server: fix requestEvent reference in pkgsite_test.go
gddoEvent was incorrectly renamed to requestEvent in CL 274860, which is
now fixed.

Change-Id: I16b2cb483994fbe3a2adddf800fcf712b31c54b4
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/279034
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-22 14:58:17 +00:00
Julie Qiu 41221c318e gddo-server/assets: update banner
Banner is updated to have a separator in the middle, which looks better
for centered content per UXD.

Desktop:
https://photos.app.goo.gl/5ZkmLqi8RCDRRPc69

Mobile:
https://photos.app.goo.gl/Lf8aw5yWuaB6kGe68

Change-Id: I635e9a19133f66d7a58192ae70f21dd0913b2901
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/278412
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2020-12-15 22:25:38 +00:00
Julie Qiu 56ec5ff55f gddo-server/assets: update banner
The banner for godoc.org is updated to this design:

https://photos.app.goo.gl/sm8w3QFF4ewoJUNu9

Change-Id: Iaf7e12218ace5d1f87c6d0131b86f71d4835406b
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/278152
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
2020-12-15 14:54:37 +00:00
Julie Qiu 9ad718532e gddo-server: make GDDO_TEE_REQUESTS_TO_PKGGODEV case insensitive
Change-Id: I0dbde3213cee1e29631a5e68fee75e396c2253e4
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/277853
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-14 15:28:14 +00:00
Julie Qiu c082ee0db1 Revert "gddo-server/assets: update banner"
This reverts commit 8691e18f09.

Reason for revert: split deploy of teeproxy and banner changes

Revert CL 274698.

Change-Id: I611e450d5dd0fd059a6df49b1e1e5a6cb003eefb
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/277112
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-14 14:50:52 +00:00
Julie Qiu 981f437512 Revert "gddo-server/assets: bold redirect text"
This reverts commit b853219a43.

Reason for revert: split deploy of teeproxy and banner changes

Revert CL 275872.

Change-Id: I8176626e2232066f8a481ee6735e8e633b3af642
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/277113
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-14 01:53:01 +00:00
Julie Qiu b853219a43 gddo-server/assets: bold redirect text
Text on the right side of the banner is bolded to emphasize
"Always use pkg.go.dev".

Screenshot:
https://photos.app.goo.gl/nNeRP8zpwi4jGuGk6

Change-Id: I97a7a6b10a5710810e9a9c652d8012492f3e4d95
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/275872
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
2020-12-07 18:38:08 +00:00
Julie Qiu 192af15289 gddo-server: tee requests directly to pkg.go.dev
Change-Id: Ibe8c66efd7771421709695e94a94eb5e945ba5f4
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274860
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-07 17:17:09 +00:00
Julie Qiu feca416606 gddo-server: update PkgGoDevURL logic
The logic for PkgGoDevURL is updated:

- The ?tab=doc query param is removed
- The ?tab=packages query param is removed
- Requests for the godoc.org badge SVG are teed to the pkg.go.dev badge SVG
- Requests to godoc.org/C are explicitly teed to pkg.go.dev/C

Change-Id: If5bd6259a88e921b8175e993ea574ea47947e1ca
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274859
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
2020-12-04 15:44:23 +00:00
Julie Qiu 5a29c6c017 gddo-server: do not tee expected 404s
When a request is expected to 404 even after we redirect godoc.org to
pkg.go.dev, don't tee that request.

Change-Id: I1640bb2886ccdd55b2790f3b8d58b2d32eca8418
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274699
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-04 04:32:44 +00:00
Julie Qiu 8691e18f09 gddo-server/assets: update banner
The banner for godoc.org is updated based on designs from b/172852539.

Screenshot:
https://photos.app.goo.gl/FZB7VBo8ZKjQqhhh9

Change-Id: Idd7709ee292843f59528d5c7a380bbaaba06bb84
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274698
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-03 16:56:13 +00:00
Julie Qiu 6c736bab91 gddo-server: redirect /-/subrepo to pkg.go.dev/search?q=golang.org/x
Request to /-/subrepo are not redirected to
pkg.go.dev/search?q=golang.org/x instead of pkg.go.dev.

Change-Id: I582271b112a0ce482bedfd822523cf7e4dbc9059
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274697
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-03 16:55:48 +00:00
Julie Qiu 4ab63e739b gddo-server: move code related to pkgsite to pkgsite.go
Pure code in motion.

Change-Id: If883c14b0d7ca1ced8298980111e11cea9614510
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274696
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-03 16:55:33 +00:00
Julie Qiu d214db1b1f .gitignore: add
Add .gitignore for files generated when running the gddo-server.

Change-Id: Ifaef00ef42f3fb258acf747f02eb2d7787bce941
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/274695
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-03 16:55:29 +00:00
Julie Qiu 721e228c76 gddo-server: send status to teeproxy
Previously, the godoc.org request status was not being sent to the
teeproxy. This is now fixed.

Change-Id: I90c33ee3fe0f75cbbff42b5d6b16b29bd3a1dd2d
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/249961
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-08-31 20:25:55 +00:00
shaquilleq 051695c33a gddo-server: remove RedirectHost field from gddoEvent
With golang.org/cl/242097, the teeproxy no longer needs
the RedirectHost field from gddoEvent.

Change-Id: Iaf1647d7939084b2bf2d41816d259c7c274283dc
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/242098
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-15 22:42:05 +00:00
Andrew Bonventre a4829ef132 gddo-server/assets: add Black Lives Matter banner
Change-Id: I14308b23539760cd54577daabc7617eb40c75e6e
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/237601
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-11 22:36:18 +00:00
Andrew Bonventre 845892271f gddo-server: account for vendor dirs in pkg.go.dev redirect
Pkg.go.dev does not support documentation for vendor directories.
When showing the corresponding pkg.go.dev link in the header or
when automatically redirecting, change the destination to be the
pkg.go.dev homepage instead of a vendor link that will 404.

Fixes golang/go#38671

Change-Id: Ic7d221d3cc7fef352f5c7097a667fb8dd2ad0340
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/233839
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-04 15:50:40 +00:00
shaquilleq b32b9ce48b gddo-server: parse host and url from request correctly
Most browsers send requests to http://godoc.org/net/http as

GET /net/http HTTP/1.1
Host: godoc.org

instead of as expected in current tests

GET https://godoc.org/net/http HTTP/1.1
Host: godoc.org

This causes http.Request.URL to have empty strings for the "Scheme" and
"Host" fields (see https://golang.org/src/net/http/request.go#L120 and
RFC 7230 Section 5.3). As a result, server logs show most gddoEvent
structs as having an empty "Host" field and a relative path for the URL.

This CL enables the parsing of these fields from the other fields of the
http.Request struct.

Change-Id: Iab923a0d9a70f32f36b6e4a15019afc648699796
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/236143
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-06-03 21:19:29 +00:00
shaquilleq c44e1e4587 gddo-server: add UsePkgGoDev field to gddoEvent
This boolean field will reflect whether the godoc.org request was
redirected to pkg.go.dev.

Change-Id: I521c98e7342f5880021bd215640adb570935cb06
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/235957
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-06-01 19:02:05 +00:00
shaquilleq ce9b42df4e gddo-server: don't tee /_ah/* requests to pkg.go.dev
Currently, requests to App Engine admin paths at godoc.org/_ah/* are not
redirected to pkg.go.dev.

This change stops making a POST request to the teeproxy when a user
visits any of the admin paths.

Change-Id: I77f39b8289eab1086bc987adb218ee55ed48c919
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/235519
Reviewed-by: Julie Qiu <julie@golang.org>
2020-06-01 15:47:24 +00:00
shaquilleq 8d077c1d8f gddo-server: add isRobot field to gddoEvent
This will indicate whether the request to pkg.go.dev was made by a
robot.

Change-Id: I64931b9ff8a4da575d0614771a0575f2bd0746a0
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/235448
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
2020-05-28 16:03:55 +00:00
Dmitri Shuralyov a4ebd2f7e5 gddo-server: add a semaphore to limit concurrent graph requests
There should be an upper bound for the number of "dot" processes
that can be started concurrently in order to serve incoming HTTP
requests for the ?import-graph pages, to help avoid resource
exhaustion and server overload.

This change implements a limit of 10 such processes at once.

Change-Id: I65d01996461ae212bb84cfd8edfbe6fcec43c329
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/234637
Reviewed-by: Robert Findley <rfindley@google.com>
2020-05-19 22:42:40 +00:00
Andrew Bonventre 3c2cc9a632 gddo-server: add utm_source to pkg.go.dev redirect URLs
This will reliably indicate to pkg.go.dev that a request is due
to the automatic redirect logic.

Additional logic is added for more accurate mapping of
godoc.org -> pkg.go.dev URLs.

Updates golang/go#37099

Change-Id: Iba380a3b5951d50576c17711990d0ba87857b926
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/224659
Reviewed-by: Julie Qiu <julie@golang.org>
2020-03-24 18:43:33 +00:00
Andrew Bonventre 95ce5a4522 gddo-server: add UI to turn on/off redirect to pkg.go.dev
This change adds UI for the option to set a cookie and have
candidate godoc.org links redirect to their equivalent pkg.go.dev
counterparts. If a user returns to godoc.org with the utm_source
form value equal to 'backtogodoc', it will display an option to
turn off the automatic redirect.

The intention is to have a link on pkg.go.dev that allows the
user to return to godoc.org and also turn off the automatic redirect
without having to know the special URL param values.

Updates golang/go#37099

Change-Id: I27bd03cbc484a1e504795ff669224c2a2a7d72b6
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/222315
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-03-10 00:49:57 +00:00
Andrew Bonventre df439dd581 gddo-server: add request headers to gddoEvent
Change-Id: I70b47b3bca5fea3b160fb850a3f27e8563348b5a
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/219957
Reviewed-by: Julie Qiu <julie@golang.org>
2020-02-19 17:57:27 +00:00
Julie Qiu 23683d71bb gddo-server: tee requests to pkgGoDev
At the end of a request to *.godoc.org, an additional request is made
to the teeproxy for pkg.go.dev containing data about the request.

These requests are used to collect data about godoc.org, and ensure that
all incoming traffic to godoc.org can be handled appropriately by
pkg.go.dev.

Change-Id: Ib0b92b81c2a361f5b6a1813ddc62d090edbe4ba1
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/219017
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-02-14 15:09:28 +00:00
Gopher 31dd61dfab gddo: add option to redirect requests to pkg.go.dev
Updates golang/go#37099

Change-Id: Ibaf46b9182d761d56d8dc6770259ab4bc3703d59
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/218697
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-02-13 19:14:44 +00:00
Andrew Bonventre 5a4fa02641 gddo: add banner informing users of pkg.go.dev
Change-Id: Iccfc68f2f83253aaf5b7edc67128e59cd3454ac4
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/217538
Reviewed-by: Julie Qiu <julie@golang.org>
2020-02-03 21:15:24 +00:00
Andrew Bonventre 7365cb292b gddo: update gae-service-proxy for go111 GAE runtime
+ The go111 runtime requires google.golang.org/appengine to be
  updated to v1.6.5 in order for legacy APIs to continue to work
+ Small changes need to be made to the main package so that there
  is a proper main function

Steps run to update vendored dependencies:

  go get -d google.golang.org/appengine@v1.6.5
  go mod tidy
  go mod vendor

Change-Id: Ibfec53f00e8ba4874c36478607f68b0e652e09f6
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/216298
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-01-27 19:53:32 +00:00
Andrew Bonventre 87df31ab35 gddo: update from Godeps to modules
In order to ensure that full-text-search keeps running,
the google.golang.org/appengine package needs updating.

The first step of this is to convert to using modules
before updating the dependency.

Commands run:

go mod init github.com/golang/gddo
go mod tidy
go mod vendor
rm -rf Godeps

Change-Id: I6b5d1465226217bb1c0f134c90cd94aa2e7046d1
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/215678
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
2020-01-23 15:25:01 +00:00
Julie fbfc0f5e78 gddo-server: add logging for start and end of each request
In order to better understand what endpoints are being used
on godoc.org, an entry is now logged for the start and end of each
request. The latency of each request is also logged.

Change-Id: I8198b1206d04564e86b782e3e94964e829d5cc9b
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/209223
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-12-16 15:55:21 +00:00
Dmitri Shuralyov 72a348e765 gosrc: update Go version regexp for golang.org pages
The golang.org website has changed its UI design, and no longer
includes "Build version <version>" text at the bottom of each page.

The build version is still specified on each page in a short script.
Use that instead.

Updates golang/gddo#644

Change-Id: Iedac4fa1f44510af6462f9bb3431c5c23eaaed16
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/193258
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-09-04 17:53:37 +00:00
Dmitri Shuralyov 246c193ff7 gosrc: regenerate with Go 1.13
This change regenerates the list of standard packages to contain
packages that are in Go 1.13, which has been recently released.¹

It was done by running:

	go generate ./gosrc

¹ https://groups.google.com/d/msg/golang-announce/wQqVlKJiMBA/HqXJXZSuBwAJ

Updates golang/gddo#644

Change-Id: I701bb6ee2929996c1572d98dce5fd053d35ddb50
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/193257
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-09-04 17:52:50 +00:00
Dmitri Shuralyov 287de01127 database: increase size limit of packages to 1.2 MB
By now, there are some large packages whose documentation exceeds
the current size limit of 800 KB. Increase the limit by 1.5x to
accomodate such packages.

Fixes golang/gddo#635

Change-Id: Ie846366d2aea6a58f3cca3080c99fc0124995e5d
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/190398
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-08-15 22:37:33 +00:00
Dmitri Shuralyov 38fe2168e7 gosrc: handle not a directory error as not found error
We were correctly handling the error where the file did not exist by
mapping it to NotFoundError, which in turn was served as a normal 404
page to users. We were not handling the error where the file did exist
but was not a directory, which led to user-facing 500 errors.

This change fixes that by adding a check that the opened file is a
directory before attempting to read its contents.

Also, the file that was opened via os.Open was never closed. Fix that.

Fixes golang/gddo#640

Change-Id: I2b0cee6431a81294757b6fd24191fdd27f41ef63
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/190397
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-08-15 22:25:35 +00:00
Colin Arnott af0f2af807 gosrc: use Bitbucket v2 api
Bitbucket Cloud REST API version 1 is deprecated effective
30 June 2018. All 1.0 APIs will be removed from the REST API permanently
on 29 April 2019.

Since these are APIs used in gosrc/bitbucket.go, this CL aims to migrate
to the version 2 APIs. Most things translated well: all references to
/1.0/ were replaced with /2.0/ and json.Marshal structs were updated.
Note, many v2 APIs replace maps with arrays.

Pagination is present in many v2 APIs requiring iteration of some APIs:
refs, watchers, and src. pagelen has been set to max, 100, to minimize
number of API calls, but this could lead to context timeouts.

Timestamp formats have moved to time.RFC3339, thus all bespoke layout
vars have been removed.

/2.0/repositories/{username}/{repo_slug}/refs can directly fetch both
branches and tags, thus that logic has been collapsed.

/2.0/repositories/{username}/{repo_slug}.parent takes the place of both
/1.0/repositories/{username}/{repo_slug}.is_fork and
/1.0/repositories/{username}/{repo_slug}.fork_of. It is left as an
interface{} since the contents are not used.

gosrc.bitbucketRefs.Values[].Target.Hash, previously
gosrc.bitbucketNode.Node, stores the full SHA1 hash, not the first 12
chars. It does not appear to break anything to use the full hash, so
that is done.

/2.0/repositories/{username}/{repo_slug}/src interleaves files and
folders, so new processing logic was required.

/1.0/repositories/{username}/{repo_slug}/raw has been deprecated in
favour of directly using /2.0/repositories/{username}/{repo_slug}/src.

Followers, now called watchers, and are not accessable via the root
/2.0/repositories/{username}/{repo_slug} API. They have their own
paginated api, /2.0/repositories/{username}/{repo_slug}/watchers, for
fetching detailed user information. Enumerating watchers will require at
least one API call, and testing indicates that this API does not agree
with the value of /1.0/repositories/{username}/{repo_slug}.followers_count
or the Web UI, which agree with each other. While this feels like a bug
on Bitbucket's end, it was decided that gosrc.Directory.Stars should be
left default. The godoc for gosrc.Directory has been updated to reflect
this change.

Fixes golang/gddo#599

Change-Id: I8c471efb32a49c9aae179f7174e018357f93b9df
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/170279
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-04-19 22:21:30 +00:00
Dmitri Shuralyov 2f5d894195 database: use db.DeleteIndex instead of calling deleteIndex directly
The db.DeleteIndex method checks that db.RemoteClient is not nil
before dereferencing it. The direct call to deleteIndex did not,
and therefore panicked when db.RemoteClient was nil.

This makes Database.Block method consistent with Database.Put and
Database.Delete, which also use the db.DeleteIndex method.

With this change, go test ./database passes.

Change-Id: I90514bc1e855e125a9db57a93d2d7a88bce67e2e
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/172961
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-04-19 22:21:18 +00:00
Tuo Shan 5a2505f3db database: make Block also remove packages in newCrawl and search index
The method was used in the gddo-admin block command. It adds the URL
to the blocked list and removes everything under that URL from the
database. To make it useful, this change should also remove anything
under the URL from the newCrawl queue and the App Engine search index.

Change-Id: I02020801556418616f6628dca9afa39db09ad88f
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/130756
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-12 20:59:58 +00:00
Dmitri Shuralyov 9dbec58384 gosrc: regenerate with Go 1.12
This change regenerates the list of standard packages to contain
packages that are in Go 1.12, which has been recently released.

It was done by running:

	go generate ./gosrc

Updates golang/gddo#603

Change-Id: I641eeb60c5a47feaa93dc1620ee9ad96ed6878ca
Reviewed-on: https://go-review.googlesource.com/c/164301
Reviewed-by: Tuo Shan <shantuo@google.com>
2019-03-01 05:15:49 +00:00
Dmitri Shuralyov 9bd4a32950 talksapp: use Go 1.9, update bot.html URLs
Go 1.8 isn't supported anymore by goapp test (which is run by Travis CI).

Also add deploy command to README.

Change-Id: I90ee9a699fd95c74ce51446dbc35533738c05eea
GitHub-Last-Rev: af88a3b3eb
GitHub-Pull-Request: golang/gddo#590
Reviewed-on: https://go-review.googlesource.com/c/150059
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-16 21:55:33 +00:00
Harald Nordgren 73a248dcfc .travis.yml: bump Go versions and use '.x' to get latest patch versions
Change-Id: Ib536784b03c309592a8c046af6a62651310e7bc2
GitHub-Last-Rev: 24d3dd9632
GitHub-Pull-Request: golang/gddo#589
Reviewed-on: https://go-review.googlesource.com/c/145239
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2018-11-16 20:51:47 +00:00
Dmitri Shuralyov 6c035858b4 talksapp: update maintainer to Dmitri on index page
Francesc is no longer actively maintaining this project.

Also improve the GitHub issue tracker link to prepopulate
the "talksapp: " issue title prefix.

Change-Id: Id3b337039734e59c792310796b3facbd979d7909
Reviewed-on: https://go-review.googlesource.com/c/140677
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tuo Shan <shantuo@google.com>
Reviewed-by: Francesc Campoy Flores <campoy@golang.org>
2018-10-09 13:58:30 +00:00
Michael McLoughlin cd5c8e2019 gosrc: handle ".background" in presentations
The current implementation does not resolve background images, therefore
they do not display on talksapp. This change handles .background in the
same way as .image and .iframe.

Fixes golang/gddo#541

Change-Id: I309688fb95bc407fb59e8eb4c5e5ea2f3c54b184
Reviewed-on: https://go-review.googlesource.com/c/133235
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2018-10-08 20:56:25 +00:00
Stuart Jansen fdc9e01b3c remove stray punctuation from CONTRIBUTING.md
Change-Id: I5ec9f8674f62075c5bc6876c4e764ad80c90e802
GitHub-Last-Rev: 0b1991dfb0
GitHub-Pull-Request: golang/gddo#584
Reviewed-on: https://go-review.googlesource.com/c/140378
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-10-08 03:17:51 +00:00