-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
Team:EcosystemLabel for the Packages Ecosystem teamLabel for the Packages Ecosystem team
Description
As mentioned in #1585 , changing the title of a package in a given version could affect the ordering of packages shown in the search requests (setting the all=true query parameter).
For instance, 1password package change its title in 1.4.0 and this could affect how packages are sorted:
$ curl -s "https://epr.elastic.co/search?package=1password&all=true" | jq -r '.[] | {name, title, version}'
{
"name": "1password",
"title": "1Password",
"version": "1.10.0"
}
{
"name": "1password",
"title": "1Password",
"version": "1.11.0"
}
{
"name": "1password",
"title": "1Password",
"version": "1.12.0"
}
...
{
"name": "1password",
"title": "1Password",
"version": "1.33.0"
}
{
"name": "1password",
"title": "1Password",
"version": "1.34.0"
}
{
"name": "1password",
"title": "1Password",
"version": "1.4.0"
}
...
{
"name": "1password",
"title": "1Password",
"version": "1.9.0"
}
{
"name": "1password",
"title": "1Password Events Reporting",
"version": "0.1.1"
}
{
"name": "1password",
"title": "1Password Events Reporting",
"version": "0.2.0"
}
...
{
"name": "1password",
"title": "1Password Events Reporting",
"version": "1.3.0"
}Related code where packages are sorted first by title and then by version:
package-registry/packages/packages.go
Lines 43 to 48 in 721c062
| func (p Packages) Less(i, j int) bool { | |
| if p[i].Title != nil && p[j].Title != nil && *p[i].Title != *p[j].Title { | |
| return *p[i].Title < *p[j].Title | |
| } | |
| return p[i].Version < p[j].Version | |
| } |
Relates:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Team:EcosystemLabel for the Packages Ecosystem teamLabel for the Packages Ecosystem team