-
Notifications
You must be signed in to change notification settings - Fork 28.4k
feat(core): Scope getStatus for environments for project admin role #15404
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
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
328652c
to
e45091b
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.
cubic reviewed 10 files and found no issues. Review PR in cubic.dev.
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.
Some comments
}); | ||
} | ||
|
||
private getProjectFilter(context: SourceControlContext): FindOptionsWhere<Project> | undefined { |
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.
I think it's a bit redundant to re-check context.accessToAllProjects() here, because getProjectFilter is called from functions which already do that check.
Since for now this method is not used elsewhere, what would you say if we called it something more explicit like getAdminProjectsByUserIdFilter(userId: string)
?
also I'm wondering if all those typeorm related method should maybe be put in a repository instead, what do you think ? (either entity repos or a dedicated source control repo 🤔 )
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.
Good point, I moved these functions into a SourceControlScopedService
class.
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.
I think you will have a list issue that requires all files that import typeorm stuff to be inside the database folder or something
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/types/source-control-context.ts
Outdated
Show resolved
Hide resolved
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.
Some additional comments
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
}); | ||
} | ||
|
||
private getProjectFilter(context: SourceControlContext): FindOptionsWhere<Project> | undefined { |
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.
I think you will have a list issue that requires all files that import typeorm stuff to be inside the database folder or something
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control-import.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control.service.ee.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/environments.ee/source-control/source-control.service.ee.ts
Outdated
Show resolved
Hide resolved
d917126
to
e1d8690
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.
Looks good to me. Well done on the tests 👍
I think we should create a tech debt ticket to start splitting the souce-control service into multiple services though
Workflow Test Results 📊 🔴 2 Failed,
|
Workflow ID | Workflow Name | Reason |
---|---|---|
243 | Agent:ReAct | Workflow contains 2 deleted data. |
258 | Agent:auto-fix:openai | Workflow contains 2 deleted data. |
⚠️ Warnings (3)
Workflow ID | Workflow Name | Reason |
---|---|---|
237 | BasicLLMChain:AzureChat | Workflow contains new data that previously did not exist. |
35 | Slack:User:getPresence info:UserProfile:get update... | Workflow contains new data that previously did not exist. |
257 | Agent:auto-fix:anthropic | Workflow contains new data that previously did not exist. |
|
2 similar comments
|
|
✅ All Cypress E2E specs passed |
Got released with |
Summary
Changes the behavior of the getStatus endpoint to scope available changes in environments to only resources
project admins have access to.
Related Linear tickets, Github issues, and Community forum posts
closes https://linear.app/n8n/issue/PAY-2822/adapt-getstatus-endpoint-to-support-scoping-to-project-admins
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)