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

Add paused sandboxes to the list of running sandboxes #264

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

mishushakov
Copy link
Member

@mishushakov mishushakov commented Jan 29, 2025

Includes changes from #263

Copy link

linear bot commented Jan 29, 2025

@mishushakov mishushakov self-assigned this Jan 29, 2025
@mishushakov mishushakov added the improvement Improvement for current functionality label Jan 29, 2025
spec/openapi.yml Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
// Report analytics
a.posthog.IdentifyAnalyticsTeam(team.ID.String(), team.Name)
properties := a.posthog.GetPackageToPosthogProperties(&c.Request.Header)
a.posthog.CreateAnalyticsTeamEvent(team.ID.String(), "listed running instances", properties)
Copy link
Member

Choose a reason for hiding this comment

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

the name of the event isn't true anymore

Copy link
Member Author

Choose a reason for hiding this comment

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

wdym? same as was before

a.posthog.IdentifyAnalyticsTeam(team.ID.String(), team.Name)
properties := a.posthog.GetPackageToPosthogProperties(&c.Request.Header)
a.posthog.CreateAnalyticsTeamEvent(team.ID.String(), "listed running instances", properties)

Copy link
Member

Choose a reason for hiding this comment

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

running just NIT

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, am still not understanding what is required from me, can you suggest the change?

packages/shared/pkg/db/snapshot.go Show resolved Hide resolved
packages/shared/pkg/db/snapshot.go Outdated Show resolved Hide resolved
packages/shared/pkg/schema/snapshots.go Show resolved Hide resolved
@mishushakov mishushakov requested a review from jakubno February 6, 2025 18:48
Copy link
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

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

Looks good, there are some nitpicks and few stuff changed due to the change in database type

@@ -24,26 +24,57 @@ func (a *APIStore) GetSandboxesSandboxID(c *gin.Context, id string) {

Copy link
Member

Choose a reason for hiding this comment

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

Can you change the event above? 🙏🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not seeing the line you're talking about?

packages/api/internal/handlers/sandbox_get.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandboxes_list.go Outdated Show resolved Hide resolved
packages/api/internal/handlers/sandbox_get.go Outdated Show resolved Hide resolved
@mishushakov
Copy link
Member Author

mishushakov commented Feb 10, 2025

I think we should make StartedAt non-nullable to avoid breaking existing types and instead set 1/1/1970 for unknown snapshot date in the db?

@mishushakov mishushakov requested a review from jakubno February 10, 2025 17:07
@mishushakov
Copy link
Member Author

I have undone the nullability

@mishushakov
Copy link
Member Author

mishushakov commented Feb 10, 2025

Here's the script for filling in sandbox_started_at from logs

UPDATE public.snapshots s
SET sandbox_started_at = bl.started_at
FROM billing.sandbox_logs bl
WHERE s.sandbox_id = bl.sandbox_id;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement for current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants