Skip to content
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

Add GenericPackagesServices (#1100) #1180

Merged
merged 8 commits into from
Nov 22, 2021
Merged

Conversation

neomantra
Copy link
Contributor

This PR continues the work in #1101, rebasing it to master, updating its interface (returning download URL), and some real-world testing (fixed the URL endpoint and request type).

@svanharmelen svanharmelen mentioned this pull request Sep 10, 2021
2 tasks
@matejvelikonja
Copy link
Contributor

any plans on finishing this PR?

@neomantra
Copy link
Contributor Author

@matejvelikonja Besides the current (minor) branch conflicts, I didn't receive any feedback on whether anything needs to be changed.

@matejvelikonja
Copy link
Contributor

@svanharmelen any chance for merging this?

@dewey
Copy link

dewey commented Nov 10, 2021

Thanks for working on it @neomantra! Hope this gets merged soon to unblock the goreleaser fix.

@neomantra
Copy link
Contributor Author

I just rebased this branch onto latest master and resolved the minor conflicts.

@svanharmelen
Copy link
Member

I'll have a look at this one tomorrow!

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit to tweak the PR and make it more inline with the rest of this package. I think the only thing that is still missing (which would make sense to add, but is not required), is adding support for the select option when publishing a package.

Please let me know what you think about the changes and if this will still work for you.

@neomantra
Copy link
Contributor Author

Thanks for the review and improvements. I'm adding select and am testing this end-to-end with goreleaser patches.

sirlatrom and others added 6 commits November 21, 2021 10:59
Signed-off-by: Sune Keller <absukl@almbrand.dk>
Signed-off-by: Sune Keller <absukl@almbrand.dk>
 * PublishPackageFile now returns the download URL
 * removed forward slash from Generic Pacakge API endpoint urls
 * Publishing package is a PUT operation
 * add GenericPackageStatusValue enums
 * rebased to upstream master

Signed-off-by: Evan Wies <evan@neomantra.net>
Signed-off-by: Evan Wies <evan@neomantra.net>
@svanharmelen
Copy link
Member

I again added a commit to complete the PR and I removed your last commit as I don't like to add and export custom logic, but only support calls that the Gitlab API supports.

Please confirm if this solution works for you so I can go ahead and merge it. Thanks!

@neomantra
Copy link
Contributor Author

Thanks for the review and update. It's pretty convenient to have that GetGenericPackageURL function as the end-user needs to know the URL structure, which gitlab-go already knows as it needs it too; they must also include a function like pathEscape. I also note that the select result of GenericPackagesFile.File.URL is not the same URL as GetGenericPackageURL but some AWS S3 URL (at least for gitlab.com).

But I also appreciate a purist approach to the library. I tested the latest against an updated goreleaser and it works. I also tested the select function and it works. Thanks again for the attention to this issue.

@svanharmelen
Copy link
Member

Hmm... Well OK then add your latest commit back so we can include that one after all...

@svanharmelen
Copy link
Member

But then please just add it as an exported method, but do not use it in the other methods like before. I know this might sound stupid, but otherwise it could set a precedent which I would not like. We'll then see it purely as an additional stand-alone method.

@neomantra
Copy link
Contributor Author

OK, I added it back. I changed the verb from Get to Format... FormatPackageURL .. to prevent confusion with the common Get* Gitlab API operations and documented that it doesn't make an API call. I'm fine with another verb, but changed it given your feedback.

@svanharmelen
Copy link
Member

Nice, I can appreciate that one! Now if you can only swap the PublishPackageFileOptions and the FormatPackageURL method so that PublishPackageFileOptions is just above the method that uses it, I think we are good to go!

@neomantra
Copy link
Contributor Author

Great, I just force-pushed that ordering change.

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience with this one @neomantra 👍🏻

@svanharmelen svanharmelen merged commit 16f298f into xanzy:master Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants