Update Workspace Creation Flow With New Version
Issue - Backend: update workspace creation with agent_c... (#479688 - closed)
What does this MR do and why?
During the workspace creation, we will find the latest agent_config version, and set it to workspace workspaces_agent_config_version
.
This code needs extra check on if the table has workspaces_agent_config_version
defined, if does not, then we skip the code. The reason is, we could make this MR independent of this migration issue.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before migration, there is no field workspaces_agent_config_version
, and we do not set the column when creating new workspaces.
With new column after migration
How to set up and validate locally
- checkout the repo and have gdk running
- follow the doc to setup workspace locally
- then create new workspace, and check in rails console, and see workspace created with no field
workspaces_agent_config_version
- then run below migration, and restart gdk services
- optional: update agent_config you plan to use a few times and make some versions on its DB record
- create a new workspace, check workspace created fine, and see
workspaces_agent_config_version
is set properly
# frozen_string_literal: true
class AddWorkspacesAgentConfigVersionColumnToWorkspacesTable < Gitlab::Database::Migration[2.2]
milestone '17.5'
def change
add_column :workspaces, :workspaces_agent_config_version, :bigint
end
end
Edited by Zhaochen Li