-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add a way to mark Conversation (code comment) resolved #11037
Conversation
mark Conversation is a way to mark a Conversation is stale or be solved. when it's marked as stale, will be hided like stale. all Pull Request writer , Offical Reviewers and poster can add or remove Conversation resolved mark. Signed-off-by: a1012112796 <[email protected]>
Field should probably be named not |
7a151dc
to
f962c5e
Compare
pleace resolve conflicts and dont use Asignee |
* Add ResolveDoer * fix ui Co-Authored-By: Lauris BH <[email protected]> Co-Authored-By: 6543 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #11037 +/- ##
==========================================
- Coverage 43.53% 43.46% -0.07%
==========================================
Files 599 600 +1
Lines 84825 84943 +118
==========================================
- Hits 36927 36920 -7
- Misses 43351 43468 +117
- Partials 4547 4555 +8
Continue to review full report at Codecov.
|
Add permission check in UpdateResolveConversation
Thanks you can resolve my comments - I'll look into this pr later :) |
A migration needs to be added for creating the "ResolveDoerID" column. See the following files for examples:
|
This comment has been minimized.
This comment has been minimized.
@6543 probably your test setup has data from other PRs that are not included here. This PR doesn't change any repo units. |
O kanban hit me, had no time to look at trace yesterday - I'll try on new test enviroment |
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'm OK with this - only @guillep2k imprufements are missing
so I wont block.
* change return error for permisson check * add default message for deleted user * get issue message from comment * add migration for ``ResolveDoerID`` column another change: * block mark pending review as resolved because it's not necessary Co-authored-by: guillep2k <[email protected]>
for _, comment := range comments { | ||
if err := comment.LoadResolveDoer(); err != nil { |
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.
When the user deleted, but the comment should be still loaded.
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.
yes, But It willn't be error if user is deleted now, it will load an default user to replace it, but the name to show will be not right , that's the thing what I think now. maybe shold save user name instead of user id, then it willn't be a problem , do you think so ? Thanks
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.
return false, err | ||
} | ||
|
||
permResult = perm.CanAccess(AccessModeWrite, UnitTypePullRequests) |
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.
We should check if this PR's base branch is protected. If it's protected, we should check if it's official review, otherwise we should check if it's the writer of the pull request unit.
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.
Hello, I think I also have done what you say, because IsOfficialReviewer
will check them by step. then I'd like to do more easy check more earlly to lower average time cost , so I first check whether doer is poster of PR, if not ,then check if doer have write permission of pull request, at last check if doer is offical reviewer by IsOfficialReviewer
. do ypu think so? Thanks.
Lines 185 to 205 in cc07b9c
// IsOfficialReviewer check if reviewer can make official reviews in issue (counts towards required approvals) | |
func IsOfficialReviewer(issue *Issue, reviewer *User) (bool, error) { | |
return isOfficialReviewer(x, issue, reviewer) | |
} | |
func isOfficialReviewer(e Engine, issue *Issue, reviewer *User) (bool, error) { | |
pr, err := getPullRequestByIssueID(e, issue.ID) | |
if err != nil { | |
return false, err | |
} | |
if err = pr.loadProtectedBranch(e); err != nil { | |
return false, err | |
} | |
if pr.ProtectedBranch == nil { | |
return false, nil | |
} | |
return pr.ProtectedBranch.isUserOfficialReviewer(e, reviewer) | |
} | |
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.
just some docs issue
@a1012112796 can you resolve merge conflicts :) |
* fix conflix * fix code comments Co-Authored-By: 6543 <[email protected]>
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 good to me. Just a couple of nits.
* remove unusefull code Co-authored-by: guillep2k <[email protected]>
@lunny this requires your review. |
ping lg-tm |
* Add a way to mark Conversation (code comment) resolved mark Conversation is a way to mark a Conversation is stale or be solved. when it's marked as stale, will be hided like stale. all Pull Request writer , Offical Reviewers and poster can add or remove Conversation resolved mark. Signed-off-by: a1012112796 <[email protected]> * fix lint * Apply suggestions from code review * Add ResolveDoer * fix ui Co-Authored-By: Lauris BH <[email protected]> Co-Authored-By: 6543 <[email protected]> * change IsResolved to an function Add permission check in UpdateResolveConversation * Apply suggestions from code review * change return error for permisson check * add default message for deleted user * get issue message from comment * add migration for ``ResolveDoerID`` column another change: * block mark pending review as resolved because it's not necessary Co-authored-by: guillep2k <[email protected]> * change button color * resolve button size * fix code style * remove unusefull code Co-authored-by: guillep2k <[email protected]> Co-authored-by: Lauris BH <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: guillep2k <[email protected]>
mark Conversation is a way to mark a Conversation is stale or be solved. when it's marked as stale, will be hided like stale. all Pull Request writer , Offical Reviewers and poster can add or remove Conversation resolved mark.
view: