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

Make sure calculation views cannot be used to write or modify rows. #14735

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Oct 8, 2024

Description

Pretty much what it says in the title. Code and tests to make sure we can't modify data through calculation views.

@samwho samwho requested a review from adrinr October 8, 2024 16:56
@samwho samwho requested a review from a team as a code owner October 8, 2024 16:56
Copy link

qa-wolf bot commented Oct 8, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/s labels Oct 8, 2024
@@ -42,6 +43,11 @@ export async function handleRequest<T extends Operation>(

export async function patch(ctx: UserCtx<PatchRowRequest, PatchRowResponse>) {
const source = await utils.getSource(ctx)

if (sdk.views.isView(source) && helpers.views.isCalculationView(source)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't delete rows through a calculation view as well right? We should likely add that to this PR too.

Base automatically changed from view-calculation-validation-4 to master October 9, 2024 13:14
@samwho samwho enabled auto-merge October 9, 2024 13:19
@samwho samwho merged commit d9b77fd into master Oct 9, 2024
12 checks passed
@samwho samwho deleted the view-calculation-readonly branch October 9, 2024 13:32
@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants