Skip to content

Create closing comment after issue is closed by commit #11310

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

Closed

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented May 6, 2020

Create the closing comment after the issue is closed by commit rather than before. This ensures that the repository Issue Numbers are correctly updated.

Fix #11308
Fix #10536
Closes #10541

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

When closing issues through commits create the comment after
the issue is closed rather than before. This ensures that the
repo issue num is correctly updated.

Fix go-gitea#11308
Fix go-gitea#10536

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added this to the 1.12.0 milestone May 6, 2020
@silverwind
Copy link
Member

Also obsoletes #10541.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 6, 2020
@zeripath zeripath changed the title When closing issues through commits move comment til after closed Create closing comment after issue is closed by commit May 6, 2020
@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 May 8, 2020
@lunny
Copy link
Member

lunny commented May 8, 2020

It seems this PR didn't fix the problem. And I found another bug that is even if there is no milestone of the issue, it will still update the milestone table.

2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] UPDATE "issue" SET "is_closed" = $1, "closed_unix" = $2, "updated_unix" = $3 WHERE "id"=$4 [true 1588955204 1588955204 2] - 11.22747ms
2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:157:QueryContext() [I] [SQL] SELECT * FROM "label" LEFT JOIN "issue_label" ON issue_label.label_id = label.id WHERE (issue_label.issue_id = $1) ORDER BY "label"."name" ASC [2] - 4.12587ms
2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] UPDATE "milestone" SET num_closed_issues=(SELECT count(*) FROM issue WHERE milestone_id=$1 AND is_closed=$2) WHERE id=$3 [0 true 0] - 9.627348ms
2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] UPDATE "milestone" SET completeness=100*num_closed_issues/(CASE WHEN num_issues > 0 THEN num_issues ELSE 1 END) WHERE id=$1 [0] - 3.463895ms
2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] UPDATE "repository" SET num_closed_issues=(SELECT count(*) FROM issue WHERE repo_id=$1 AND is_pull=$2 AND is_closed=$3) WHERE id=$4 [1 false true 1] - 15.699098ms
2020/05/09 00:26:44 ...m.io/xorm/core/tx.go:157:QueryContext() [I] [SQL] INSERT INTO "comment" ("type","poster_id","original_author","original_author_id","issue_id","label_id","old_milestone_id","milestone_id","assignee_id","removed_assignee","resolve_doer_id","old_title","new_title","old_ref","new_ref","dependent_issue_id","commit_id","line","tree_path","content","patch","created_unix","updated_unix","commit_sha","review_id","invalidated","ref_repo_id","ref_issue_id","ref_comment_id","ref_action","ref_is_pull") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31) RETURNING "id" [2 1  0 2 0 0 0 0 false 0     0 0 0    1588955204 1588955204  0 false 0 0 0 0 false] - 16.350323ms

And the close comment should before closed status comment.

图片

@zeripath
Copy link
Contributor Author

zeripath commented May 9, 2020

Damn. I'll have another think about this then.

@zeripath zeripath closed this May 9, 2020
@zeripath zeripath deleted the fix-11308-10536-update-issue-number branch May 20, 2020 16:43
@CatoLynx
Copy link

CatoLynx commented Jun 5, 2020

Is there any update on the incorrect open issue count that was supposed to be fixed with this?

@silverwind
Copy link
Member

This was not merged, so still an open issue.

@lcnittl
Copy link

lcnittl commented Sep 17, 2020

And now it is closed 😢 - like this one. Any updates that I missed searching, besides #10536?

@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/need 1 This PR needs approval from one additional maintainer to be merged. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue number will not be updated by closing an issue Open issue count not updated when closing through commits/PR merges
7 participants