feat(core): Link all shared credentials to the personal project of the user it's shared with
Summary
Make sure every shared credential is linked to the personal project of the user it's shared with.
This also contains code that makes sure every user created via integration test helpers has a personal project. This may become obsolete when https://github.com/n8n-io/n8n/pull/8550 lands.
Related tickets and issues
https://linear.app/n8n/issue/PAY-1349/make-sure-that-sharedcredentials-always-link-to-a-project
Review / Merge checklist
- [ ] PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use
(no-changelog)otherwise. (conventions) - [ ] Docs updated or follow-up ticket created.
- [ ] Tests included.
A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests.
I've decided against doing the refactors now. This would be bottomless pit that I would sink my time in and everybody else's time that had to review what I'd do. I tried and learned a lot, but I don't want to ruthlessly refactor something I only understand partially.
I also split the tickets in linear. This PR is now only about making sure that SharedCredentials.projectId is always set. So that we can make that column not null in the migration.
:warning: Some Cypress E2E specs are failing, please fix them before merging
26 failed tests on run #4044 ↗︎
Details:
| 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 despairblue 🗃️ e2e/* | |||
| Project: n8n | Commit: ce30f781f2 |
||
| Status: Failed | Duration: 11:41 💡 | ||
| Started: Feb 8, 2024 10:24 AM | Ended: Feb 8, 2024 10:36 AM | ||
2-credentials.cy.ts • 8 failed tests
16-webhook-node.cy.ts • 2 failed tests
17-sharing.cy.ts • 8 failed tests
30-langchain.cy.ts • 3 failed tests
34-template-credentials-setup.cy.ts • 4 failed tests
The first 5 failed specs are shown, see all 48 specs in Cypress Cloud.
Review all test suite changes for PR #8564 ↗︎
:warning: Some Cypress E2E specs are failing, please fix them before merging