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
fix: pipeline 3000 creating configs #22200
base: master
Are you sure you want to change the base?
Conversation
Size Change: -26 B (0%) Total Size: 1.05 MB ℹ️ View Unchanged
|
}, | ||
] | ||
: []), | ||
] | ||
} | ||
|
||
export function checkPermissions(stage: PipelineStage, togglingToEnabledOrNew: boolean): boolean { | ||
const { canConfigurePlugins, canEnableNewDestinations } = useValues(pipelineLogic) |
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 suspect this is the reason why updates started failing, we can't call a function with using from a logic
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.
Ah I totally should have caught that. My bad.
(user, hasAvailableFeature) => | ||
user?.is_impersonated || | ||
(canConfigurePlugins(user?.organization) && hasAvailableFeature(AvailableFeature.DATA_PIPELINES)), | ||
notAllowedReasonByStageAndOperationType: [ |
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.
not sure this is the best way to do this, but having a consistent disabled reason / error is nice, later other things might be allowed / disallowed and that can be changed here
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 found this really hard to parse overall as a concept tbh. I don't fully get what it is trying to achieve tbh.
My gut tells me this shouldn't be abstracted here but rather implemented in each logic for the different kinds of thing. Reason being that the benefits of abstracting it here seem very light in comparison to the high complexity of passing this object around everywhere.
For example the NewButton
is made relatively complex as it is trying to be super abstract when in actual fact the logic to decide whether it should be shown could easily belong to the more specific logic like pipelineDestinationsLogic
and then the NewButton
can remain simple and not need this passed object.
Might be worth an in person sync if this doesn't make sense 👍
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
}, | ||
] | ||
: []), | ||
] | ||
} | ||
|
||
export function checkPermissions(stage: PipelineStage, togglingToEnabledOrNew: boolean): boolean { | ||
const { canConfigurePlugins, canEnableNewDestinations } = useValues(pipelineLogic) |
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.
Ah I totally should have caught that. My bad.
(user, hasAvailableFeature) => | ||
user?.is_impersonated || | ||
(canConfigurePlugins(user?.organization) && hasAvailableFeature(AvailableFeature.DATA_PIPELINES)), | ||
notAllowedReasonByStageAndOperationType: [ |
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 found this really hard to parse overall as a concept tbh. I don't fully get what it is trying to achieve tbh.
My gut tells me this shouldn't be abstracted here but rather implemented in each logic for the different kinds of thing. Reason being that the benefits of abstracting it here seem very light in comparison to the high complexity of passing this object around everywhere.
For example the NewButton
is made relatively complex as it is trying to be super abstract when in actual fact the logic to decide whether it should be shown could easily belong to the more specific logic like pipelineDestinationsLogic
and then the NewButton
can remain simple and not need this passed object.
Might be worth an in person sync if this doesn't make sense 👍
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
Problem
Creation was broken because of permission checks
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?