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

refactor(core): Improve UX on permission errors (no-changelog) #13795

Merged
merged 7 commits into from
Mar 11, 2025

Conversation

netroy
Copy link
Member

@netroy netroy commented Mar 10, 2025

Summary

This PR improves the execution permission errors UX by

  1. improving the error messages related to credentials sharing, to clearly distinguish between personal project issues and team project issues. and
  2. rendering any credentials related permission error on the correct node, even if no node is actually executed.

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Mar 10, 2025
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 88.09524% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ckages/cli/src/workflow-execute-additional-data.ts 66.66% 2 Missing ⚠️
packages/cli/src/workflow-runner.ts 71.42% 1 Missing and 1 partial ⚠️
...es/cli/src/workflows/workflow-execution.service.ts 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@netroy netroy force-pushed the improve-permission-errors branch from fd835a8 to c5d3773 Compare March 10, 2025 16:22
@netroy netroy force-pushed the improve-permission-errors branch from c5d3773 to a688e95 Compare March 10, 2025 17:09
@netroy netroy requested a review from ivov March 10, 2025 17:09
error: NodeApiError | NodeOperationError | WorkflowOperationError,
node: INode,
error: ExecutionError,
node: INode | undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know in which cases we can have a node-less error?

Copy link
Member Author

@netroy netroy Mar 10, 2025

Choose a reason for hiding this comment

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

when SubworkflowPolicyChecker.check throws

@netroy netroy force-pushed the improve-permission-errors branch from 8f39efb to 40d9c33 Compare March 11, 2025 11:07
@netroy netroy requested a review from ivov March 11, 2025 12:18
ivov
ivov previously approved these changes Mar 11, 2025
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.

🙏🏻

@Service()
export class PermissionChecker {
export class CredentialsPermissionChecker {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this name better 👍🏻

ivov
ivov previously approved these changes Mar 11, 2025
Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Mar 11, 2025

n8n    Run #9709

Run Properties:  status check passed Passed #9709  •  git commit ca9e62bdc0: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Project n8n
Branch Review master
Run status status check passed Passed #9709
Run duration 04m 41s
Commit git commit ca9e62bdc0: 🌳 master 🖥️ browsers:node18.12.0-chrome107 🤖 PR User 🗃️ e2e/*
Committer कारतोफ्फेलस्क्रिप्ट™
View all properties for this run ↗︎

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

Copy link
Contributor

✅ All Cypress E2E specs passed

@netroy netroy merged commit ca9e62b into master Mar 11, 2025
39 checks passed
@netroy netroy deleted the improve-permission-errors branch March 11, 2025 16:52
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants