Skip to content

refactor(project): reorganize project service modules#360

Merged
KurodaKayn merged 6 commits into
mainfrom
refactor/project-service-layout
Jun 21, 2026
Merged

refactor(project): reorganize project service modules#360
KurodaKayn merged 6 commits into
mainfrom
refactor/project-service-layout

Conversation

@KurodaKayn

Copy link
Copy Markdown
Owner

Change Description

  • Reorganizes project service helper code into focused subpackages for listing, media usage, and publication concerns.
  • Keeps the public project.Service and dashboard-facing methods intact while reducing root-package helper clutter.
  • Moves list cache implementation into listing/ without adding another nested cache directory.

Implementation Approach

  • Moved cursor pagination and list cache internals into internal/services/project/listing.
  • Moved media reference extraction and usage writes into internal/services/project/mediausage.
  • Moved publication platform/config/detail helpers into internal/services/project/publication and left thin root wrappers where callers need the existing API.

Testing

  • Passed: go test ./internal/services/project/...
  • Passed: go test ./...
  • Passed: golangci-lint run
  • Passed: bash script/ci/backend.sh
  • Passed: bash script/ci/compute-changes.sh pull_request origin/main HEAD
  • Not run locally: bash script/ci/content-pipeline-integration.sh because it builds and starts the Rust content-pipeline service for cross-service integration.
  • Not run locally: container image build from .github/workflows/container-images.yml; this backend-only PR will let CI build the selected backend image.

Risks(optional)

  • Low behavior risk: this is intended as package layout cleanup, with existing service methods preserved.

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.
@KurodaKayn KurodaKayn merged commit a4491b8 into main Jun 21, 2026
14 checks passed
@KurodaKayn KurodaKayn deleted the refactor/project-service-layout branch June 21, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant