Skip to content

maven: drop searchDoc.VersionCount - #83

Merged
andrew merged 1 commit into
mainfrom
maven-drop-version-count
Sep 4, 2026
Merged

maven: drop searchDoc.VersionCount#83
andrew merged 1 commit into
mainfrom
maven-drop-version-count

Conversation

@andrew

@andrew andrew commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

versionCount only appears on the default (non-gav) Solr core. Both FetchPackage and FetchVersions query with core=gav, whose fl list is id,g,a,v,p,ec,timestamp,tags, so searchDoc.VersionCount always decoded to 0 and Metadata["version_count"] was always 0.

Same root cause as #49 / #82; noticed while reviewing that PR.

versionCount only exists on the non-gav Solr core; both callers query
core=gav, so it always decoded to 0 and Metadata["version_count"] was
always 0. Same class of bug as #49.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change removes a field that was not present in actual core=gav responses and updates tests accordingly without introducing new behavioral risk.

Pull request overview

This PR removes the Maven versionCount decoding and the derived Metadata["version_count"] field because the Maven Central core=gav documents queried by FetchPackage/FetchVersions do not include versionCount, so the value was always decoded as 0.

Changes:

  • Removed VersionCount from the Maven searchDoc model used for core=gav responses.
  • Removed version_count from the core.Package.Metadata map built from search results.
  • Updated the Maven package fetch test fixture to stop providing VersionCount.
File summaries
File Description
internal/maven/maven.go Drops VersionCount decoding and stops emitting version_count metadata from core=gav search results.
internal/maven/maven_test.go Updates TestFetchPackage mock response to match the updated searchDoc shape.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andrew
andrew merged commit b62ba37 into main Sep 4, 2026
6 checks passed
@andrew
andrew deleted the maven-drop-version-count branch September 4, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants