aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/versionstate.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2021-01-31 22:06:02 -0500
committerJulie Qiu <julie@golang.org>2021-02-12 21:21:49 +0000
commit84574e5b8d2668d5f07f7bb7ee8ae19b7dfd22c3 (patch)
treeb8899f1ea02590b019c7ab211f03088c135d7388 /internal/postgres/versionstate.go
parentf8709641a5977032e1529f9f642a864e31c2604c (diff)
downloadgo-x-pkgsite-84574e5b8d2668d5f07f7bb7ee8ae19b7dfd22c3.tar.xz
content,internal: update versions page
The versions page is updated to: - Display incompatible versions in a separate section - Remove minor versions of other modules A version.IsIncompatible function is added to the internal/version package for determining if a version is an incompatible version. Mock: https://photos.app.goo.gl/wWEFsMrmtaxggTAk7 Change-Id: I9a1c533066c3ea8b3f9f9b65f9bd171290655b5e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288762 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>
Diffstat (limited to 'internal/postgres/versionstate.go')
-rw-r--r--internal/postgres/versionstate.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/postgres/versionstate.go b/internal/postgres/versionstate.go
index 1674005d..e91ca58b 100644
--- a/internal/postgres/versionstate.go
+++ b/internal/postgres/versionstate.go
@@ -27,7 +27,7 @@ func (db *DB) InsertIndexVersions(ctx context.Context, versions []*internal.Inde
var vals []interface{}
for _, v := range versions {
- vals = append(vals, v.Path, v.Version, version.ForSorting(v.Version), v.Timestamp, 0, "", "", isIncompatible(v.Version))
+ vals = append(vals, v.Path, v.Version, version.ForSorting(v.Version), v.Timestamp, 0, "", "", version.IsIncompatible(v.Version))
}
cols := []string{"module_path", "version", "sort_version", "index_timestamp", "status", "error", "go_mod_path", "incompatible"}
conflictAction := `
@@ -116,7 +116,7 @@ func upsertModuleVersionState(ctx context.Context, db *database.DB, modulePath,
CURRENT_TIMESTAMP + INTERVAL '1 hour'
END;`,
modulePath, vers, version.ForSorting(vers),
- appVersion, timestamp, status, goModPath, sqlErrorMsg, numPackages, isIncompatible(vers))
+ appVersion, timestamp, status, goModPath, sqlErrorMsg, numPackages, version.IsIncompatible(vers))
if err != nil {
return err
}