Skip to content

Prefill "Time before automatic termination" with the selected agent

Zhaochen Li requested to merge zl/427519 into master

Issue - Frontend: Prefill "Time before automatic termin... (#427519 - closed)

What does this MR do and why?

During workspace create page, we should update GraphQL query to include agent_config defaultMaxHoursBeforeTermination. On page load and agent selected, we will display the default value from backend as the default value. When the agent is switched, we will update to other default.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before this MR, this field value of Workspace automatically terminates after is always hard-code to 24 all the time.

Screenshot_2024-08-09_at_6.53.14_PM

With the MR, when we have the different values set on the backend DB, then we will see the value for the selected agent when the page is loading, and the first agent from the list is auto-selected.

Screenshot_2024-08-09_at_6.54.33_PM

If we switch between agents, we could also see the value is updated everytime.

How to set up and validate locally

  • checkout the repo and have gdk running
  • follow the doc to create at least 2 agents under the same group (we could provide this value in the file, or directly update on the DB) At this step, it would be better if we create 2 agents from the root group (this will be needed later with feature flag)
  • config the correct agent authorization mapping for the given group to unblock it
  • then go to gdk new workspaces page
  • then select the project and switch between the agents, and check the behaviour
  • Pls note there is a feature flag for which GraphQL query we will call on at this place ee/app/assets/javascripts/workspaces/common/components/get_project_details_query.vue:60, for testing purposes, i just make it false and true and make sure both behave the same
Edited by Zhaochen Li

Merge request reports

Loading