refactor: deprecate login_before_ready in favor of startup_script_behavior (#7837)

Fixes #7758
This commit is contained in:
Mathias Fredriksson
2023-06-06 11:58:07 +03:00
committed by GitHub
parent 93378daeb3
commit 660bbb8d38
37 changed files with 1238 additions and 857 deletions
@@ -0,0 +1,12 @@
BEGIN;
ALTER TABLE workspace_agents ADD COLUMN login_before_ready boolean NOT NULL DEFAULT TRUE;
UPDATE workspace_agents SET login_before_ready = CASE WHEN startup_script_behavior = 'non-blocking' THEN TRUE ELSE FALSE END;
ALTER TABLE workspace_agents DROP COLUMN startup_script_behavior;
DROP TYPE startup_script_behavior;
COMMENT ON COLUMN workspace_agents.login_before_ready IS 'If true, the agent will delay logins until it is ready (e.g. executing startup script has ended).';
COMMIT;
@@ -0,0 +1,12 @@
BEGIN;
CREATE TYPE startup_script_behavior AS ENUM ('blocking', 'non-blocking');
ALTER TABLE workspace_agents ADD COLUMN startup_script_behavior startup_script_behavior NOT NULL DEFAULT 'non-blocking';
UPDATE workspace_agents SET startup_script_behavior = (CASE WHEN login_before_ready THEN 'non-blocking' ELSE 'blocking' END)::startup_script_behavior;
ALTER TABLE workspace_agents DROP COLUMN login_before_ready;
COMMENT ON COLUMN workspace_agents.startup_script_behavior IS 'When startup script behavior is non-blocking, the workspace will be ready and accessible upon agent connection, when it is blocking, workspace will wait for the startup script to complete before becoming ready and accessible.';
COMMIT;