refactor: remove tree dependency from TagsService and PropertiesService#1022
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors tag and property indexing so that TagsService and PropertiesService no longer depend on TreeService for a one-time startup bootstrap. Instead, Wiki performs a single startup walk and batched page load, then feeds raw content into both indexes.
Changes:
- Remove
TreeServicedependency andIndexAllPagesbootstrapping frominternal/tags.TagsServiceandinternal/properties.PropertiesService. - Add
Wiki.bootstrapTagsAndProperties()to bootstrap both indexes from a singleWalkNodes+ parallelGetPagespass. - Update tests and pagesave side-effect tests to construct services without a tree dependency.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/wiki/wiki.go | Centralizes tags/properties startup bootstrap into one tree walk + GetPages pass. |
| internal/wiki/tags/use_cases_test.go | Updates tags use-case test setup for new NewTagsService signature. |
| internal/wiki/pagesave/tags_effect_test.go | Updates tags side-effect test to use new service constructor. |
| internal/wiki/pagesave/properties_effect_test.go | Updates properties side-effect test to use new service constructor. |
| internal/tags/tags_service.go | Removes tree dependency and deletes IndexAllPages; service is now store-only. |
| internal/tags/tags_service_test.go | Reworks tests to bootstrap via helper using TreeService externally. |
| internal/properties/properties_service.go | Removes tree dependency; introduces IndexPageContent. |
| internal/properties/properties_service_test.go | Updates bootstrap approach and adds IndexPageContent coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
55d433b to
401c6d5
Compare
Both services only used tree for their IndexAllPages bootstrap — no runtime dependency. IndexAllPages is removed from both services; wiki.go now runs a single parallel GetPages pass at startup that feeds both indexes instead of two sequential ReadPageRaw loops
401c6d5 to
e934081
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both services only used tree for their IndexAllPages bootstrap — no runtime dependency. IndexAllPages is removed from both services; wiki.go now runs a single parallel GetPages pass at startup that feeds both indexes instead of two sequential ReadPageRaw loops