refactor: reorganize API imports and enable error reporting#132
Merged
graphite-app[bot] merged 1 commit intomasterfrom Jan 31, 2026
Merged
Conversation
Collaborator
Author
How to use the Graphite Merge QueueAdd the label to merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Comment on lines
+2
to
+12
| import { CalcApi } from "./handlers/calc/api"; | ||
| import { HealthApi } from "./handlers/health/api"; | ||
| import { GuildConfigApi } from "./handlers/guildConfig/api"; | ||
| import { MessageCheckinApi } from "./handlers/messageCheckin/api"; | ||
| import { MessageRoomOrderApi } from "./handlers/messageRoomOrder/api"; | ||
| import { MessageSlotApi } from "./handlers/messageSlot/api"; | ||
| import { SheetApi } from "./handlers/sheet/api"; | ||
| import { MonitorApi } from "./handlers/monitor/api"; | ||
| import { PlayerApi } from "./handlers/player/api"; | ||
| import { ScreenshotApi } from "./handlers/screenshot/api"; | ||
| import { ScheduleApi } from "./handlers/schedule/api"; |
There was a problem hiding this comment.
Import paths updated to use /api suffix, but http.ts still uses old pattern (importing from handler directories without suffix). Consider updating http.ts for consistency.
Suggested change
| import { CalcApi } from "./handlers/calc/api"; | |
| import { HealthApi } from "./handlers/health/api"; | |
| import { GuildConfigApi } from "./handlers/guildConfig/api"; | |
| import { MessageCheckinApi } from "./handlers/messageCheckin/api"; | |
| import { MessageRoomOrderApi } from "./handlers/messageRoomOrder/api"; | |
| import { MessageSlotApi } from "./handlers/messageSlot/api"; | |
| import { SheetApi } from "./handlers/sheet/api"; | |
| import { MonitorApi } from "./handlers/monitor/api"; | |
| import { PlayerApi } from "./handlers/player/api"; | |
| import { ScreenshotApi } from "./handlers/screenshot/api"; | |
| import { ScheduleApi } from "./handlers/schedule/api"; | |
| import { CalcApi } from "./handlers/calc/api"; | |
| import { HealthApi } from "./handlers/health/api"; | |
| import { GuildConfigApi } from "./handlers/guildConfig/api"; | |
| import { MessageCheckinApi } from "./handlers/messageCheckin/api"; | |
| import { MessageRoomOrderApi } from "./handlers/messageRoomOrder/api"; | |
| import { MessageSlotApi } from "./handlers/messageSlot/api"; | |
| import { SheetApi } from "./handlers/sheet/api"; | |
| import { MonitorApi } from "./handlers/monitor/api"; | |
| import { PlayerApi } from "./handlers/player/api"; | |
| import { ScreenshotApi } from "./handlers/screenshot/api"; | |
| import { ScheduleApi } from "./handlers/schedule/api"; |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/sheet-apis/src/api.ts
Line: 2:12
Comment:
Import paths updated to use `/api` suffix, but `http.ts` still uses old pattern (importing from handler directories without suffix). Consider updating `http.ts` for consistency.
```suggestion
import { CalcApi } from "./handlers/calc/api";
import { HealthApi } from "./handlers/health/api";
import { GuildConfigApi } from "./handlers/guildConfig/api";
import { MessageCheckinApi } from "./handlers/messageCheckin/api";
import { MessageRoomOrderApi } from "./handlers/messageRoomOrder/api";
import { MessageSlotApi } from "./handlers/messageSlot/api";
import { SheetApi } from "./handlers/sheet/api";
import { MonitorApi } from "./handlers/monitor/api";
import { PlayerApi } from "./handlers/player/api";
import { ScreenshotApi } from "./handlers/screenshot/api";
import { ScheduleApi } from "./handlers/schedule/api";
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Merge activity
|
### TL;DR
Reorganized API handler imports and enabled error reporting in runtime configurations.
### What changed?
- Updated import paths for all API handlers to follow a more structured pattern (e.g., from `./handlers/calc` to `./handlers/calc/api`)
- Removed the `disableErrorReporting: true` flag from runtime configurations in:
- `packages/sheet-apis/src/index.ts`
- `packages/sheet-bot/src/index.ts`
- `packages/sheet-db-server/src/index.ts`
### How to test?
1. Verify that all imports resolve correctly by building the project
2. Check that error reporting is now properly enabled by triggering a test error in each service
3. Confirm that the application functionality remains unchanged
### Why make this change?
- The restructured imports provide better organization of API handlers, making the codebase more maintainable
- Enabling error reporting will improve debugging capabilities by ensuring errors are properly captured and reported in production environments
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR reorganizes API handler imports in `sheet-apis` to use explicit `/api` paths and enables error reporting across three services (`sheet-apis`, `sheet-bot`, `sheet-db-server`).
**Key Changes:**
- Updated all handler imports in `packages/sheet-apis/src/api.ts` from `./handlers/calc` to `./handlers/calc/api` for better code organization
- Removed `disableErrorReporting: true` flag from `NodeRuntime.runMain()` calls in three service entry points
- All changes are backward compatible due to existing `index.ts` re-exports in handler directories
**Impact:**
- Import path changes are purely organizational and don't affect functionality
- Enabling error reporting will improve debugging by allowing Effect's runtime to capture and report unhandled errors
- The services already have OpenTelemetry observability configured (traces and metrics), so error reporting complements existing monitoring
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with minimal risk
- The changes are straightforward refactoring with no logical changes. Import path updates work correctly due to existing re-exports. Enabling error reporting is a safe configuration change that improves observability. Minor style inconsistency noted but doesn't affect functionality.
- No files require special attention - all changes are low-risk refactoring and configuration updates
<h3>Important Files Changed</h3>
| Filename | Overview |
|----------|----------|
| packages/sheet-apis/src/api.ts | Updated import paths from `./handlers/calc` to `./handlers/calc/api` for better organization |
| packages/sheet-apis/src/index.ts | Removed `disableErrorReporting: true` flag to enable error reporting |
| packages/sheet-bot/src/index.ts | Removed `disableErrorReporting: true` flag to enable error reporting |
| packages/sheet-db-server/src/index.ts | Removed `disableErrorReporting: true` flag to enable error reporting |
</details>
<h3>Sequence Diagram</h3>
```mermaid
sequenceDiagram
participant Dev as Developer
participant API as api.ts
participant Handlers as Handler Modules
participant Runtime as NodeRuntime
participant Observability as Error Reporting System
Note over Dev,Handlers: Import Path Reorganization
Dev->>API: Update imports to use /api suffix
API->>Handlers: Import from ./handlers/calc/api
Handlers-->>API: Return CalcApi, HealthApi, etc.
Note over Dev,Observability: Error Reporting Enablement
Dev->>Runtime: Remove disableErrorReporting flag
Runtime->>Runtime: Enable error reporting (default behavior)
Note over Runtime,Observability: Runtime Execution with Error Reporting
Runtime->>Observability: Capture and report errors
Observability-->>Runtime: Error tracking active
Note over API,Handlers: Both import patterns supported
API->>Handlers: New: ./handlers/calc/api
API->>Handlers: Old: ./handlers/calc (via index.ts)
Handlers-->>API: Both resolve correctly
```
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
7e458eb to
3200efd
Compare
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.

TL;DR
Reorganized API handler imports and enabled error reporting in runtime configurations.
What changed?
./handlers/calcto./handlers/calc/api)disableErrorReporting: trueflag from runtime configurations in:packages/sheet-apis/src/index.tspackages/sheet-bot/src/index.tspackages/sheet-db-server/src/index.tsHow to test?
Why make this change?
Greptile Overview
Greptile Summary
This PR reorganizes API handler imports in
sheet-apisto use explicit/apipaths and enables error reporting across three services (sheet-apis,sheet-bot,sheet-db-server).Key Changes:
packages/sheet-apis/src/api.tsfrom./handlers/calcto./handlers/calc/apifor better code organizationdisableErrorReporting: trueflag fromNodeRuntime.runMain()calls in three service entry pointsindex.tsre-exports in handler directoriesImpact:
Confidence Score: 4/5
Important Files Changed
./handlers/calcto./handlers/calc/apifor better organizationdisableErrorReporting: trueflag to enable error reportingdisableErrorReporting: trueflag to enable error reportingdisableErrorReporting: trueflag to enable error reportingSequence Diagram
sequenceDiagram participant Dev as Developer participant API as api.ts participant Handlers as Handler Modules participant Runtime as NodeRuntime participant Observability as Error Reporting System Note over Dev,Handlers: Import Path Reorganization Dev->>API: Update imports to use /api suffix API->>Handlers: Import from ./handlers/calc/api Handlers-->>API: Return CalcApi, HealthApi, etc. Note over Dev,Observability: Error Reporting Enablement Dev->>Runtime: Remove disableErrorReporting flag Runtime->>Runtime: Enable error reporting (default behavior) Note over Runtime,Observability: Runtime Execution with Error Reporting Runtime->>Observability: Capture and report errors Observability-->>Runtime: Error tracking active Note over API,Handlers: Both import patterns supported API->>Handlers: New: ./handlers/calc/api API->>Handlers: Old: ./handlers/calc (via index.ts) Handlers-->>API: Both resolve correctly