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

3379 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam 58432cb4a0 internal/postgres: remove uses of modules.deprecated_comment
The deprecated_column in the modules table has been superseded by the
information in the latest_module_versions table.

For golang/go#43265

Change-Id: Ib53e0b295a3edf8e807ff825b36baa6701b927b1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309610
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-13 18:23:28 +00:00
Jamal Carvalho 08612630e8 content/static: remove link to go.mod when file does not exist
Fixes golang/go#44837

Change-Id: Ia9f5b472a88bc43bfa326a11277681d46bf3a241
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309391
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-04-13 16:01:48 +00:00
Jonathan Amsterdam b6c709824c many: remove "retractions" experiment
For golang/go#43265

Change-Id: Iac39814ce532adf5846bb768802a46ad7a77fa84
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309609
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-13 11:11:51 +00:00
Jamal Carvalho b0d7b43aac content/static: fix header content overlapping hamburger menu bug
The content from the header obscures the hamburger
menu content because it has a higher z-index.
Decreasing the z-index fixes the issue.

Fixes golang/go#45496

Change-Id: I45405cc7d8ac3524517f02292a5e457e167672fc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309369
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
2021-04-12 16:28:44 +00:00
Julie Qiu fcfffe03b7 internal/frontend: fix unknown module path in ScheduleFetch
A bug is fixed that caused queue.ScheduleFetch to be called with unknown
module path when the request version was main or master.

Change-Id: I61894f4d45599a29ffb70450d7def8e87e93b4ba
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308969
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-04-09 17:38:36 +00:00
Jamal Carvalho f27dc61a44 content/static: fix position of 'Learn more' link on large screens
Change-Id: Ib8b487becfbaae2dc7781f292fce2b542f30bcfd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308569
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-08 17:14:22 +00:00
Jonathan Amsterdam 17477072ab internal/licenses: add alternative GPL-3 URL
The "why not LGPL" link has apparently changed.
Accept both links.

For golang/go#45432

Change-Id: I1a252b11b1995bcd33c527473d111a17e0db55a2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308449
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-08 16:30:45 +00:00
Jonathan Amsterdam d025eb3c76 internal/postgres,etc: finish MustInsertModule cleanup
Now that there are no callers of MustInsertModule, rename
MustInsertModuleLatest to MustInsertModule. We can
also remove MustInsertModuleLMV.

Change-Id: Ieb554ee32696c168be4cc0a14ecece9f4c6b91b4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308271
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-08 16:30:30 +00:00
Jonathan Amsterdam d189d9d19b internal/postgres: continue MustInsertModule cleanup
Remove calls to MustInsertModuleLMV.

It helped to reorganize TestGetLatestUnitVersion to be clearer about
the go.mod contents of the various module versions.

Change-Id: I7fa41bd742cf8bba2b5274172ad5b79fc22e73a9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308270
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-08 16:30:25 +00:00
Jonathan Amsterdam d5da038b60 internal/postgres: remove MustInsertModule from remaining tests
Change-Id: Ife8d5918c63cfc509696aaa273186752fac0652e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308269
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-08 16:28:39 +00:00
Jonathan Amsterdam 3abcfcf908 internal/frontend,testing: MustInsertModule -> MustInsertModuleLatest
Update more calls to MustInsertModule to also insert latest-version information.

Change-Id: Ie05212e8f33a6e22fa0ddd87faf393625c4f8b6e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308070
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-08 11:18:31 +00:00
Jamal Carvalho 2e928e6496 content,internal: use test ids in unit meta server tests
Updates server tests for recent changes to the unit
meta section. Uses data-test-ids instead of css class
selectors to make tests easier to maintain when html
structure or classnames are changed.

Change-Id: I4d17179e49f101865f9932c47552038e127df106
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308149
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
2021-04-07 20:16:02 +00:00
Jamal Carvalho 0168c0e09f content/static: responsive design updates
Creates intermediary layout for header details and
right sidebar content on unit pages to better support
screen widths 832px - 1024px.

Change-Id: I4d9957f2dd17b8d945858b506ac71fc23b53addc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307850
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 19:25:42 +00:00
Jamal Carvalho 81051165bf content/static: update banner background color
To make the edge of banners and the header more distinct.

Change-Id: If77eada5a208579855800e1577293a8f84a846f8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307356
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 19:24:43 +00:00
Jamal Carvalho e4362a508e content/static: sticky-header bug fix
Fixes a bug in the header were some interactive items
at the top of the page below the header would become
unclickable.

Change-Id: Ic0c7f2e9149767c822f6f6ea3f1b9591cd60053e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307355
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 19:24:36 +00:00
Jamal Carvalho 365d836601 content/static: move banners below main header
Moves the retracted, redirect, and major version banners
below the main header. Required updates to the layout
and styles of the module header. Header size is now
dynamically calculated to support overflow content inside
of the banners and breadcrumbs. This is necessary to create
a smooth transition between the sticky and regular header,
properly position the mobile documentation nav, and prevent
unwanted layout shift as sticky elements require an absolute
value for their top position.

Change-Id: Ie1ce80db658a1da87f686b340cfc292f83c2e7e5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306890
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 19:23:18 +00:00
Jamal Carvalho 9647e2dab5 content/static: add badges to the version page
Adds badges for deprecated major versions and
retracted versions on the versions page.

For golang/go#41321
For golang/go#43265

Change-Id: Ia7194cb6ef1efeb67d452844f4e40c39d7a7ffa9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307849
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 19:22:22 +00:00
Jonathan Amsterdam b3344a7197 internal/postgres: use MustInsertModuleLatest
For most internal/postgres tests, update latest-version information
when we insert a module.

That is more like what actually happens on the worker, and some
features now rely on it, so we should do it everywhere.

Some tests still use a custom go.mod file, so we can't switch to
MustInsertModuleLatest for those, because it uses a minimal go.mod
file.

Change-Id: Ie5030aee4ed9c837931fddb8757e37bf6373a8c7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307871
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-04-07 17:15:13 +00:00
Jonathan Amsterdam 668263d32c internal/postgres: use latest-version info for latest major version
Use the latest_module_versions table to determine the latest
tagged major version of a series. This lets us take deprecations
and retractions into account.

For golang/go#43265

Change-Id: I90ed9697ddcaadf9b13a5b99c24bf741acff10ef
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308030
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 16:31:51 +00:00
Jonathan Amsterdam 77f3533e99 internal/frontend: add latest-version info to ServerTest modules
In a later CL, the latest-major-version banner will need to use the
latest_module_versions table. So add latest-version information to the
modules inserted as part of the server test.

Change-Id: I1ebbcd40c109c2bcd86b37e6c92871c4f627be31
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308029
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 16:31:41 +00:00
Jonathan Amsterdam c3aa9cbca1 internal/database: add DB.WithPGXConn
This function lets code outside the package use pgx-specific features
like CopyFrom.

Change-Id: I40d2c8b5d9a92f61f535fc25059fb976baf5d178
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307870
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-07 11:27:32 +00:00
Baokun Lee 32f756d5ab internal/config: change default database driver to pgx
As CL 304630 merged, we change the database driver to pgx, this CL
change the default driver value in config.go.

Change-Id: Ic4697dc83ac03b432fbbca3d7d2cd2f6e0167645
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307629
Run-TryBot: Baokun Lee <bk@golangcn.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Trust: Baokun Lee <bk@golangcn.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-04-06 19:35:42 +00:00
Jonathan Amsterdam 5255e00d04 internal/postgres: new way to get latest major version
Add DB.getLatestMajorVersion2, which uses the new series_path and
deprecated columns of latest_module_versions to get latest major
version information.

The function is not hooked up or tested yet, but it demonstrates how
we'll use the new columns.

For golang/go#43265

Change-Id: I015ef312d157585ca00582f7f1addd604a2dca77
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307475
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:51:55 +00:00
Jonathan Amsterdam a61b942698 internal/postgres: insert new latest_module_versions columns
For golang/go#43265

Change-Id: I545d43984676fdef34d942de8e3bcaaf88aa679b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307473
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:49:40 +00:00
Jonathan Amsterdam 172521265a migrations: add series_path and deprecated columns to latest_module_versions
We'll use these columns to find the latest non-deprecated major module
version for a path.

For golang/go#43265

Change-Id: I3890fc78879ab8750e28cb9c42392eac5b1cb454
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307472
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:49:32 +00:00
Jonathan Amsterdam cc900eda8c internal/database: CopyUpsert honors QueryLoggingDisabled
Don't log from CopyUpsert if query logging is disabled.

