-
Notifications
You must be signed in to change notification settings - Fork 412
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
feat: deduplicate tags #884
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
I decided to move the logic to this place so that, it applies to all publishers. I wanted to add some tests as well, but I didn't find a good way. This is because the publisher interface doesn't expose a way to get the tags. So it's hard to write a test to compare input and output tags. |
(This isn't commentary on the PR exactly, just research notes I thought it would be useful to share) The only place we care about the order of the tags is here: Lines 241 to 246 in 140ac87
This is pretty esoteric. This happens if you're not publishing, but specify multiple tags. This might happen if you do:
In that case the tarball should have the While looking into this, I also found and fixed #885 which was just kinda weird. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change LGTM, just needs a CLA before we can merge it.
I have accepted the CLA, and did the rescan :) |
pkg/commands/resolver.go
Outdated
|
||
// create a set from the input slice | ||
// preserving the order of unique elements | ||
func unique[T comparable](tt []T) []T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ehh, I don't know if we need to bother with generics here, since we know we'll only call it with strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I had it only for strings before, but then I thought it may be useful for other stuff too. You mentioned platform, for example. Maybe that's also a string, not sure. I can change it, if you want, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'd prefer to have it work on strings until/unless we find a generic use for it in the future. YAGNI and all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok done. I did a force push. Not sure how this is done here, but I know some project not doing squash merge and thefore prefer a single commit.
Signed-off-by: Nico Braun <rainbowstack@gmail.com>
2a3b7df
to
3da709c
Compare
Signed-off-by: Nico Braun rainbowstack@gmail.com
resolve: #883