Skip to content

x/pkgsite: wrong sort order for /v1beta/versions/ #79632

Description

@ldez

What is the URL of the page with the issue?

https://pkg.go.dev/v1beta/api

What is your user agent?

No specific user agent

Screenshot

No response

What did you do?

The documentation about /v1beta/versions/{path} states:

The versions are in descending order.

This works well until the major version is higher than v9.

I think the sort is based on strings and not version numbers.

What did you see happen?

$ curl -L "https://pkg.go.dev/v1beta/versions/github.com/akamai/AkamaiOPEN-edgegrid-golang?limit=1"
{"items":[{"modulePath":"github.com/akamai/AkamaiOPEN-edgegrid-golang/v9","version":"v9.1.0","commitTime":"2024-11-14T13:00:38Z","isRedistributable":true,"hasGoMod":true,"latestVersion":"v9.1.0","deprecated":false,"deprecationReason":"","retracted":false,"retractionReason":""}],"total":104,"nextPageToken":"c265c4d880bde0a38a4e596d218e0b86"}

But the latest major version is v13, not v9.

What did you expect to see?

I expect the major versions to be ordered even if the major version is upper than v9.

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.pkgsitepkgsite/apiIssues related to the pkgsite api.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions