refactor(project): reorganize project service modules#360
Merged
Conversation
Project list pagination helpers lived in the root service package alongside higher-level list orchestration. Move cursor parsing, cursor encoding, page normalization, and pagination response shaping into the listing package. The root project service keeps the same list methods while delegating low-level pagination details.
Media reference extraction and asset usage writes were mixed into the root project service package. Move the media usage implementation and its duplicate-resource test into a focused mediausage package. The project service keeps its existing refresh hooks while delegating the storage details.
Publication platform validation, default config building, and detail shaping were scattered through the root project package. Move those helpers into a publication package and keep thin wrappers for existing project service callers. Add focused tests for the detail response variants so existing response shapes stay stable.
Dashboard project list cache code belongs with the rest of the project listing mechanics. Move the cache implementation and key tests from the cache package into listing and update the root facade import. This removes the extra cache directory while keeping the list cache behavior unchanged.
The root project directory still had separate list cache files after moving the cache implementation into listing. Merge the project service cache facade into list.go and move the integration cache tests under listing. Project listing code keeps the required Service methods without leaving standalone list cache files in the root package.
Publication config helpers now call contentsetup directly from the publication package. Remove the old project package wrapper functions and the no longer needed datatypes import. This keeps the refactor lint-clean without changing content setup behavior.
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.
Change Description
project.Serviceand dashboard-facing methods intact while reducing root-package helper clutter.listing/without adding another nested cache directory.Implementation Approach
internal/services/project/listing.internal/services/project/mediausage.internal/services/project/publicationand left thin root wrappers where callers need the existing API.Testing
go test ./internal/services/project/...go test ./...golangci-lint runbash script/ci/backend.shbash script/ci/compute-changes.sh pull_request origin/main HEADbash script/ci/content-pipeline-integration.shbecause it builds and starts the Rust content-pipeline service for cross-service integration..github/workflows/container-images.yml; this backend-only PR will let CI build the selected backend image.Risks(optional)