-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Prevent 500 is head repo does not have PullRequest unit in IsUserAllo… #20839
Prevent 500 is head repo does not have PullRequest unit in IsUserAllo… #20839
Conversation
…wedToUpdate Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net>
Wouldn't this cause confusion for merging if it's "not allowed to be merged" by returning false when the fork repo/PR source is having this error, that could be solved by making any change to the PR settings in the fork that makes the entries? The one normally doing the merging would not have access to the fork repo to know this... |
This PR is simply stopping the 500 and is easily backportable to 1.17.x What you are describing is new UI handling which will require new translatable strings and so on. That will not be backportable to 1.17 without significant work. Propose the UI and describe a reproducing testcase in another issue - but it is out of scope for this PR. |
Yes understood :) I know l10n is the ever-looming issue when touching the UI or error messages (first hand experience). |
Codecov Report
@@ Coverage Diff @@
## main #20839 +/- ##
==========================================
+ Coverage 46.74% 47.07% +0.32%
==========================================
Files 989 989
Lines 136393 136395 +2
==========================================
+ Hits 63761 64202 +441
+ Misses 64778 64310 -468
- Partials 7854 7883 +29
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…wedToUpdate (go-gitea#20839) Backport go-gitea#20621 Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net>
…wedToUpdate (#20839) (#20848) Backport #20621 Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix #20621 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* giteaofficial/main: Fix create repository page's help text (go-gitea#20810) In PushMirrorsIterate and MirrorsIterate if limit is negative do not set it (go-gitea#20837) Disable doctor logging on panic (go-gitea#20847) Remove calls to load Mirrors in user.Dashboard (go-gitea#20855) switch to node18 for snapcraft Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (go-gitea#20839) Fix owners cannot create organization repos bug (go-gitea#20841)
…wedToUpdate (go-gitea#20839) Some repositories do not have the PullRequest unit present in their configuration and unfortunately the way that IsUserAllowedToUpdate currently works assumes that this is an error instead of just returning false. This PR simply swallows this error allowing the function to return false. Fix go-gitea#20621 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
…ed (go-gitea#22512) Swallow error just like in go-gitea#20839, for the case where there is no protected branch. Fixes go-gitea#20826 for me, though I can't tell if this now covers all cases.
…wedToUpdate
Some repositories do not have the PullRequest unit present in their configuration
and unfortunately the way that IsUserAllowedToUpdate currently works assumes
that this is an error instead of just returning false.
This PR simply swallows this error allowing the function to return false.
Fix #20621
Signed-off-by: Andrew Thornton art27@cantab.net