Change-Id: Iee6d1998b6330294043d8f80ab5b5507651750ee
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307471
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:49:21 +00:00
Jonathan Amsterdam 0d71ef931b internal/postgres: fix GetLatestMajorPathForV1Path for gopkg.in
GetLatestMajorPathForV1Path was not handling the special
case of gopkg.in modules correctly.

Also, split the logic for extracting the major version of a module
path to a separate function.

Change-Id: Ie7758330a14ebaab6360fafcc4bf2d3ae46f6479
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307470
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:49:12 +00:00
Jonathan Amsterdam ee71ea76e3 internal/postgres: clarify TestGetLatestMajorPathForV1Path
I found this test hard to understand because it was doing so much to
the test inputs. I brought the test inputs and expected values closer
to the actual arguments and return values of the function under test.

Change-Id: I6d72033e21eddfcc78f5803563c4bbf9e2e19356
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307392
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-06 16:49:01 +00:00
Jonathan Amsterdam c6c01755cd content/static/html/helpers: add space to Deprecated banner
Add a space after the colon in "Deprecated: reason".

For golang/go#41321

Change-Id: I2440c4cc34ec23d4e7eb81e926d815013ff32725
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307489
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-05 21:40:12 +00:00
Jamal Carvalho 0788ec933f content/static: dynamic text for directories expand button
When all expandable items in the directories section
are expanded the toggle will display "Collapse all".
When a directories section is viewed that has no
expandable items, the button will not appear.

Fixes golang/go#44072

Change-Id: Iefbee18367832971acb98a7b9164b03f5fc566d6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307354
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-05 21:21:22 +00:00
Jamal Carvalho 9f18282fab internal,content: remove sticky-header experiment
Change-Id: Icc26f100891db74d6ab19062bad0420a03a52fb6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307349
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-05 21:18:10 +00:00
Jamal Carvalho d4ec244962 content/static: update version page symbol UI
Refactors versions page template to meet updated
design spec. The page now has a responsive layout
and symbol history content visibility can be toggled
with expand and collapse buttons at versions page
header or by clicking on the commit time text.

For golang/go#37102

Change-Id: I61487c51ac76ee02495c22d1d798bfa1712a9e35
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306132
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-05 20:57:46 +00:00
Jamal Carvalho 4e204a7585 content/static: remove legacy header content
Change-Id: I44c8bd808bafa285869c8a9c6804e480106bf28a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307350
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-05 20:57:12 +00:00
Jamal Carvalho b9cf85f621 content,internal: remove legacy dochtml templates
Change-Id: I69d743b1a9f55ef6f48ae0fbd80f6bafd5debd5b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307351
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-05 20:57:01 +00:00
Jonathan Amsterdam 7c79ee9bc0 cmd/prober: bypass cache and quota
Arrange for the prober to bypass the quota check.

Also, fix the attempt to bypass the cache, which had both the wrong
header name and the wrong header value.

Change-Id: I9cd7b19903d7ac0b0121e14c7674d553a9daa07a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307389
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-04-05 20:05:29 +00:00
Jonathan Amsterdam 2d3ade3c90 internal/postgres: check for non-empty good version
In unitExistsAtLatest, check that latest_module_versions.good_version
is non-empty before using it.

Change-Id: I1ba28d4e44afcffe277658354167a6c19ef122a2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306849
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-02 17:34:26 +00:00
Zach Hoffman d32369b7b1 internal/licenses: Increase unidentified words allowed in atc exception
Increase the number of unidentified words accepted by the atc-dependency
license exception for package and repo names by 1.

