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

feat: Gitea client add create file function #1547

Merged
merged 12 commits into from Nov 21, 2020

Conversation

6543
Copy link
Contributor

@6543 6543 commented May 22, 2020

implement for brew and scoop support for Gitea-hosted repos

@vercel
Copy link

vercel bot commented May 22, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/goreleaser/goreleaser/1pzsx4glh
✅ Preview: https://goreleaser-git-fork-6543-forks-giteaclientaddcreatefile.goreleaser.now.sh

@vercel vercel bot temporarily deployed to Preview May 22, 2020 04:53 Inactive
@vercel vercel bot temporarily deployed to Preview May 22, 2020 15:11 Inactive
@6543 6543 changed the title [WIP] Gitea client add create file feat: Gitea client add create file function May 23, 2020
@6543 6543 force-pushed the GiteaClient_Add_CreateFile branch from b2e13d8 to 35609d8 Compare May 23, 2020 00:13
@vercel vercel bot temporarily deployed to Preview May 23, 2020 00:13 Inactive
internal/client/gitea.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview May 26, 2020 10:32 Inactive
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 26, 2020
@vercel vercel bot temporarily deployed to Preview May 27, 2020 16:01 Inactive
@vercel vercel bot temporarily deployed to Preview May 27, 2020 16:10 Inactive
@codecov
Copy link

codecov bot commented May 27, 2020

Codecov Report

Merging #1547 (2b9a42c) into master (9a19dee) will decrease coverage by 0.03%.
The diff coverage is 76.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1547      +/-   ##
==========================================
- Coverage   81.76%   81.73%   -0.04%     
==========================================
  Files          73       73              
  Lines        3834     3866      +32     
==========================================
+ Hits         3135     3160      +25     
- Misses        574      580       +6     
- Partials      125      126       +1     
Impacted Files Coverage Δ
pkg/config/config.go 93.75% <ø> (ø)
internal/client/gitea.go 87.50% <75.00%> (-2.86%) ⬇️
internal/pipe/defaults/defaults.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a19dee...2b9a42c. Read the comment docs.

@6543
Copy link
Contributor Author

6543 commented May 27, 2020

@caarlos0 I removed dummy test and add a real one now CI works

only problem is codecov now thinks this pull is bad :/

@vercel vercel bot temporarily deployed to Preview May 27, 2020 16:26 Inactive
@vercel vercel bot temporarily deployed to Preview May 28, 2020 14:25 Inactive
@vercel vercel bot temporarily deployed to Preview May 30, 2020 23:06 Inactive
Copy link
Member

@radeksimko radeksimko 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 the PR, this looks like a good start. However there's some more work that would need to be done in order to actually support gitea in Homebrew and Scoop.

Specifically the brews config section currently only supports GitHub and GitLab:

GitHub Repo `yaml:",omitempty"`
GitLab Repo `yaml:",omitempty"`

I think the best way forward would be refactoring the Homebrew packaging/publishing so that it is more aligned with Scoop, which is more git-host agnostic:

Bucket Repo `yaml:",omitempty"`

That may require planning some deprecations though.

@caarlos0 What are your thoughts on the deprecation?

internal/client/gitea.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview May 31, 2020 13:33 Inactive
@vercel vercel bot temporarily deployed to Preview May 31, 2020 13:34 Inactive
internal/client/gitea.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview May 31, 2020 13:39 Inactive
@vercel vercel bot temporarily deployed to Preview May 31, 2020 13:39 Inactive
@6543
Copy link
Contributor Author

6543 commented May 31, 2020

@radeksimko avter you have looked at the commits, If I should squash them just tell

@caarlos0
Copy link
Member

@caarlos0 What are your thoughts on the deprecation?

I think it should be fine, yes...

@vercel vercel bot temporarily deployed to Preview June 1, 2020 20:17 Inactive
@6543
Copy link
Contributor Author

6543 commented Jun 2, 2020

@radeksimko @caarlos0 current state?

@caarlos0
Copy link
Member

caarlos0 commented Jun 2, 2020

as @radeksimko mentioned, this pr alone does nothing... need the changes on brew/scoop pipe as well...

@6543
Copy link
Contributor Author

6543 commented Jun 2, 2020

hmm ok feel free to cherry-pick this :)

@mavogel
Copy link
Member

mavogel commented Nov 19, 2020

Update:

  • I got it fixed by creating an empty Formula folder in the homebrew-tap repository.
  • then it was possible to install the binary via
brew tap mavogel/gitea-tools ssh://git@localhost:222/mavogel/homebrew-tap.git
brew install mavogel/gitea-tools/release-testing

So happy to have it successfully tested in the wild for brews 🎉
Should we open an issue anyway for the SDK function when trying to create a file in a non-existing path, should return another error than the one json: cannot unmarshal?

@6543
Copy link
Contributor Author

6543 commented Nov 19, 2020

@mavogel pleace do :) - I'm happy to follow up on that specific issue on a new created issue in the sdk repository :)

@6543

This comment has been minimized.

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 19, 2020
@6543
Copy link
Contributor Author

6543 commented Nov 19, 2020

@radeksimko added
@caarlos0 think it is ready & tested now :)

@6543
Copy link
Contributor Author

6543 commented Nov 19, 2020

@caarlos0 do you squash-merge or should i swash it?

@6543 6543 requested a review from radeksimko November 19, 2020 21:06
internal/client/client_test.go Outdated Show resolved Hide resolved
internal/pipe/defaults/defaults.go Outdated Show resolved Hide resolved
pkg/config/config.go Show resolved Hide resolved
@caarlos0 caarlos0 self-requested a review November 19, 2020 21:41
@6543
Copy link
Contributor Author

6543 commented Nov 19, 2020

@caarlos0 thanks for the advice - done

@mavogel
Copy link
Member

mavogel commented Nov 20, 2020

@6543 : there you go: https://gitea.com/gitea/go-sdk/issues/459

@caarlos0 : for the testing setup there was a lot of manual work to do until I discovered this recent setup of gitea. IMHO it would make sense to add this and some additional steps (like homebrew-tap repo creation) to the docs. For gitlab as well, so Acc tests can be set-up quickly. What do you think? I could contribute this

@caarlos0
Copy link
Member

@caarlos0 : for the testing setup there was a lot of manual work to do until I discovered this recent setup of gitea. IMHO it would make sense to add this and some additional steps (like homebrew-tap repo creation) to the docs. For gitlab as well, so Acc tests can be set-up quickly. What do you think? I could contribute this

you mean as documentation?

I think it makes sense to put somewhere, or at least link to it somewhere, yes 🤔

@6543
Copy link
Contributor Author

6543 commented Nov 21, 2020

something missing?

@caarlos0 caarlos0 merged commit 89105d6 into goreleaser:master Nov 21, 2020
@caarlos0
Copy link
Member

Thanks everyone

@6543 6543 deleted the GiteaClient_Add_CreateFile branch November 21, 2020 13:42
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants