Title#
feat: migrate DirectiveService from GitHubService to PlatformProvider
Problem#
DirectiveService was directly injecting GitHubService, bypassing the platform abstraction layer introduced in #345. This tied directive handling tightly to GitHub, preventing platform-agnostic operation.
Task / Link#
Closes #350
Changes#
- Replaced
GitHubServiceinjection inDirectiveServicewith@Inject(PLATFORM_PROVIDER) platform: PlatformProvider - Replaced all
closePR,deleteBranchcalls withthis.platform.*equivalents - Replaced raw
fetch-basedpostRawCommentwiththis.platform.postCommentvia a privatepostPlatformCommenthelper that splits the fullowner/repostring - Updated
DirectiveModuleto importPlatformModuleinstead ofGitHubModule - Updated unit spec to mock
PLATFORM_PROVIDERtoken; replacedglobal.fetchassertions withplatformProvider.postCommentassertions - Updated integration tests (replan, restart, blocked-persistent) to use
PLATFORM_PROVIDERmock
Notes#
- The
PlatformProvider.postCommentinterface uses 4-arg form(owner, repo, issueNumber, body); a privatepostPlatformComment(repo, issueOrPrNumber, body)helper splits the fullowner/repostring to keep call sites clean - Fixed a pre-existing duplicate
beforeAll/afterAllblock inwatchdog.service.spec.tsuncovered during rebase
Testing#
- Unit tests:
directive.service.spec.ts— all assertions migrated, all pass - Integration tests: replan, restart, blocked-persistent — all pass
npm run lint— cleannpm run test— 800 tests, 48 suites, all pass