Refactor issue creation from IO to Eff#322
Conversation
Convert createAPIChangeIssue, createRuntimeExceptionIssue, and createQueryAlertIssue from IO to Eff using genUUID and effectful Time. Replaces utcToLocalZonedTime (IO) with utcToZonedTime utc (pure). Removes liftIO wrappers from callers in BackgroundJobs.
PR Review: Refactor issue creation from IO to EffOverall this is a clean, well-scoped refactor. The direction is correct and the changes are minimal. A few observations: Behaviour change: timezone semantics
If UTC is the intended canonical timezone everywhere, this is the right fix — just flag it explicitly in the PR description so reviewers know it's intentional.
|
| Assessment | |
|---|---|
| Direction | Correct — lifts IO into testable effects |
| Correctness | Good, modulo the timezone semantics note above |
| Size | Appropriately small and focused |
| Consistency | Minor: two liftIO UUIDV4.nextRandom sites remain in BackgroundJobs.hs |
| Test coverage | The PR description's test plan is manual only; a unit test exercising the three functions with runStaticUUID/a mock Time interpreter would lock in the behaviour, but not a blocker for this refactor |
The timezone behaviour change is the only thing worth a explicit confirmation before merge.
Summary
createAPIChangeIssue,createRuntimeExceptionIssue,createQueryAlertIssuefromIOtoEff eswithUUIDEff/TimeconstraintsUUID4.nextRandomwithgenUUID(effectful, testable)utcToLocalZonedTime(IO, system-timezone-dependent) withutcToZonedTime utc(pure, deterministic)liftIOwrappers from callers inBackgroundJobs.hsBehavioral no-op — same logic, now composable with the effect system. Extracted from #300 to reduce PR size.
Test plan