Skip to content

[server] Delete prebuild records when purging workspaces#13152

Merged
roboquat merged 1 commit into
mainfrom
mp/gc-delete-prebuilds
Sep 23, 2022
Merged

[server] Delete prebuild records when purging workspaces#13152
roboquat merged 1 commit into
mainfrom
mp/gc-delete-prebuilds

Conversation

@easyCZ

@easyCZ easyCZ commented Sep 21, 2022

Copy link
Copy Markdown
Member

Description

When we delete Workspaces, we also need to delete corresponding prebuilds when the Workspace is based on a prebuild.

Related Issue(s)

How to test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@easyCZ
easyCZ requested a review from a team September 21, 2022 07:24
@github-actions github-actions Bot added the team: webapp Issue belongs to the WebApp team label Sep 21, 2022
@easyCZ
easyCZ force-pushed the mp/gc-delete-prebuilds branch 2 times, most recently from da08869 to a20e0b7 Compare September 21, 2022 07:59
@roboquat roboquat added size/L and removed size/M labels Sep 21, 2022
Comment thread components/gitpod-db/src/typeorm/workspace-db-impl.ts Outdated
@inject(WorkspaceHealthMonitoring) protected readonly workspaceHealthMonitoring: WorkspaceHealthMonitoring;

public create(): express.Application {
const registry = prometheusClient.register;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🧡


// This column triggers the db-sync deletion mechanism. It's not intended for public consumption.
@Column()
deleted?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The migration for this field is still missing, right?

Are you still working on this PR/should if be in "draft" mode? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This one actually has the field, just wasn't in the db model. Yes, for the other ones we need the migrations. I'm moving the PR to draft.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just wasn't in the db model

Oh really... 🙈

@easyCZ
easyCZ marked this pull request as draft September 21, 2022 09:15
@easyCZ
easyCZ force-pushed the mp/gc-delete-prebuilds branch from 3765d1c to ee39803 Compare September 21, 2022 10:14
@easyCZ

easyCZ commented Sep 21, 2022

Copy link
Copy Markdown
Member Author

/werft run

👍 started the job as gitpod-build-mp-gc-delete-prebuilds.5
(with .werft/ from main)

@easyCZ
easyCZ force-pushed the mp/gc-delete-prebuilds branch 2 times, most recently from 12ddbc7 to 92b2399 Compare September 22, 2022 09:51
@easyCZ
easyCZ marked this pull request as ready for review September 22, 2022 09:55
@easyCZ
easyCZ force-pushed the mp/gc-delete-prebuilds branch 2 times, most recently from ccab82d to a84edd1 Compare September 22, 2022 10:32
@easyCZ
easyCZ force-pushed the mp/gc-delete-prebuilds branch from a84edd1 to 45d866c Compare September 22, 2022 10:35
@easyCZ
easyCZ requested a review from geropl September 22, 2022 11:15
const registry = prometheusClient.register;

prometheusClient.collectDefaultMetrics({ register: registry });
registerDBMetrics(registry);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change was needed to keep the metrics defined in the gitpod-db package, but bind it to server.

@easyCZ
easyCZ requested a review from a team September 22, 2022 14:03

@svenefftinge svenefftinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@roboquat
roboquat merged commit 6c40c53 into main Sep 23, 2022
@roboquat
roboquat deleted the mp/gc-delete-prebuilds branch September 23, 2022 07:26
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Sep 26, 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/L team: webapp Issue belongs to the WebApp team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants