refactor(api): use createHono and request-id logging in config_builder#2086
Conversation
…nfig_builder
Switch /private/config/builder to the backend-standard createHono factory and
add cloudlog calls with c.get('requestId') for both the disabled and enabled
branches, matching the convention in other backend endpoints.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors Hono app creation to use a shared factory, adds requestId and OAuth-credential logging to the config builder GET handler, extracts and logs parsed OAuth scopes before returning them, and removes an unused intermediate formatting variable in Credits.vue. ChangesConfig Builder Handler Enhancement
Credits.vue Formatting Tweak
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
…eatehono-logging # Conflicts: # supabase/functions/_backend/private/config_builder.ts
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|



Summary
Switches
/private/config/builderto the backend-standard Hono bootstrap and adds structured request-id logging, addressing review feedback that the endpoint diverged from the conventions used by other backend routes.new Hono<MiddlewareKeyVariables>()withcreateHono('', version)fromutils/hono.ts(still mountsuseCors).GET /handler, readc.get('requestId')and emitcloudlog({ requestId, context: 'config_builder', enabled, ... })for both the disabled (missing env vars) and enabled responses.scopeCountrather than the raw scopes/secret payload to keep logs small and avoid persisting OAuth values.No behavior change: the response shape and status codes are identical; tests in
tests/config-builder.unit.test.tscontinue to pass.Test plan
bunx vitest run tests/config-builder.unit.test.ts— 8/8 passbunx eslint supabase/functions/_backend/private/config_builder.ts— clean/private/config/builderwith and withoutGOOGLE_OAUTH_CLIENT_ID/GOOGLE_OAUTH_CLIENT_SECRET; verify arequestIdfield appears in logs for each responseSummary by CodeRabbit