internal/postgres: don't insert modules.readme_*
Data is no longer written into modules.readme_file_path and
modules.readme_contents.
For golang/go#39629
Change-Id: Id879004373493b45c540e5adb11b075d8beadf60
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258318
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>
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 18026ea..ee5f8f5 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -180,8 +180,6 @@
module_path,
version,
commit_time,
- readme_file_path,
- readme_contents,
sort_version,
version_type,
series_path,
@@ -189,20 +187,16 @@
redistributable,
has_go_mod,
incompatible)
- VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)
+ VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)
ON CONFLICT
(module_path, version)
DO UPDATE SET
- readme_file_path=excluded.readme_file_path,
- readme_contents=excluded.readme_contents,
source_info=excluded.source_info,
redistributable=excluded.redistributable
RETURNING id`,
m.ModulePath,
m.Version,
m.CommitTime,
- m.LegacyReadmeFilePath,
- makeValidUnicode(m.LegacyReadmeContents),
version.ForSorting(m.Version),
versionType,
m.SeriesPath(),
@@ -375,10 +369,6 @@
ctx, span := trace.StartSpan(ctx, "insertUnits")
defer span.End()
- if m.LegacyReadmeContents == internal.StringFieldMissing {
- // We don't expect this to ever happen here, but checking just in case.
- return errors.New("saveModule: version missing LegacyReadmeContents")
- }
// Sort to ensure proper lock ordering, avoiding deadlocks. See
// b/141164828#comment8. We have seen deadlocks on package_imports and
// documentation. They can occur when processing two versions of the
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go
index 2ffad6b..6a1dd4a 100644
--- a/internal/postgres/insert_module_test.go
+++ b/internal/postgres/insert_module_test.go
@@ -114,8 +114,6 @@
}
wantu.Subdirectories = subdirectories
opts := cmp.Options{
- cmpopts.IgnoreFields(internal.LegacyModuleInfo{}, "LegacyReadmeFilePath"),
- cmpopts.IgnoreFields(internal.LegacyModuleInfo{}, "LegacyReadmeContents"),
cmpopts.IgnoreFields(licenses.Metadata{}, "Coverage"),
cmp.AllowUnexported(source.Info{}, safehtml.HTML{}),
}
@@ -149,7 +147,6 @@
}
mod := sample.LegacyModule(sample.ModulePath, sample.VersionString, "")
- checkHasRedistData(mod.LegacyReadmeContents, mod.LegacyPackages[0].DocumentationHTML, true)
checkHasRedistData(mod.Units[0].Readme.Contents, mod.Units[0].Documentation.HTML, true)
mod.IsRedistributable = false
mod.LegacyPackages[0].IsRedistributable = false