The current atc license exception works for the Apache Traffic Control
master branch, but the 5.1.x release branch license
(https://github.com/apache/trafficcontrol/blob/5.1.x/LICENSE) only has
66% coverage. This CL brings it up to 79%.

For golang/go#44968

Change-Id: I594a7bb8ff8383a04baa59abb2b9a2f9c0570d27
GitHub-Last-Rev: 0821f0173c
GitHub-Pull-Request: golang/pkgsite#25
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306730
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jamal Carvalho <jamal@golang.org>
2021-04-02 15:54:20 +00:00
Jonathan Amsterdam 23453443a0 internal/frontend,etc.: optimize away second GetUnitMeta call
If the frontend has called GetUnitMeta(unknown, latest), then
the GetLatestInfo doesn't have to repeat that call.

Change-Id: I61d1b733ded5a588468b8d18db1b66bd027c0fec
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306594
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-02 12:11:48 +00:00
Jonathan Amsterdam 861a66a6c7 internal/frontend: pass right context to GetLatestInfo
We were passing the original request context to GetLatestInfo,
rather than the context of the parent function.

This affected which experiments were active when in stats mode
(hitting /detail-stats/... paths).

Change-Id: Iad5fb9d05fee8364e9b98356c8e1464e17ceaf3e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306592
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-02 11:35:02 +00:00
Jamal Carvalho 871013309a content/static: fix sticky header margin on non-documentation pages
Fixes the margin of the sticky header on versions, licenses, imports
and imported by pages.

Change-Id: Ied69420bf5344a34a4b721e7a292831ac5e9ad33
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306429
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-01 21:28:52 +00:00
Jonathan Amsterdam f4eaae47a1 internal/frontend: clean retraction/deprecation messages
Shorten and clean the retraction rationale and deprecation comment for
display, following the same algorithm as the go command.

For golang/go#43265

Change-Id: Id8887687ce48372cc6f57563e94e97560eb7e7bb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306591
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-04-01 20:57:57 +00:00
Jamal Carvalho 50ca445603 content/static: copy versions template into legacy file
Copying the the current version template
into a legacy file in anticipation of changes
related to symbol history.

Change-Id: I4bfabc33c8d91db23261a9584b1c1ff32ac34113
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306131
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-31 15:21:22 +00:00
Jamal Carvalho 53202c51a1 internal/static: fix stylelint error
Change-Id: Ifc653247a73e356ca42d7ee26b6b924c4d3dc394
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/306130
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-31 15:21:12 +00:00
Jonathan Amsterdam bd976ce760 internal/frontend: drop docs after all/all
If there is more than one Documentation in a unit but the first is
all/all, ignore the others.

Also, consolidate doc mods into one function.

Change-Id: I9ec7551d39a4e68e8a4a1483f928d288d77e1e55
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305989
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-30 18:46:57 +00:00
Jonathan Amsterdam 362afdf6f9 internal: don't panic on all/all
If CompareBuildContexts sees all/all, it prefers it instead of
panicking.

Change-Id: I50ff46fa2bbad47cfe5539297a08744dd62b261c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305969
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-30 18:06:50 +00:00
Julie Qiu 5b4814e905 Revert "internal/postgres: remove documentation delete"
This reverts commit 101343b2dd.

Reason for revert: We still need to delete rows when an "all" row is
inserted to prevent panics in https://go.googlesource.com/pkgsite/+/master/internal/build_context.go#51.

Change-Id: Ic2dec11978774cde4bffeba040ef2e212385e994
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305949
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-30 18:06:38 +00:00
Jonathan Amsterdam be5421da73 internal/postgres: use CopyUpsert to insert documentation
Insert into the documentation and new_documentation columns using the
new CopyUpsert method.

This saves some time. It saves even more space, because we can
generate the rows one at a time instead of making a big slice of all
the values. The difference can be quite significant on modules with
many documentation rows.

Change-Id: I859bdfaf90a204d755eb7a067da000014e0259a2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305831
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-30 16:42:15 +00:00
Jonathan Amsterdam 127896bc9e internal/database: CopyUpsert: support dropping a column
You can't do a CopyFrom on a table with a generated column: postgres
complains about the column value being null. To fix, drop the column
on the temporary table.

Change-Id: Ia52f59af6d026b3fcdaafe3c7865a2eb85deb179
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305830
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-30 16:42:02 +00:00
Jonathan Amsterdam ace022fde6 internal/postgres: use pgx for tests
Switch the default DB driver from postgres to pgx.

The pgx driver returns local times. That isn't against the spec (I
can't find anything about it in the documentation of database/sql),
and since changing it to UTC could break users it's unlikely to get
into pgx. Since it only affects display, we change times to UTC
wherever they are formatted.

Change-Id: I8e8d17e8b1f2456fba59182425c41db23e870f0c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305530
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-30 16:41:56 +00:00
Jonathan Amsterdam 194473c58f internal/database: improve temp table creation
- Use LIKE to copy a table's scheme, instead of a SELECT.
- Drop the table on commit.

Change-Id: I82f5bb64e99f7983498a7e81bdeba51025a49b2b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305529
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-29 18:09:37 +00:00