-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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): Abstract away InstanceSettings and encryptionKey
into injectable services (no-changelog)
#7471
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Make sure to check off this list before asking for review. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #7471 +/- ##
==========================================
- Coverage 33.55% 33.55% -0.01%
==========================================
Files 3398 3399 +1
Lines 207597 207444 -153
Branches 22428 22414 -14
==========================================
- Hits 69652 69600 -52
+ Misses 136823 136716 -107
- Partials 1122 1128 +6
☔ View full report in Codecov by Sentry. |
…to injectable services
c2d68f7
to
510284c
Compare
@@ -87,8 +87,6 @@ export async function removeCredential(credentials: CredentialsEntity): Promise< | |||
} | |||
|
|||
export async function encryptCredential(credential: CredentialsEntity): Promise<ICredentialsDb> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should setup the require-await
linting rule to get rid of unnecessary async
markers like these.
encryptionKey
into injectable servicesencryptionKey
into injectable services (no-changelog)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
de02993
to
9f251ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing everything! Only minor comments, feel free to merge.
@@ -16,7 +17,8 @@ export const touchFile = async (filePath: string): Promise<void> => { | |||
} | |||
}; | |||
|
|||
const journalFile = join(UserSettings.getUserN8nFolderPath(), 'crash.journal'); | |||
const { n8nFolder } = Container.get(InstanceSettings); | |||
const journalFile = join(n8nFolder, 'crash.journal'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move the filepath to InstanceSettings
?
@@ -881,7 +882,7 @@ export const schema = { | |||
location: { | |||
doc: 'Log file location; only used if log output is set to file.', | |||
format: String, | |||
default: path.join(UserSettings.getUserN8nFolderPath(), 'logs/n8n.log'), | |||
default: path.join(Container.get(InstanceSettings).n8nFolder, 'logs/n8n.log'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or move to InstanceSettings
? Not 100% sure where the line should be though, but I like the thought of having this centralized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can revisit this later. Maybe there could be another file in cli
that manages all n8n subfolders.
@@ -947,7 +948,7 @@ export const schema = { | |||
}, | |||
localStoragePath: { | |||
format: String, | |||
default: path.join(UserSettings.getUserN8nFolderPath(), 'binaryData'), | |||
default: path.join(Container.get(InstanceSettings).n8nFolder, 'binaryData'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
export const GENERATED_STATIC_DIR = join( | ||
Container.get(InstanceSettings).userHome, | ||
'.cache/n8n/public', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
const filename = `${ | ||
Container.get(InstanceSettings).n8nFolder | ||
}/${PERSONALIZATION_SURVEY_FILENAME}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
packages/cli/test/unit/ExternalSecrets/ExternalSecretsManager.test.ts
Outdated
Show resolved
Hide resolved
|
1 flaky test on run #2545 ↗︎
Details:
cypress/e2e/2-credentials.cy.ts • 1 flaky test
Review all test suite changes for PR #7471 ↗︎ |
will revisit in another PR
✅ All Cypress E2E specs passed |
* master: (30 commits) 🚀 Release 1.14.0 (#7514) ci: Fix oclif manifest generation feat(Switch Node): Add support for infinite Switch outputs (#7499) 🚀 Release 1.13.0 (#7512) fix(core): Ensure nodes post-processors run in the correct order (#7500) feat(editor): Add PH tracking to event (#7511) fix(core): Fix workflow activation with history and workflow history for EE (no-changelog) (#7508) refactor(core): Make executions pruning more resilient (#7480) fix(Spreadsheet File Node): Fix include empty cells not working with v2 (#7505) fix(core): Create instance settings directory recursively (no-changelog) (#7506) fix(Microsoft SQL Node): Prevent SQL injection (#7467) refactor(core): Make pruning via lifecycle configuration in S3 mode mandatory (#7482) fix(core): Always derive `instanceId` from the encryption key (no-changlog) (#7501) fix(MQTT Trigger Node): Fix node causing a start up hang when active (#7498) feat: Collect usage metrics on license renewal (no-changelog) (#7486) fix(core): Fix `frontend.settings` external hook execution (#7496) fix(Redis Node): Fix adding sets data types (#7444) fix: Save new version of the workflow instead of the previous (no-changelog) (#7428) refactor(core): Abstract away InstanceSettings and `encryptionKey` into injectable services (no-changelog) (#7471) fix(Customer.io Node): Fix api endpoint when using EU region (#7485) ...
Got released with |
This change ensures that things like
encryptionKey
andinstanceId
are always available directly where they are needed, instead of passing them around throughout the code.DB Tests
E2E Tests