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

Fix signing.wont_sign.%!s(<nil>) if Require Signing commits but not signed in. #12581

Merged

Conversation

zeripath
Copy link
Contributor

signing.wont_sign.%!s(<nil>) will be displayed if the repository needs signed
commits but the user is not logged in.

This is displayed because of complicated logic in the the template repo/issue/view_content/pull.tmpl
and a shortcut in the code of routers/repo/issue.go

This PR adds a default value of notsignedin if users are not signed in, which
although our templates will not show will prevent custom templates from showing
the above.

It also fixes the template to avoid showing signing errors if the user is not
authorized to sign.

Replaces #12564
Close #12564

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

…igned in

signing.wont_sign.%!s(<nil>) will be displayed if the repository needs signed
commits but the user is not logged in.

This is displayed because of complicated logic in the the template repo/issue/view_content/pull.tmpl
and a shortcut in the code of routers/repo/issue.go

This PR adds a default value of notsignedin if users are not signed in, which
although our templates will not show will prevent custom templates from showing
the above.

It also fixes the template to avoid showing signing errors if the user is not
authorized to sign.

Replaces go-gitea#12564
Close go-gitea#12564

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added this to the 1.13.0 milestone Aug 23, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 23, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2020

Codecov Report

Merging #12581 into master will increase coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12581      +/-   ##
==========================================
+ Coverage   43.40%   43.42%   +0.01%     
==========================================
  Files         644      644              
  Lines       71246    71248       +2     
==========================================
+ Hits        30923    30937      +14     
+ Misses      35307    35298       -9     
+ Partials     5016     5013       -3     
Impacted Files Coverage Δ
routers/repo/issue.go 37.54% <0.00%> (-0.06%) ⬇️
modules/git/repo.go 49.74% <0.00%> (+0.50%) ⬆️
routers/repo/view.go 37.98% <0.00%> (+0.64%) ⬆️
modules/queue/unique_queue_disk_channel.go 55.38% <0.00%> (+1.53%) ⬆️
models/unit.go 49.31% <0.00%> (+2.73%) ⬆️
modules/git/utils.go 77.04% <0.00%> (+3.27%) ⬆️
modules/indexer/stats/db.go 52.17% <0.00%> (+8.69%) ⬆️
modules/indexer/stats/queue.go 76.47% <0.00%> (+11.76%) ⬆️

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 dd8ec12...ca175d4. Read the comment docs.

@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 Aug 23, 2020
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

signing.wont_sign.%!s(<nil>) will be displayed if the repository needs signed
commits but the user is not logged in.

This is displayed because of complicated logic in the the template repo/issue/view_content/pull.tmpl
and a shortcut in the code of routers/repo/issue.go

This PR adds a default value of notsignedin if users are not signed in, which
although our templates will not show will prevent custom templates from showing
the above.

It also fixes the template to avoid showing signing errors if the user is not
authorized to sign.

Replaces #12564
Close #12564

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

Closed #12564 in favour of this one here, so feel free to proceed. 🚀

@zeripath zeripath merged commit 1bf7b8d into go-gitea:master Aug 23, 2020
@zeripath zeripath deleted the replace-12564-fix-wontsign-not-signed-in branch August 23, 2020 22:17
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants