Skip to content

improve token acquisition for gh events service#12

Merged
dhth merged 1 commit into
mainfrom
improve-dependency-mgmt-for-gh-events-service
Jul 13, 2026
Merged

improve token acquisition for gh events service#12
dhth merged 1 commit into
mainfrom
improve-dependency-mgmt-for-gh-events-service

Conversation

@dhth

@dhth dhth commented Jul 13, 2026

Copy link
Copy Markdown
Owner

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.

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.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3615baa8-9da8-498e-9d98-8f47f9cc4849

📥 Commits

Reviewing files that changed from the base of the PR and between fc69d16 and 2701ffc.

📒 Files selected for processing (2)
  • src/index.ts
  • src/services/github/events.ts

📝 Walkthrough

Walkthrough

GitHub 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)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: improving GitHub events token acquisition.
Description check ✅ Passed The description accurately describes the token-capture and layer-construction changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dhth
dhth merged commit 31f1d9b into main Jul 13, 2026
5 checks passed
@dhth
dhth deleted the improve-dependency-mgmt-for-gh-events-service branch July 13, 2026 07:08
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.

1 participant