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>
The content from the header obscures the hamburger
menu content because it has a higher z-index.
Decreasing the z-index fixes the issue.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
Fixesgolang/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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>