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

Don't manipulate input params in email notification #16011

Merged
merged 3 commits into from
May 30, 2021

Conversation

jpraet
Copy link
Member

@jpraet jpraet commented May 28, 2021

Fixes #15993

In some email notifications the content of the input model object is set to empty string "".
But this affects the other notification services, for example causing the content to also be empty in the webhook payloads.

Instead of directly manipulating the input object, the empty content is now passed mailCommentContext.

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2021

Codecov Report

Merging #16011 (f2ff3fd) into main (a9daebc) will decrease coverage by 0.01%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16011      +/-   ##
==========================================
- Coverage   44.07%   44.06%   -0.02%     
==========================================
  Files         682      682              
  Lines       82389    82394       +5     
==========================================
- Hits        36312    36303       -9     
- Misses      40177    40190      +13     
- Partials     5900     5901       +1     
Impacted Files Coverage Δ
modules/notification/mail/mail.go 37.89% <ø> (-0.89%) ⬇️
services/mailer/mail_comment.go 77.77% <50.00%> (-5.56%) ⬇️
services/mailer/mail_issue.go 60.49% <100.00%> (+2.59%) ⬆️
modules/util/timer.go 42.85% <0.00%> (-42.86%) ⬇️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
services/pull/check.go 26.02% <0.00%> (-2.74%) ⬇️
services/pull/patch.go 54.23% <0.00%> (-1.70%) ⬇️
modules/queue/unique_queue_disk_channel.go 48.63% <0.00%> (+1.36%) ⬆️

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 d8c99c6...f2ff3fd. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 28, 2021
@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 May 29, 2021
@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 May 29, 2021
@zeripath zeripath merged commit d79c8bc into go-gitea:main May 30, 2021
@jpraet jpraet deleted the webhook-empty-body branch May 30, 2021 20:04
jpraet added a commit to jpraet/gitea that referenced this pull request May 30, 2021
@techknowlogick techknowlogick added this to the 1.15.0 milestone May 31, 2021
@6543 6543 added the backport/done All backports for this PR have been created label Jun 6, 2021
@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.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pull request merged / closed webhook contains empty body
8 participants