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

Return the full rejection message and errors in flash errors #13221

Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Oct 20, 2020

Previously Gitea would just return the last 512 characters of a flash error.

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

Screenshots

Screenshot from 2020-10-20 18-17-58

Screenshot from 2020-10-20 19-42-00

@zeripath zeripath added the type/enhancement An improvement of existing functionality label Oct 20, 2020
@zeripath zeripath added this to the 1.14.0 milestone Oct 20, 2020
@jolheiser
Copy link
Member

Could you add screenshots (similar to the ones in #configuration on Discord)?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 20, 2020
@zeripath
Copy link
Contributor Author

done - I created pre-receive hook that rejects with the contents of this patch

@jolheiser
Copy link
Member

I don't suppose it would look any better to left-align it? It seems odd to see terminal errors center-aligned. 😅

@silverwind
Copy link
Member

If it's always terminal output, it can possible use monospace font and white-space: pre.

@codecov-io
Copy link

Codecov Report

Merging #13221 into master will increase coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13221      +/-   ##
==========================================
+ Coverage   41.96%   41.98%   +0.02%     
==========================================
  Files         683      683              
  Lines       75279    75276       -3     
==========================================
+ Hits        31589    31604      +15     
+ Misses      38524    38510      -14     
+ Partials     5166     5162       -4     
Impacted Files Coverage Δ
routers/repo/pull.go 33.29% <0.00%> (ø)
routers/utils/utils.go 81.81% <ø> (+9.81%) ⬆️
modules/queue/workerpool.go 58.77% <0.00%> (-1.23%) ⬇️
modules/git/repo.go 46.70% <0.00%> (+0.50%) ⬆️
models/gpg_key.go 53.90% <0.00%> (+0.57%) ⬆️
routers/repo/view.go 38.11% <0.00%> (+0.64%) ⬆️
models/unit.go 49.31% <0.00%> (+2.73%) ⬆️
modules/git/utils.go 77.04% <0.00%> (+3.27%) ⬆️
modules/avatar/avatar.go 54.76% <0.00%> (+4.76%) ⬆️
modules/indexer/stats/db.go 60.86% <0.00%> (+8.69%) ⬆️
... and 1 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 b50448b...bf8a84c. Read the comment docs.

@zeripath
Copy link
Contributor Author

done

@silverwind
Copy link
Member

Forgot to push? 🤣

@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 Oct 20, 2020
@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 Oct 20, 2020
@gabyx
Copy link

gabyx commented Oct 20, 2020

Oh this is awesome! Really good PR! Thanks alot!

@gabyx
Copy link

gabyx commented Oct 20, 2020

Thanks a lot @zeripath

@gabyx
Copy link

gabyx commented Oct 20, 2020

I was already thinking about if we could send markdown ;-) and render it down in the browser :-). Maybe another feature.
This is already really helpful!!

@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 9658610 into go-gitea:master Oct 20, 2020
@zeripath zeripath deleted the full-rejection-message-flash-error branch October 21, 2020 04:42
@gabyx
Copy link

gabyx commented Oct 21, 2020

Could we get this feature already in 1.12.6 ? Possible to backport?

zeripath added a commit to zeripath/gitea that referenced this pull request Oct 21, 2020
@zeripath
Copy link
Contributor Author

This isn't a bug fix but rather an enhancement so it shouldn't really backported to 1.12.

Backporting to 1.13 is not out of the question but we'd have to backport locale strings for it too.

https://github.com/zeripath/gitea/tree/backport-13221 is a cherry-picked backport to 1.13 which if it was agreed could be used to make a PR to 1.13

https://github.com/zeripath/gitea/tree/backport-13221-1.12 has a cherry-picked and conflict fixed backport to 1.12.

@mrsdizzie
Copy link
Member

Agree on 1.13

techknowlogick pushed a commit that referenced this pull request Oct 21, 2020
…#13237)

* Return the full rejection message and errors in flash errors (#13221)


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

* Update routers/repo/pull.go

Co-authored-by: John Olheiser <[email protected]>

Co-authored-by: John Olheiser <[email protected]>
ivanvc added a commit to ivanvc/gitea that referenced this pull request Oct 21, 2020
…ments-in-pull-request-label-style

* origin/master: (27 commits)
  [skip ci] Updated translations via Crowdin
  add more clarification to the issue-template.md (go-gitea#13235)
  go-version constraints ignore pre-releases (go-gitea#13234)
  [skip ci] Updated translations via Crowdin
  Update some JS dependencies (go-gitea#13222)
  Return the full rejection message and errors in flash errors (go-gitea#13221)
  Update heatmap fixtures to restore tests (go-gitea#13224)
  [skip ci] Updated translations via Crowdin
  Add review request api (go-gitea#11355)
  [skip ci] Updated translations via Crowdin
  When the git ref is unable to be found return broken pr (go-gitea#13218)
  Various arc-green fixes (go-gitea#13214)
  Show stale label for stale code comment which is marked as resolved (go-gitea#13213)
  Move install pages out of main macaron routes (go-gitea#13195)
  Use CSS Variables for fonts, remove postcss-loader (go-gitea#13204)
  [skip ci] Updated translations via Crowdin
  Align `SSH_AUTHORIZED_KEYS_BACKUP` var with the value in `app.ini` (go-gitea#13212)
  Fix size and clickable area on file table back link (go-gitea#13205)
  [skip ci] Updated translations via Crowdin
  Fix error in diff html rendering (go-gitea#13191)
  ...
@zeripath zeripath added the backport/done All backports for this PR have been created label Oct 25, 2020
@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
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/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants