Skip to content

🧹 [code health] Replace console.error with application logger in github.ts#107

Open
is0692vs wants to merge 5 commits intomainfrom
jules-2039028350236114691-df98f7d5
Open

🧹 [code health] Replace console.error with application logger in github.ts#107
is0692vs wants to merge 5 commits intomainfrom
jules-2039028350236114691-df98f7d5

Conversation

@is0692vs
Copy link
Copy Markdown
Contributor

🎯 What: The code health issue addressed
Replaced a hardcoded console.error with the centralized logger.error for suppressed event fetch errors in src/lib/github.ts.

💡 Why: How this improves maintainability
This improves maintainability and log consistency across the application by ensuring all errors pass through the custom logging utility instead of raw console methods, making it easier to route errors to external services in production.

Verification: How you confirmed the change is safe
Ran npx vitest run src/lib/__tests__/github.test.ts which successfully output the new logger message, and ran the full test suite (npm run test -- --run) to confirm no regressions were introduced. Also passed ESLint validation.

Result: The improvement achieved
A cleaner, more consistent codebase without raw console calls polluting production logs.


PR created automatically by Jules for task 2039028350236114691 started by @is0692vs

Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-user-summary Ready Ready Preview, Comment Mar 27, 2026 7:08pm

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

Warning

Rate limit exceeded

@is0692vs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 14 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 14 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 89e584dc-f122-42d4-86c1-68ce385b93dc

📥 Commits

Reviewing files that changed from the base of the PR and between 26eca6f and 51d2182.

📒 Files selected for processing (1)
  • src/lib/github.ts
📝 Walkthrough

Walkthrough

src/lib/github.tsにおいて、console.error()を構造化ロギング用のlogger.error()に置き換えました。fetchActivity内の並行ページ取得時のエラー処理で、ロギング出力メカニズムのみが変更されています。

Changes

Cohort / File(s) Summary
ロギングメカニズム更新
src/lib/github.ts
loggerモジュールをインポートし、console.error()の呼び出しをlogger.error()に置き換えました。エラーハンドリングの出力メカニズムを構造化ロギングに統一しています。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 ロガーの友よ、やってきた
コンソールから卒業して
構造化の道へと進む
エラーメッセージ、整列して
美しきログの流れ、かな ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing console.error with the application logger in github.ts, which is a code health improvement.
Description check ✅ Passed The description is well-related to the changeset, explaining what was changed, why it improves the codebase, and how it was verified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-2039028350236114691-df98f7d5

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


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 and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces console.error with a centralized logger in src/lib/github.ts. A suggestion was made to update the log message for rejected promises to be more accurate, as the current "suppressed" terminology is misleading given that the errors are handled later in the execution flow.


// Suppress unhandled promise rejections for subsequent pages if we break early or throw
promises.forEach((p) => p.catch((e) => console.error("Suppressed event fetch error:", e)));
promises.forEach((p) => p.catch((e) => logger.error("Suppressed event fetch error:", e)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly switches to the centralized logger, the log message 'Suppressed event fetch error' can be misleading. When a promise is awaited in the loop below and rejects, this log is printed, but the error isn't truly 'suppressed'—it's handled by the try/catch block and causes the loop to terminate early. This can make debugging confusing. Per repository guidelines, ensure that when handling promise rejections, the error is logged to facilitate debugging.

Suggested change
promises.forEach((p) => p.catch((e) => logger.error("Suppressed event fetch error:", e)));
promises.forEach((p) => p.catch((e) => logger.error("Event fetch promise rejected:", e)));
References
  1. When suppressing unhandled promise rejections, log the error instead of silently ignoring it to facilitate debugging.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/github.ts`:
- Line 2: The import in src/lib/github.ts uses a relative path for logger;
change the import of logger to use the project path alias (e.g., replace the
relative import of logger with an import from "@/logger") so it follows the repo
rule for src imports; update the import statement that references logger to use
the "@/logger" alias and run a quick typecheck to ensure the alias resolves.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 96013737-85f7-458d-a450-2aa833a6d11a

📥 Commits

Reviewing files that changed from the base of the PR and between e6bd6f9 and 26eca6f.

📒 Files selected for processing (1)
  • src/lib/github.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@is0692vs
Copy link
Copy Markdown
Contributor Author

Addressed both review items in : switched import to and changed the rejection log message to (commit ). Added ❤️ reactions and resolved addressed threads.

@google-labs-jules
Copy link
Copy Markdown
Contributor

Addressed both review items in : switched import to and changed the rejection log message to (commit ). Added ❤️ reactions and resolved addressed threads.

Acknowledged.

Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Switch logger import to @/ alias and clarify rejected-promise log wording in fetchActivity.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/hirokis-projects-afd618c7?upgradeToPro=build-rate-limit

@is0692vs
Copy link
Copy Markdown
Contributor Author

Addressed the review feedback and pushed commit 51d2182.

  • switched logger import to @/lib/logger
  • updated log message to Event fetch promise rejected:
  • verified with npm run lint, npm test -- --run, and npx tsc --noEmit

Could you please re-review this PR?

@google-labs-jules
Copy link
Copy Markdown
Contributor

Addressed the review feedback and pushed commit 51d2182.

  • switched logger import to @/lib/logger
  • updated log message to Event fetch promise rejected:
  • verified with npm run lint, npm test -- --run, and npx tsc --noEmit

Could you please re-review this PR?

Acknowledged.

Co-authored-by: is0692vs <135803462+is0692vs@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant