-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qualifiers Ordering #53
Comments
I'm just piling another small issue on top: #52 starts making use of I'd suggest to bump that version as well, or replace the usage of url, err := Parse(base)
if err != nil {
return
}
result = url.JoinPath(elem...).String()
return Again, happy to open a PR for both of these issues! |
Yes please. We should strictly follow the PURL spec and everything that differs, is clearly wrong. |
We should only support the last 2 Go versions and maybe adapt our CICD that it tests the last two Go releases. |
PRs are welcome of course :) |
Thanks for the quick reply! Agreed on both answers as well. One question that follows is whether we should have a "custom" Qualifiers type at all, if we could just use
Note that apart form the last option, these would all be breaking changes - although admittedly they'd simply the API, for example removing the Disregarding breaking changes, I'd advocate for the second option as it still defines a clear "contract" of what a qualifier is. (edit: note that one downside of such an alias type is that we couldn't define our own methods on it) |
hey @shibumi, quick ping in case you missed this :) |
Hey @tommyknows sorry for the delay. I am just out of surgery and still recovering :) Honestly, I do not care as long as we are following the official PURL spec. Using url.Values directly or a type alias, seems to be the better long term solution. For this issue in particular, I would also be fine with simply adding some conversion funcs, but using url.Values or a type alias is really something we should aim for. If we go for url.Values or a type alias we will have to bump the major version to communicate the breaking API change correctly. Do you think it would be a lot of work to fix the bug first and then fully migrate to url.Values or type aliases later? I'll leave that decision up to you :) |
BREAKING CHANGE: This commit removes all the custom qualifier-logic that existed in order to keep the ordering of the qualifiers. The spec says: > sort this list of qualifier strings lexicographically However, it doesn't say anything about the ordering within the typed representation. Using `url.Values` through a type alias gives users an easier way to access specific values and removes code that we now don't need to maintain anymore. See package-url#53 for more information.
Oh sorry, I hope your recovery is going well! 🍀 Alright, I've opened #56 for this. |
BREAKING CHANGE: This commit removes all the custom qualifier-logic that existed in order to keep the ordering of the qualifiers. The spec says: > sort this list of qualifier strings lexicographically However, it doesn't say anything about the ordering within the typed representation. Using `url.Values` through a type alias gives users an easier way to access specific values and removes code that we now don't need to maintain anymore. See package-url#53 for more information.
BREAKING CHANGE: This commit removes all the custom qualifier-logic that existed in order to keep the ordering of the qualifiers. The spec says: > sort this list of qualifier strings lexicographically However, it doesn't say anything about the ordering within the typed representation. Using `url.Values` through a type alias gives users an easier way to access specific values and removes code that we now don't need to maintain anymore. See package-url#53 for more information.
Hi again!
After #52, there seems to be a "bug" about the ordering of the qualifiers.
The code says:
However, with the switch to the
url.URL
type, when encoding the qualifiers they actually get ordered lexicographically.Now I've started to wonder what the "correct" behaviour for this is. The PURL Spec even says:
So admittedly, according to the spec, the "new" behaviour is correct.
Should I submit a PR to remove the comment that the order is being preserved? I'm wondering if this should be considered a breaking change.
Or do you have an opinion / better idea on what to do here?
Thanks!
The text was updated successfully, but these errors were encountered: