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 packagist webhook #18224

Merged
merged 3 commits into from
Jan 23, 2022
Merged

Add packagist webhook #18224

merged 3 commits into from
Jan 23, 2022

Conversation

toddy15
Copy link
Contributor

@toddy15 toddy15 commented Jan 10, 2022

Hi,

this PR adds a new webhook for Packagist integration.

Packagist is the main Composer repository. It aggregates public PHP packages installable with Composer.

Using the webhook in a repository, a PHP package hosted on a gitea server will automatically update its information on packagist.org on push events.

I've built gitea on my machine and tested the new webhook locally. Everything seems to work as expected.

Regards,
Tobias

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2022

Codecov Report

Merging #18224 (03690f9) into main (212e81f) will increase coverage by 0.29%.
The diff coverage is 70.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18224      +/-   ##
==========================================
+ Coverage   45.74%   46.04%   +0.29%     
==========================================
  Files         831      839       +8     
  Lines       92178    92543     +365     
==========================================
+ Hits        42171    42613     +442     
+ Misses      43249    43155      -94     
- Partials     6758     6775      +17     
Impacted Files Coverage Δ
build/codeformat/formatimports.go 66.35% <0.00%> (ø)
cmd/admin.go 0.00% <0.00%> (ø)
cmd/cert.go 0.00% <0.00%> (ø)
cmd/doctor.go 0.00% <0.00%> (ø)
cmd/dump.go 0.89% <0.00%> (ø)
cmd/dump_repo.go 0.00% <0.00%> (ø)
cmd/manager.go 0.00% <ø> (ø)
cmd/serv.go 2.46% <0.00%> (ø)
cmd/web.go 0.00% <0.00%> (ø)
cmd/web_letsencrypt.go 0.00% <0.00%> (ø)
... and 315 more

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 f910924...03690f9. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 10, 2022
@lafriks lafriks added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jan 10, 2022
@S1SYPHOS
Copy link

I've been waiting for this for quite some time, great work, thank you so much!

@@ -22,6 +22,7 @@ func convertTaskTypeToString(x *xorm.Engine) error {
FEISHU
MATRIX
WECHATWORK
PACKAGIST
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and below and v162.go, the PACKAGIST doesn't need to be processed. At that time we did not have it yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review and the approval. I've removed the migrations from v161.go and v162.go.

I had already suspected that those migrations are not necessary, but I've looked at the PR for the last webhook addition (wechatnetwork, #15910). In that PR, those migrations have been added. AFAIU, the migrations for WeChat were not necessary either, right?

I've also merged in the latest changes from the gitea main branch and squashed the commits, to keep the commit for this PR as minimal as possible. If you'd like to have separate commits, please say so, and I'll force-push again.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yep, adding or not are both fine .... just small nit, nvm. I didn't review the wechatnetwork PR #15910 😂

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 20, 2022
@wxiaoguang wxiaoguang added this to the 1.17.0 milestone Jan 20, 2022
Copy link
Contributor

@Gusted Gusted left a comment

Choose a reason for hiding this comment

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

Once this in the a released stable version we might want to add a notice to the packagist site: https://github.com/composer/packagist https://packagist.org/about under How to update packages?

@toddy15
Copy link
Contributor Author

toddy15 commented Jan 23, 2022

Thanks for your approval. Yes, adding instructions for gitea on the packagist.org website is definitely useful. I'll try to remember sending them a PR when gitea has been released with this webhook. 😄

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 23, 2022
@toddy15
Copy link
Contributor Author

toddy15 commented Jan 23, 2022

@wxiaoguang Should I squash the commits again, rebase and force-push my branch?

@wxiaoguang
Copy link
Contributor

@wxiaoguang Should I squash the commits again, rebase and force-push my branch?

No need. Squash merge works well in GitHub, just wait for the CI to pass 😊

@wxiaoguang wxiaoguang merged commit 3349fd8 into go-gitea:main Jan 23, 2022
zjjhot pushed a commit to zjjhot/gitea that referenced this pull request Jan 23, 2022
* 'main' of https://github.com/go-gitea/gitea:
  Add packagist webhook (go-gitea#18224)
  Fix mime-type detection for HTTP server (go-gitea#18370)
  Always use git command but not os.Command (go-gitea#18363)
  Add deprecated for LFS_CONTENT_PATH on zh-cn docs (go-gitea#18362)
  [skip ci] Updated translations via Crowdin
  Make gitea, gitea-vet future-proof (go-gitea#18361)
  Pause queues (go-gitea#15928)
  Disable content sniffing on `PlainTextBytes` (go-gitea#18359)
  Update github.com/duo-labs/webauthn (go-gitea#18357)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/webhooks type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants