Skip to content

fix: filter out intentional user-input errors from report-error#8178

Merged
khendrikse merged 1 commit intomainfrom
EX-2080/filter-out-intentional-user-input-errors
Apr 21, 2026
Merged

fix: filter out intentional user-input errors from report-error#8178
khendrikse merged 1 commit intomainfrom
EX-2080/filter-out-intentional-user-input-errors

Conversation

@khendrikse
Copy link
Copy Markdown
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

In our error report tool I'm seeing a lot of toml configuration errors. In my opinion our bug reporting should contain events that an engineer on-call could investigate as a potential bug. Everything currently in there that doesn't meet that bar is pollution. We should filter intentional user-input errors out in our error reporting.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@khendrikse khendrikse requested a review from a team as a code owner April 21, 2026 11:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error reporting to exclude specific configuration-related errors, reducing noise in error tracking and improving data quality.

Walkthrough

A guard clause was added to the reportError function in src/utils/telemetry/report-error.ts that returns early when an error's customErrorInfo.type equals 'resolveConfig'. This prevents such errors from being reported to Bugsnag. The check is positioned after error normalization but before configuration loading and telemetry payload construction. No other logic paths were modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: filter out intentional user-input errors from report-error' directly describes the main change: adding a filter to exclude user-input errors from error reporting.
Description check ✅ Passed The description explains the motivation for filtering user-input errors from bug reports and aligns with the changeset's goal of reducing noise in error reporting.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch EX-2080/filter-out-intentional-user-input-errors

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

@github-actions
Copy link
Copy Markdown

📊 Benchmark results

Comparing with eed553c

  • Dependency count: 1,061 (no change)
  • Package size: 355 MB ⬆️ 0.00% increase vs. eed553c
  • Number of ts-expect-error directives: 356 (no change)

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.

🧹 Nitpick comments (1)
src/utils/telemetry/report-error.ts (1)

31-35: Prefer self-explanatory code instead of behavior comments in this block.

The three inline comments can be replaced by a clear predicate variable name; this also keeps the check aligned with the normalized err variable.

♻️ Proposed refactor
-  // `@netlify/config` tags intentional user-input errors (malformed netlify.toml,
-  // invalid redirects, etc.) with this shape. See `@netlify/config/lib/error.js`.
-  // These are not CLI bugs and don't belong in Bugsnag.
-  if (error?.customErrorInfo?.type === 'resolveConfig') {
+  const isResolveConfigUserError = err?.customErrorInfo?.type === 'resolveConfig'
+  if (isResolveConfigUserError) {
     return
   }

As per coding guidelines, **/*.{ts,tsx,js,jsx}: Never write comments on what the code does; make the code clean and self-explanatory instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/telemetry/report-error.ts` around lines 31 - 35, Replace the inline
comments and raw check with a self-explanatory predicate: create a const like
isResolveConfigError (or isNetlifyConfigError) that evaluates the normalized
err?.customErrorInfo?.type === 'resolveConfig' and use that predicate in the
early return inside reportError (replace the current if
(error?.customErrorInfo?.type === 'resolveConfig') return). This keeps the logic
aligned with the normalized err variable and removes explanatory comments while
preserving behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/utils/telemetry/report-error.ts`:
- Around line 31-35: Replace the inline comments and raw check with a
self-explanatory predicate: create a const like isResolveConfigError (or
isNetlifyConfigError) that evaluates the normalized err?.customErrorInfo?.type
=== 'resolveConfig' and use that predicate in the early return inside
reportError (replace the current if (error?.customErrorInfo?.type ===
'resolveConfig') return). This keeps the logic aligned with the normalized err
variable and removes explanatory comments while preserving behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f992d25-2f0e-4037-9b78-f095c4f85a97

📥 Commits

Reviewing files that changed from the base of the PR and between eed553c and 8e4c136.

📒 Files selected for processing (1)
  • src/utils/telemetry/report-error.ts

@khendrikse khendrikse merged commit 7c50c25 into main Apr 21, 2026
104 of 105 checks passed
@khendrikse khendrikse deleted the EX-2080/filter-out-intentional-user-input-errors branch April 21, 2026 12:48
khendrikse pushed a commit that referenced this pull request Apr 21, 2026
🤖 I have created a release *beep* *boop*
---


## [25.1.1](v25.1.0...v25.1.1)
(2026-04-21)


### Bug Fixes

* filter out intentional user-input errors from report-error
([#8178](#8178))
([7c50c25](7c50c25))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
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.

2 participants