-
-
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
Implement "conversation lock" for issue comments #5073
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5073 +/- ##
==========================================
- Coverage 38.95% 38.88% -0.07%
==========================================
Files 346 349 +3
Lines 49635 49754 +119
==========================================
+ Hits 19334 19347 +13
- Misses 27512 27612 +100
- Partials 2789 2795 +6
Continue to review full report at Codecov.
|
Any idea why drone is failing with Started failing at 9d66bc3 Edit Looks like all builds are failing with this cryptic error, #5009 and #5051 just failed |
671749f
to
3252b6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a middleware to router.go
in order to prevent creating comments via POST requests or API requests.
|
||
// HasValidReason checks to make sure that the reason submitted in | ||
// the form matches any of the values in the config | ||
func (i IssueLockForm) HasValidReason() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add this to Validate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better if explicit enough ( I have a couple merged PRs that follow this route though ) .. And that regular Validate
is just meant for validating the struct bindings..
I wouldn't want to mess with bindings.Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts @JonasFranzDEV ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nudge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @jonasfranz
You can still create comments but you must have write access, and https://github.com/go-gitea/gitea/pull/5073/files#diff-ece22e0fe138da6e0fe0f25213406313R1033 Would fix for api requests |
@@ -61,6 +61,23 @@ var ( | |||
} | |||
) | |||
|
|||
// MustAllowUserComment checks to make sure if an issue is locked. | |||
// If locked and user has permissions to write to the repository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about making it an option whether or not a repo writer can still comment on a locked issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds nice.
Will this potentially be a global config or an option set at the point of locking the issue ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make a global option (in the config file) and then a setting in the repo to overwrite the global default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, what about this? I think it'd be ok if we move the configuration to another pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kolaente this PR is already long history, let's move such option to other PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lafriks sounds good!
0070a94
to
4c3a0b7
Compare
CI still failed. |
a775b61
to
28dffd7
Compare
CI has been fixed @lunny |
73a5bca
to
428d8df
Compare
Can anyone help me look at the icon thing ? So it doesn't align because other icons have this I have added an hack here though :) |
eeae85b
to
8315601
Compare
@lunny @jonasfranz please review |
5df50b8
to
aefe3bc
Compare
@jonasfranz Please review this PR. |
Dismissing your review for not ponging back ;)
@kolaente please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good so far, just one tiny nit.
@@ -61,6 +61,23 @@ var ( | |||
} | |||
) | |||
|
|||
// MustAllowUserComment checks to make sure if an issue is locked. | |||
// If locked and user has permissions to write to the repository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, what about this? I think it'd be ok if we move the configuration to another pr.
The goal of this PR is to add a lock conversation feature
present in Github.
Fixes #5063 .