-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Refactor issue indexer #5363
Refactor issue indexer #5363
Conversation
1155231
to
c17f19d
Compare
Codecov Report
@@ Coverage Diff @@
## master #5363 +/- ##
==========================================
- Coverage 38.84% 38.79% -0.05%
==========================================
Files 349 353 +4
Lines 49801 50109 +308
==========================================
+ Hits 19346 19442 +96
- Misses 27655 27853 +198
- Partials 2800 2814 +14
Continue to review full report at Codecov.
|
d7e7473
to
238bec6
Compare
It's ready to review. |
5092ca5
to
5d965a5
Compare
2d527e9
to
45a6026
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.
Just some comments - no hard rejects. I guess my most hard comment is that I'm not sure that the index search functions should really be in models
but I'm not stuck.
modules/setting/setting.go
Outdated
@@ -1215,6 +1232,22 @@ func NewContext() { | |||
// Explicitly disable credential helper, otherwise Git credentials might leak | |||
git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "credential.helper=") | |||
} | |||
|
|||
sec = Cfg.Section("indexer") |
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.
Can we split this out to modules/setting/indexer.go?
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.
done.
Gopkg.toml
Outdated
@@ -119,4 +119,4 @@ ignored = ["google.golang.org/appengine*"] | |||
|
|||
[[constraint]] | |||
name = "github.com/prometheus/client_golang" | |||
version = "0.9.0" | |||
version = "0.9.0" |
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.
This probably should have a new line at the end of this file.
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.
done.
@@ -7,25 +7,60 @@ package models | |||
import ( |
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.
Probably out of scope for this PR, but I wonder if we really want this functionality in models/
rather than in modules/indexer/
. (Obviously out of scope: I think we probably need to restructure models
to make it less of a grab-bag of everything and try to move struct into perhaps a core-models and peripheral/plugin system. )
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 would like to do that, but it will change more files. I prefer to do that on another refactor PRs.
b4f8e17
to
2e89743
Compare
Moving back to 1.8.0 |
This PR refactor issue indexer implementation and create two interface, one is
Indexer
another isQueue
and provideBleveIndexer
,ChannelQueuue
andLevelQueue
. And you can add new implementation after this PR merged.This PR will keep the issue indexer compitable with lower Gitea version.
EDIT: This PR also fixed some bugs on indexing and added delete index when deleting a repository or future deleting a standalone issue or pull request.