The Wayback Machine - https://web.archive.org/web/20220212071306/https://github.com/go-gitea/gitea/pull/15910
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 support for corporate WeChat webhooks #15910

Merged
merged 83 commits into from Jul 23, 2021
Merged

Add support for corporate WeChat webhooks #15910

merged 83 commits into from Jul 23, 2021

Conversation

@lengyuqu
Copy link
Contributor

@lengyuqu lengyuqu commented May 17, 2021

这是一个企业微信的webhook 功能
1,提供了企业微信的webhook推送。
这对中国的工作者是有帮助的。这个功能我已经在我的公司使用了一年,由于中国的网络问题,一直没办法进行提交,希望可以获得合并。谢谢

This is a WebHook function of a company WeChat

  1. Provide WebHook push for corporate WeChat.
    This is helpful for Chinese workers. This feature I have been in my company for a year, because China's network problems have not been submitted, I hope I can get mergers. Thank you
services/webhook/wechatwork.go Outdated Show resolved Hide resolved
templates/admin/hook_new.tmpl Outdated Show resolved Hide resolved
@a1012112796
Copy link
Member

@a1012112796 a1012112796 commented May 19, 2021

Please fix lint

5	templates/admin/hook_new.tmpl:
30s
6		36: Wrong indentation type(spaces instead of tabs)
30s
7	templates/org/settings/hook_new.tmpl:
30s
8		31: Wrong indentation type(spaces instead of tabs)
30s
9	templates/repo/settings/webhook/base_list.tmpl:
30s
10		35: Wrong indentation type(spaces instead of tabs)
30s
11		36: Wrong indentation type(spaces instead of tabs)
30s
12	templates/repo/settings/webhook/new.tmpl:
30s
13		29: Wrong indentation type(spaces instead of tabs)
	services/webhook/wechatwork.go:61:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
4	func (f *WechatworkPayload) Create(p *api.CreatePayload) (api.Payloader, error) {
162s
5	^
162s
6	services/webhook/wechatwork.go:70:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
7	func (f *WechatworkPayload) Delete(p *api.DeletePayload) (api.Payloader, error) {
162s
8	^
162s
9	services/webhook/wechatwork.go:81:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
10	func (f *WechatworkPayload) Fork(p *api.ForkPayload) (api.Payloader, error) {
162s
11	^
162s
12	services/webhook/wechatwork.go:105:3: S1021: should merge variable declaration with assignment on next line (gosimple)
162s
13			var message string
162s
14			^
162s
15	services/webhook/wechatwork.go:146:2: S1021: should merge variable declaration with assignment on next line (gosimple)
162s
16		var pr string
162s
17		^
162s
18	make: *** [Makefile:762: golangci-lint] Error 1

@go-gitea go-gitea deleted a comment from lengyuqu May 19, 2021
routers/routes/web.go Outdated Show resolved Hide resolved
@lengyuqu
Copy link
Contributor Author

@lengyuqu lengyuqu commented May 19, 2021

请修理皮棉

5	templates/admin/hook_new.tmpl:
30s
6		36: Wrong indentation type(spaces instead of tabs)
30s
7	templates/org/settings/hook_new.tmpl:
30s
8		31: Wrong indentation type(spaces instead of tabs)
30s
9	templates/repo/settings/webhook/base_list.tmpl:
30s
10		35: Wrong indentation type(spaces instead of tabs)
30s
11		36: Wrong indentation type(spaces instead of tabs)
30s
12	templates/repo/settings/webhook/new.tmpl:
30s
13		29: Wrong indentation type(spaces instead of tabs)
	services/webhook/wechatwork.go:61:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
4	func (f *WechatworkPayload) Create(p *api.CreatePayload) (api.Payloader, error) {
162s
5	^
162s
6	services/webhook/wechatwork.go:70:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
7	func (f *WechatworkPayload) Delete(p *api.DeletePayload) (api.Payloader, error) {
162s
8	^
162s
9	services/webhook/wechatwork.go:81:1: receiver name f should be consistent with previous receiver name p for WechatworkPayload (golint)
162s
10	func (f *WechatworkPayload) Fork(p *api.ForkPayload) (api.Payloader, error) {
162s
11	^
162s
12	services/webhook/wechatwork.go:105:3: S1021: should merge variable declaration with assignment on next line (gosimple)
162s
13			var message string
162s
14			^
162s
15	services/webhook/wechatwork.go:146:2: S1021: should merge variable declaration with assignment on next line (gosimple)
162s
16		var pr string
162s
17		^
162s
18	make: *** [Makefile:762: golangci-lint] Error 1

It has been fixed

zhaoxin and others added 2 commits Jun 1, 2021
@techknowlogick techknowlogick changed the title Created a corporate WeChat Add support for corporate WeChat webhooks Jun 2, 2021
jpraet and others added 12 commits Jul 13, 2021
…6049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <[email protected]>
* Detect encoding changes while parsing diff
* fix go-gitea#16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil
@lengyuqu
Copy link
Contributor Author

@lengyuqu lengyuqu commented Jul 13, 2021

@lenyuqu lint 失败。

I'm fixing this problem.

lunny
lunny approved these changes Jul 21, 2021
6543
6543 approved these changes Jul 21, 2021
docs/content/doc/features/webhooks.zh-cn.md Outdated Show resolved Hide resolved
docs/content/doc/features/webhooks.zh-cn.md Show resolved Hide resolved
@a1012112796 a1012112796 removed their request for review Jul 23, 2021
@lunny lunny merged commit 078e2b2 into go-gitea:main Jul 23, 2021
2 checks passed
@delvh delvh mentioned this pull request Jul 23, 2021
AbdulrhmnGhanem added a commit to kitspace/gitea that referenced this issue Aug 10, 2021
* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* Update locale_cs-CZ.ini

fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix wechat

* fix wechat

* fix wechat

* fix wechat

* Fix invalid params and typo of email templates (go-gitea#16394)

Signed-off-by: Meano <[email protected]>

* Add LRU mem cache implementation (go-gitea#16226)

The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (go-gitea#16407)

* plugins/docker -> techknowlogick/drone-docker

* It is multi-arch

* docs: rewrite email setup (go-gitea#16404)

* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <[email protected]>

* Validate Issue Index before querying DB (go-gitea#16406)

* Fix external renderer (go-gitea#16401)

* fix external renderer

* use GBackground context as fallback

* no fallback, return error

Co-authored-by: Lauris BH <[email protected]>

* Add checkbox to delete pull branch after successful merge (go-gitea#16049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Detect encoding changes while parsing diff (go-gitea#16330)

* Detect encoding changes while parsing diff

* Let branch/tag name be a valid ref to get CI status (go-gitea#16400)

* fix go-gitea#16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix build

* fix build

* Apply suggestions from code review

Co-authored-by: a1012112796 <[email protected]>
Co-authored-by: myheavily <myheavily>
Co-authored-by: zhaoxin <[email protected]>
Co-authored-by: Meano <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: GiteaBot <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Bagas Sanjaya <[email protected]>
Co-authored-by: Norwin <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Jimmy Praet <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet