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

[server] fix using snapshotBucketId when it is undefined or empty #12105

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

sagor999
Copy link
Contributor

@sagor999 sagor999 commented Aug 12, 2022

Description

Related Issue(s)

Fixes #11823

How to test

Release Notes

none

Documentation

Werft options:

  • /werft with-preview

@sagor999 sagor999 requested a review from a team August 12, 2022 19:42
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Aug 12, 2022
@sagor999
Copy link
Contributor Author

@kylos101 FYI 👀

Co-authored-by: Kyle Brennan <kyle@gitpod.io>
@sagor999 sagor999 mentioned this pull request Aug 12, 2022
1 task
@sagor999
Copy link
Contributor Author

@geropl could you confirm is passing undefined into
const volumeSnapshots = await this.workspaceDb.trace(traceCtx).findVolumeSnapshotById(volumeSnapshotId);
which calls:

public async findVolumeSnapshotById(volumeSnapshotId: string): Promise<VolumeSnapshot | undefined> {
const volumeSnapshots = await this.getVolumeSnapshotRepo();
return volumeSnapshots.findOne(volumeSnapshotId);
}

findOne(volumeSnapshotId)
I suspect it does not handle undefined variable properly here. But maybe I am wrong.
Does it? I have a feeling it returns random record if undefined is passed into it.

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-pavel-fix-pvc-picking.2 because the annotations in the pull request description changed
(with .werft/ from main)

@geropl
Copy link
Member

geropl commented Aug 16, 2022

I suspect it does not handle undefined variable properly here. But maybe I am wrong.
Does it? I have a feeling it returns random record if undefined is passed into it.

You're right in that it is not handled properly. undefined should map to an "empty" value, which that is depends on the column definition/mapping code. So it could be that it pulls any record that is empty (haven't checked nor tested).

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code LGTM! 👍

@roboquat roboquat merged commit 3759f87 into main Aug 16, 2022
@roboquat roboquat deleted the pavel/fix-pvc-picking branch August 16, 2022 05:56
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes workspace attempts to start with PVC feature enabled
4 participants