Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Convert ErrorReporting to a Service to use DI. Add some tests (no-changelog) #11279

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented Oct 16, 2024

PAY-2113

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Tests included.

@netroy netroy requested a review from ivov October 16, 2024 09:49
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Oct 16, 2024
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

🙏🏻

packages/cli/src/error-reporting.ts Outdated Show resolved Hide resolved
packages/cli/src/__tests__/error-reporting.test.ts Outdated Show resolved Hide resolved
) {}

async init() {
if (this.initialized) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we throw instead? We should prevent multiple init calls from existing.

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure. if you tell me that we should throw here, then I'll update this.

Copy link
Contributor

Choose a reason for hiding this comment

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

What makes you doubt? My reasoning is that initializing this twice means a developer error, so we could have an assertion error enforcing this. From what I see init is called only from BaseCommand.

Copy link
Member Author

Choose a reason for hiding this comment

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

should we instead just remove the initialized flag, since there is only one place calling init ? we don't do this for most other singleton in the system.

packages/cli/src/error-reporting.ts Outdated Show resolved Hide resolved
packages/cli/src/error-reporting.ts Outdated Show resolved Hide resolved
@netroy netroy force-pushed the PAY-2113-error-reporter-di branch from e16b6ce to 2a970df Compare December 11, 2024 01:57
@netroy netroy requested a review from ivov December 11, 2024 08:05
Copy link

cypress bot commented Dec 11, 2024

n8n    Run #8289

Run Properties:  status check passed Passed #8289  •  git commit 2a970dff1c: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project n8n
Branch Review PAY-2113-error-reporter-di
Run status status check passed Passed #8289
Run duration 04m 36s
Commit git commit 2a970dff1c: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 480
View all changes introduced in this branch ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit 73145b7 into master Dec 11, 2024
109 checks passed
@netroy netroy deleted the PAY-2113-error-reporter-di branch December 11, 2024 14:36
@janober
Copy link
Member

janober commented Dec 19, 2024

Got released with n8n@1.73.0

riascho pushed a commit that referenced this pull request Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants