Skip to content

Update only non terminated workspaces on agent update

Vishal Tak requested to merge vtak/fix_agent_config_update into master

What does this MR do and why?

Issue: Backend: Update only non-terminated workspaces ... (#432766 - closed)

Update only non terminated workspaces on agent update. This

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Make an update to the agent configuration. An empty commit to the repository is also fine.
  2. Verify that all the non-terminated-workspaces for the given agent have force_include_all_resources: true immediately after the update. This can be done by tailing the development log tail -f log/development.log and validate that the query similar to the below one is executed -
      ↳ ee/lib/remote_development/agent_config/updater.rb:42:in `update'
      RemoteDevelopment::Workspace Update All (2.1ms)  UPDATE "workspaces" SET "force_include_all_resources" = TRUE WHERE "workspaces"."id" IN (SELECT "workspaces"."id" FROM "workspaces" INNER JOIN "cluster_agents" ON "workspaces"."cluster_agent_id" = "cluster_agents"."id" WHERE "cluster_agents"."id" = 9 AND NOT ("workspaces"."desired_state" = 'Terminated' AND "workspaces"."actual_state" = 'Terminated')) /*application:web,correlation_id:01HFXQJ07MB2919QW66P12MAEB,endpoint_id:POST /api/:version/internal/kubernetes/agent_configuration,db_config_name:main,line:/ee/lib/remote_development/agent_config/updater.rb:42:in `update'*/

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports