fix(metadata): treat .mod and .info names as metadata for Go only

GetStats, the package list and the stats snapshots dropped any registry's
names that end in .mod or .info. An npm or PyPI package with such a name
vanished from the counts. The filter now matches IsMetadataEntry.
This commit is contained in:
2026-11-24 02:43:17 +00:00
parent 1b00236749
commit 5f4bdbed80
5 changed files with 46 additions and 15 deletions
+3 -2
View File
@@ -50,8 +50,9 @@ func (s *GORMStoreV2) registryNames() map[int32]string {
// groupFilter builds the WHERE clause shared by the group count, the group page and the row fetch.
func (s *GORMStoreV2) groupFilter(opts metadata.GroupListOptions) (clause string, args []interface{}, empty bool, err error) {
// The artifact filter GetStats applies, so list totals and /api/stats agree.
clause = "version NOT IN ? AND name NOT LIKE ? AND name NOT LIKE ?"
args = []interface{}{metadata.MetadataVersions, "%.mod", "%.info"}
nameCond, nameArgs := notGoMetadataName()
clause = "version NOT IN ? AND " + nameCond
args = append([]interface{}{metadata.MetadataVersions}, nameArgs...)
if opts.Registry != "" {
id, idErr := s.getRegistryID(opts.Registry)
if idErr != nil {