Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53880ab

Browse files
committed
oh no I accidentally the coercion
1 parent18e1593 commit53880ab

File tree

5 files changed

+49
-15
lines changed

5 files changed

+49
-15
lines changed

‎coderd/database/migrations/000336_drop_workspace_app_stats_on_agent_delete.down.sql‎

Whitespace-only changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
3+
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
4+
--------------------+--------------------------+-----------+----------+-------------------------------------------------+----------+--------------+---------------------------------------------------------------------------------------------------------------------------------
5+
id | bigint | | not null | nextval('workspace_app_stats_id_seq'::regclass) | plain | | The ID of the record
6+
user_id | uuid | | not null | | plain | | The user who used the workspace app
7+
workspace_id | uuid | | not null | | plain | | The workspace that the workspace app was used in
8+
agent_id | uuid | | not null | | plain | | The workspace agent that was used
9+
access_method | text | | not null | | extended | | The method used to access the workspace app
10+
slug_or_port | text | | not null | | extended | | The slug or port used to to identify the app
11+
session_id | uuid | | not null | | plain | | The unique identifier for the session
12+
session_started_at | timestamp with time zone | | not null | | plain | | The time the session started
13+
session_ended_at | timestamp with time zone | | not null | | plain | | The time the session ended
14+
requests | integer | | not null | | plain | | The number of requests made during the session, a number larger than 1 indicates that multiple sessions were rolled up into one
15+
Indexes:
16+
"workspace_app_stats_pkey" PRIMARY KEY, btree (id)
17+
"workspace_app_stats_user_id_agent_id_session_id_key" UNIQUE CONSTRAINT, btree (user_id, agent_id, session_id)
18+
"workspace_app_stats_workspace_id_idx" btree (workspace_id)
19+
Foreign-key constraints:
20+
"workspace_app_stats_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES workspace_agents(id)
21+
"workspace_app_stats_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id)
22+
"workspace_app_stats_workspace_id_fkey" FOREIGN KEY (workspace_id) REFERENCES workspaces(id)
23+
Access method: heap
24+
*/
25+
26+
-- This migration alters workspace apps so that they cascade delete when
27+
-- the agent is deleted. This is to ensure that workspace app stats are
28+
-- removed when the agent is deleted, as they are no longer relevant.
29+
-- I want this, but in valid psql.
30+
-- ALTER TABLE workspace_app_stats
31+
-- ALTER CONSTRAINT workspace_app_stats_agent_id_fkey
32+
-- SET ON DELETE CASCADE;
33+
ALTERTABLE workspace_app_stats
34+
DROPCONSTRAINT workspace_app_stats_agent_id_fkey,
35+
ADDCONSTRAINT workspace_app_stats_agent_id_fkey
36+
FOREIGN KEY (agent_id)REFERENCES workspace_agents(id)ON DELETE CASCADE;

‎site/src/modules/resources/AgentDevcontainerCard.stories.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
importtype{Meta,StoryObj}from"@storybook/react";
2+
importtype{WorkspaceAgentDevcontainer}from"api/typesGenerated";
23
import{
34
MockWorkspace,
45
MockWorkspaceAgent,
56
MockWorkspaceAgentContainer,
67
MockWorkspaceAgentContainerPorts,
78
}from"testHelpers/entities";
89
import{AgentDevcontainerCard}from"./AgentDevcontainerCard";
9-
importtype{WorkspaceAgentDevcontainer}from"api/typesGenerated";
1010

1111
constMockWorkspaceAgentDevcontainer:WorkspaceAgentDevcontainer={
1212
id:"test-devcontainer-id",

‎site/src/modules/resources/AgentDevcontainerCard.tsx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
importtype{Interpolation,Theme}from"@emotion/react";
2+
importSkeletonfrom"@mui/material/Skeleton";
23
importtype{
34
Template,
45
Workspace,
56
WorkspaceAgent,
67
WorkspaceAgentDevcontainer,
78
}from"api/typesGenerated";
8-
import{Stack}from"components/Stack/Stack";
99
import{Button}from"components/Button/Button";
1010
import{displayError}from"components/GlobalSnackbar/utils";
1111
import{Spinner}from"components/Spinner/Spinner";
12+
import{Stack}from"components/Stack/Stack";
1213
import{
1314
Tooltip,
1415
TooltipContent,
1516
TooltipProvider,
1617
TooltipTrigger,
1718
}from"components/Tooltip/Tooltip";
18-
import{ExternalLinkIcon,Container}from"lucide-react";
19+
import{useProxy}from"contexts/ProxyContext";
20+
import{Container,ExternalLinkIcon}from"lucide-react";
21+
import{useFeatureVisibility}from"modules/dashboard/useFeatureVisibility";
22+
import{AppStatuses}from"pages/WorkspacePage/AppStatuses";
1923
importtype{FC}from"react";
2024
import{useEffect,useState}from"react";
2125
import{portForwardURL}from"utils/portForward";
2226
import{AgentButton}from"./AgentButton";
27+
import{AgentLatency}from"./AgentLatency";
28+
import{Apps,organizeAgentApps}from"./AgentRow";
29+
import{SubAgentStatus}from"./AgentStatus";
30+
import{PortForwardButton}from"./PortForwardButton";
2331
import{AgentSSHButton}from"./SSHButton/SSHButton";
32+
import{SubAgentOutdatedTooltip}from"./SubAgentOutdatedTooltip";
2433
import{TerminalLink}from"./TerminalLink/TerminalLink";
2534
import{VSCodeDevContainerButton}from"./VSCodeDevContainerButton/VSCodeDevContainerButton";
26-
import{useFeatureVisibility}from"modules/dashboard/useFeatureVisibility";
27-
import{useProxy}from"contexts/ProxyContext";
28-
import{PortForwardButton}from"./PortForwardButton";
29-
import{SubAgentStatus}from"./AgentStatus";
30-
import{AgentLatency}from"./AgentLatency";
31-
importSkeletonfrom"@mui/material/Skeleton";
32-
import{AppStatuses}from"pages/WorkspacePage/AppStatuses";
33-
import{SubAgentOutdatedTooltip}from"./SubAgentOutdatedTooltip";
34-
import{organizeAgentApps,Apps}from"./AgentRow";
3535

3636
typeAgentDevcontainerCardProps={
3737
parentAgent:WorkspaceAgent;

‎site/src/modules/resources/SubAgentOutdatedTooltip.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ import {
1313
HelpTooltipTrigger,
1414
}from"components/HelpTooltip/HelpTooltip";
1515
import{Stack}from"components/Stack/Stack";
16-
import{PopoverTrigger}from"components/deprecated/Popover/Popover";
1716
import{RotateCcwIcon}from"lucide-react";
1817
importtype{FC}from"react";
19-
import{agentVersionStatus}from"../../utils/workspace";
2018

2119
typeSubAgentOutdatedTooltipProps={
2220
devcontainer:WorkspaceAgentDevcontainer;
@@ -29,7 +27,7 @@ export const SubAgentOutdatedTooltip: FC<SubAgentOutdatedTooltipProps> = ({
2927
agent,
3028
onUpdate,
3129
})=>{
32-
if(!devcontainer.agent||devcontainer.agent.id!=agent.id){
30+
if(!devcontainer.agent||devcontainer.agent.id!==agent.id){
3331
returnnull;
3432
}
3533
if(!devcontainer.dirty){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp