improve token acquisition for gh events service#12
Conversation
Treat the GitHub token as stable client configuration instead of passing it through every service method and private helper. `GitHubEvents.Default` is now parameterized by the token which lets the service capture it, while `HttpClient.mapRequest` configures authentication and GitHub headers once for every request made by the service. Since token acquisition is effectful, `Layer.unwrapEffect` turns it into layer construction. Error handling now wraps the fully provided program so token-acquisition and service-construction failures are handled too.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGitHub event retrieval now receives its bearer token through service options and applies authentication and GitHub headers at the HTTP client level. Event collection and fetching no longer pass tokens through their method signatures. The application entry point constructs the CLI and GitHub events layers, provides them with the HTTP client layer, formats retrieved events, and runs the resulting program. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Treat the GitHub token as stable client configuration instead of passing
it through every service method and private helper.
GitHubEvents.Defaultis now parameterized by the token which lets theservice capture it, while
HttpClient.mapRequestconfiguresauthentication and GitHub headers once for every request made by the
service.
Since token acquisition is effectful,
Layer.unwrapEffectturns it intolayer construction. Error handling now wraps the fully provided program
so token-acquisition and service-construction failures are handled too.