Skip to content

Add default CommitID for create pull review api #11334

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

Merged
merged 3 commits into from
May 8, 2020

Conversation

a1012112796
Copy link
Member

If user create pull review through api but not set CommitID,I think it's necessary to use last headCommitID as default seting, or this review will be considered as stale review which is wrong

If user create pull review through api but not set CommitID,
I think it's necessary to use last headCommitID as default seting,
or this review will be considered as stale review which is wrong

Signed-off-by: a1012112796 <1012112796@qq.com>
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 8, 2020
@zeripath zeripath added this to the 1.12.0 milestone May 8, 2020
@a1012112796
Copy link
Member Author

@zeripath the review api is added in #11224 which is not in v1.11. So it's not need to backport ... :)

@6543
Copy link
Member

6543 commented May 8, 2020

I would move this into pull_service.CreateCodeComment ...

@a1012112796
Copy link
Member Author

a1012112796 commented May 8, 2020

I would move this into pull_service.CreateCodeComment ...

I have thought about this, I didn't add it into CreateReview is because ui's Commit ID is auto added, So CommitID won't have chance to be empty. so add to api is enough, then user can
use api more simple.
see:

{{.CsrfTokenHtml}}
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"/>
<i class="ui right floated link icon close"></i>

@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 May 8, 2020
@a1012112796

This comment has been minimized.

@zeripath zeripath added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label May 8, 2020
@codecov-io
Copy link

Codecov Report

Merging #11334 into master will increase coverage by 0.01%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11334      +/-   ##
==========================================
+ Coverage   43.82%   43.84%   +0.01%     
==========================================
  Files         613      613              
  Lines       87207    87221      +14     
==========================================
+ Hits        38217    38238      +21     
+ Misses      44277    44271       -6     
+ Partials     4713     4712       -1     
Impacted Files Coverage Δ
routers/api/v1/repo/pull_review.go 64.55% <42.85%> (-0.71%) ⬇️
modules/log/event.go 64.61% <0.00%> (-1.03%) ⬇️
services/mirror/mirror.go 19.40% <0.00%> (+0.65%) ⬆️
modules/git/repo.go 52.30% <0.00%> (+1.25%) ⬆️
services/pull/pull.go 34.54% <0.00%> (+1.33%) ⬆️
models/repo_mirror.go 12.76% <0.00%> (+10.63%) ⬆️

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 c58bc4b...2ec6081. Read the comment docs.

@zeripath zeripath merged commit 1191731 into go-gitea:master May 8, 2020
@a1012112796 a1012112796 deleted the review_api_commitid branch May 9, 2020 15:04
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
If user create pull review through api but not set CommitID,
I think it's necessary to use last headCommitID as default seting,
or this review will be considered as stale review which is wrong

Signed-off-by: a1012112796 <1012112796@qq.com>
@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. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants