maven: drop searchDoc.VersionCount - #83
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
🟢 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
VersionCountfrom the MavensearchDocmodel used forcore=gavresponses. - Removed
version_countfrom thecore.Package.Metadatamap 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
versionCountonly appears on the default (non-gav) Solr core. BothFetchPackageandFetchVersionsquery withcore=gav, whosefllist isid,g,a,v,p,ec,timestamp,tags, sosearchDoc.VersionCountalways decoded to 0 andMetadata["version_count"]was always 0.Same root cause as #49 / #82; noticed while reviewing that PR.