[FFS-4303] Make RegisterRoutes only wire HTTP paths to handlers.#67
Merged
iannorriswork merged 10 commits intomainfrom May 6, 2026
Merged
Conversation
Create education and veteran service instances in app.New and provide a WithCB circuit-breaker wrapper using a Redis breaker. Pass EDU, VA and WithCB through RouterParams and update route registration to use the injected services and WithCB instead of constructing services/middleware in the router. Clean up related imports and centralize service/circuit-breaker setup in the app initializer.
Introduce stubEducationService and stubVeteranService in api/routes/router_test.go and add context import. Update RegisterRoutes calls in tests to provide EDU, VA and a no-op WithCB instead of the previous encryption mock. Also update imports (remove encryption, add education and veteran) and wire stubs to decouple route tests from encryption/circuit-breaker behavior.
iannorriswork
previously approved these changes
May 4, 2026
Remove unused fields (DB, RDB, Encryption) from RouterParams and drop corresponding imports (database/sql, redis, encryption). Update api/app.go to construct RouterParams with only the needed fields (CFG, Reporter, Logger, EDU, VA, WithCB). This simplifies the router interface and removes unnecessary dependencies.
Add runtime nil checks in RegisterRoutes to panic if required dependencies are missing (app, CFG, Reporter, EDU, VA, WithCB) while preserving a default slog logger when Logger is nil. Simplify tests by removing the Redis client, getRedisAddr helper, and the redis import; tests no longer pass RDB to RouterParams, avoiding an external Redis dependency.
Replace named receiver variables with the blank identifier in stubEducationService and stubVeteranService methods in api/routes/router_test.go. This removes unused receiver names and avoids linter/warning noise for methods: LookupEnrollmentStatus, RegisterBatch, GetBatchStatus, GetBatchDetails, and LookupDisabilityRating.
iannorriswork
approved these changes
May 6, 2026
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.
Jira Ticket
Description
Moved all dependency creation out of router.go and into app.go. RegisterRoutes should not be a factory for dependencies and services but instead just for route composition.
Submitter Checklist
Reviewer Checklist
api-spec/and follows the organization's standards.Evidence of Testing