-
-
Notifications
You must be signed in to change notification settings - Fork 948
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: full gitlab support for brew and scoop #1084
feat: full gitlab support for brew and scoop #1084
Conversation
…upload hash from url
Codecov Report
@@ Coverage Diff @@
## master #1084 +/- ##
==========================================
- Coverage 83.51% 81.56% -1.95%
==========================================
Files 57 57
Lines 2979 3109 +130
==========================================
+ Hits 2488 2536 +48
- Misses 411 494 +83
+ Partials 80 79 -1
Continue to review full report at Codecov.
|
ping @caarlos0 for some clarifications :) Then I'll move on in the next days |
internal/pipe/brew/brew.go
Outdated
ctx.Config.GitLabURLs.Download, | ||
ctx.Config.Release.GitLab.Owner, | ||
ctx.Config.Release.GitLab.Name, | ||
artifact.Extra["GitLabFileUploadHash"], |
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.
maybe use https://godoc.org/github.com/goreleaser/goreleaser/internal/artifact#Artifact.ExtraOr with some fake string?
in theory it will never happen, but will be easier to debug in case it does (better have a url with fake-hash-should-not-happen
than just nil
🤔
or maybe handle it and fail earlier
shouldn't be I think... if it allows it, its a bug we should probably handle 🤔
I think the extra thing is OK for now... |
Unfortunately, adding the Somehow I do not fully get what happens here: https://github.com/goreleaser/goreleaser/blob/master/internal/pipe/release/release.go#L111. Why Good news are, that the brewfile generation works (https://gitlab.com/mavogel/homebrew-tab/blob/master/Formula/release-testing-program.rb) and scoop will be a piece of cake once the hash-passing-issue is solved 🎉
|
its to force a new variable, if you remove that line and run
awesome!
|
and with the |
Tried it but the key in the map is not set and I get a panic. I assume that the artifact in the |
hmm, maybe we need to change this: type Artifacts struct {
items []Artifact
lock *sync.Mutex
} to type Artifacts struct {
items []*Artifact
lock *sync.Mutex
} ? Probably pass a pointer everywhere as well 🤔 |
Yep did the trick 👍 Will add scoop, tests and merge with master ;) |
Update
|
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.
Overall looks good.
The pointer to Artifact thing I'll backport to master so this becomes easier to test/review :)
Furthermore I left 1 comment, but I didn't review it fully yet.
Thanks again for your awesome work BTW 🚀
internal/artifact/artifact.go
Outdated
Goarch string | ||
Goarm string | ||
Type Type | ||
UploadHash string |
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.
can we move this into Extra
?
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.
sure, I can do that :) Makes sense because it's a gitlab only thing. Maybe there will be more in the future for other vcs.
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.
Yeap... its not documented anywhere, but my idea was to use extra for things that not common between all things...
@mavogel can I fix the conflicts or you rather do it yourself? anyway is fine by me :D (just trying to make myself useful here hehe) |
no worries, already on it... |
when I check the report I don't get why there was a negative change in |
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.
LGTM
awesome work @mavogel! Thanks so much!
what do you say we merge this and leave it on master for a few days?
me neither, maybe some bug 🤔 |
You're welcome :) This tool simplifies our automated release process so much and I learned quite some stuff on the way. So thanks to you!
Fine for me. Merge it and then the others can continue based on the latest master 🎉 |
Awesome, merged! Hopefully people help testing :D |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
If applied, this commit will...
enabled the usage of gitlab for brew and scoop. This was still left open in #1038
Why is this change being made?
I would like to use gitlab as repo for my code for releasing to brew and scoop as well
Provide links to any relevant tickets, URLs or other resources
Steps
open questions
for @caarlos0 :)
Extra
field ofartifact.Extra["GitLabFileUploadHash"]
to pass around the hash I need to check if the file was already uploaded to the repo to reuse it in the brew/scoop pipe. (Yes github makes it easier and different) Would you suggest a new variable for this?