From 84574e5b8d2668d5f07f7bb7ee8ae19b7dfd22c3 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Sun, 31 Jan 2021 22:06:02 -0500 Subject: 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 Run-TryBot: Julie Qiu TryBot-Result: kokoro Reviewed-by: Jonathan Amsterdam --- internal/postgres/insert_module.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'internal/postgres/insert_module.go') diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index 8d68bece..1d979a84 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -205,7 +205,7 @@ func insertModule(ctx context.Context, db *database.DB, m *internal.Module) (_ i m.IsRedistributable, m.HasGoMod, m.DeprecatedComment, - isIncompatible(m.Version), + version.IsIncompatible(m.Version), ).Scan(&moduleID) if err != nil { return 0, err @@ -581,12 +581,6 @@ func lock(ctx context.Context, tx *database.DB, modulePath string) (err error) { return nil } -// isIncompatible reports whether the build metadata of the version is -// "+incompatible", https://semver.org clause 10. -func isIncompatible(version string) bool { - return strings.HasSuffix(version, "+incompatible") -} - // isLatestVersion reports whether version is the latest version of the module. func isLatestVersion(ctx context.Context, ddb *database.DB, modulePath, resolvedVersion string) (_ bool, err error) { defer derrors.WrapStack(&err, "isLatestVersion(ctx, tx, %q)", modulePath) -- cgit v1.3