Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

  • Create new packages/library-service crate structure
    • Create Cargo.toml with workspace dependencies
    • Create project.json for NX integration
    • Create README.md with documentation
  • Move library service implementation from grpc-service/src/library/ to new crate
    • Copy mod.rs as handlers.rs, delete_handlers.rs, metadata_handlers.rs, update_handlers.rs
    • Copy content_resolver/ module (mod.rs, game_resolver.rs, platform_resolver.rs, parser.rs, tests.rs)
    • Add job_manager.rs (moved from grpc-service/src/jobs/)
    • Skip utils.rs (dead code with broken import)
  • Export library_service_server() function from the new crate
  • Update grpc-service crate
    • Remove library module
    • Remove local job_manager.rs (now in library-service)
    • Add dependency on retrom-library-service
    • Update lib.rs to use new crate's library_service_server()
    • Update jobs/mod.rs to use JobManager from library-service
    • Update metadata/mod.rs to use JobManager and JobError from library-service
    • Update README.md to reference library-service
  • Update workspace configuration
    • Add retrom-library-service to root Cargo.toml workspace members
    • Add retrom-library-service as workspace dependency
  • Verify build and tests pass
  • Run code review and address feedback
Original prompt

Refactor the gRPC server implementation by moving the Library Service out of the monolithic grpc-service crate into a new workspace crate named library-service.

Requirements:

  • Create a new crate: packages/library-service
  • Move related code (handlers, modules, utilities) from packages/grpc-service/src/library/ into library-service.
  • In library-service, export a function (e.g., library_service_server) returning LibraryServiceServer configured with a constructed handler.
  • Update all dependencies to use [workspace] resolution where possible.
  • Remove the library service implementation from the grpc-service crate. In grpc-service, update routing to use the library server from the new crate.
  • Add documentation and ensure README.md reflects the change.
  • Ensure build and test pass for the workspace.
  • Update root workspace Cargo.toml and relevant package Cargo.toml files to include and use the new crate.

References:

  • [Design notes from chat]
  • Existing handlers are in packages/grpc-service/src/library/.
  • Proto types are in codegen.
  • Main workspace path for new crate: packages/library-service.

This PR should only migrate the Library Service as a representative example, setting the foundation for similar future extractions for other services.

This pull request was created as a result of the following prompt from Copilot chat.

Refactor the gRPC server implementation by moving the Library Service out of the monolithic grpc-service crate into a new workspace crate named library-service.

Requirements:

  • Create a new crate: packages/library-service
  • Move related code (handlers, modules, utilities) from packages/grpc-service/src/library/ into library-service.
  • In library-service, export a function (e.g., library_service_server) returning LibraryServiceServer configured with a constructed handler.
  • Update all dependencies to use [workspace] resolution where possible.
  • Remove the library service implementation from the grpc-service crate. In grpc-service, update routing to use the library server from the new crate.
  • Add documentation and ensure README.md reflects the change.
  • Ensure build and test pass for the workspace.
  • Update root workspace Cargo.toml and relevant package Cargo.toml files to include and use the new crate.

References:

  • [Design notes from chat]
  • Existing handlers are in packages/grpc-service/src/library/.
  • Proto types are in codegen.
  • Main workspace path for new crate: packages/library-service.

This PR should only migrate the Library Service as a representative example, setting the foundation for similar future extractions for other services.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Created new `packages/library-service` crate with LibraryService implementation
- Moved content_resolver, delete_handlers, metadata_handlers, update_handlers from grpc-service
- Added job_manager module to library-service for background job management
- Exported library_service_server() function for easy integration
- Updated grpc-service to use new library-service crate
- Removed library module from grpc-service
- Updated workspace Cargo.toml with new crate
- Added README documentation for library-service

Co-authored-by: JMBeresford <1373954+JMBeresford@users.noreply.github.com>
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.

2 participants