-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Close issue as archived/resolved/stale #25362
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
Changes from all commits
aadd437
acca287
e0a4589
8ffa87d
8d0d28f
dd71557
74e2af8
fa4ff21
23d466d
361b8fd
cde821b
d42d25f
42de795
cebbe9a
7942140
28cac1a
c5b34e7
fcbedc4
183cd82
a031a6e
033e330
a4257c9
83463c7
dace5ce
fdb2977
76730d3
369f995
3cff52d
ead945b
28e861a
c1d088c
322a460
517073b
1514c44
6fcc8f7
a2a2c74
27b4722
944287b
28b8934
f427385
1757d03
0f5be3a
edd9408
ded55c9
2725dd2
a698533
b20c4a2
9f433b9
059d9f2
88d9f11
a4a458c
11ca184
0890e4b
0c5d196
c6aa993
795818b
5bf1e17
2e2bbca
a239bee
ef2318a
e93ece6
72a1e78
b0a0678
4a5a5aa
976e306
52d654b
ed1cc0c
fbb1bdd
512023e
8ee7d25
062e2c4
bd6b17f
28284ad
3979279
139599e
595af89
0a4c7f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,15 @@ func (err ErrIssueWasClosed) Error() string { | |
return fmt.Sprintf("Issue [%d] %d was already closed", err.ID, err.Index) | ||
} | ||
|
||
type IssueClosedStatus int8 | ||
|
||
const ( | ||
IssueClosedStatusCommon IssueClosedStatus = iota // 0 close issue without any state. | ||
IssueClosedStatusArchived // 1 | ||
IssueClosedStatusResolved // 2 | ||
IssueClosedStatusStale // 3 | ||
) | ||
|
||
// Issue represents an issue or pull request of repository. | ||
type Issue struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
|
@@ -110,12 +119,13 @@ type Issue struct { | |
Milestone *Milestone `xorm:"-"` | ||
Project *project_model.Project `xorm:"-"` | ||
Priority int | ||
AssigneeID int64 `xorm:"-"` | ||
Assignee *user_model.User `xorm:"-"` | ||
IsClosed bool `xorm:"INDEX"` | ||
IsRead bool `xorm:"-"` | ||
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not. | ||
PullRequest *PullRequest `xorm:"-"` | ||
AssigneeID int64 `xorm:"-"` | ||
Assignee *user_model.User `xorm:"-"` | ||
IsClosed bool `xorm:"INDEX"` | ||
ClosedStatus IssueClosedStatus `xorm:"NOT NULL DEFAULT 0"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could rename to just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would strongly suggest to use two words. One-word column would cause ambiguity easily, and sometimes when the single-word is a database keyword, it causes SQL failures when the quoting is forgotten. |
||
IsRead bool `xorm:"-"` | ||
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not. | ||
PullRequest *PullRequest `xorm:"-"` | ||
NumComments int | ||
Ref string | ||
PinOrder int `xorm:"DEFAULT 0"` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package v1_21 //nolint | ||
|
||
import ( | ||
issues_model "code.gitea.io/gitea/models/issues" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func AddClosedStatusToIssue(x *xorm.Engine) error { | ||
type Issue struct { | ||
ClosedStatus issues_model.IssueClosedStatus `xorm:"NOT NULL DEFAULT 0"` | ||
} | ||
|
||
return x.Sync(new(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.
As per discussion in #22793, I would request only two states:
IssueClosedStatusCompleted
andIssueClosedStatusNotPlanned
, default isIssueClosedStatusCompleted
.