From 81c20d2c9d2276f4ac8a8edfed6dce9799a4f12d Mon Sep 17 00:00:00 2001
From: Donald Cook <dcook@gitlab.com>
Date: Mon, 19 Feb 2024 07:29:48 +0000
Subject: [PATCH] Clarified work items FF naming

Changelog: changed
---
 .../work_items/components/work_item_actions.vue          | 2 +-
 .../components/work_item_attributes_wrapper.vue          | 2 +-
 app/controllers/groups/work_items_controller.rb          | 2 +-
 app/controllers/groups_controller.rb                     | 2 +-
 app/controllers/projects/incidents_controller.rb         | 2 +-
 app/controllers/projects/issues_controller.rb            | 4 ++--
 app/controllers/projects/work_items_controller.rb        | 2 +-
 app/controllers/projects_controller.rb                   | 2 +-
 app/models/group.rb                                      | 4 ++--
 app/models/project.rb                                    | 4 ++--
 config/feature_flags/beta/work_items_beta.yml            | 9 +++++++++
 config/feature_flags/development/work_items_mvc.yml      | 8 --------
 doc/architecture/blueprints/work_items/index.md          | 5 +++--
 doc/user/okrs.md                                         | 4 ++--
 doc/user/tasks.md                                        | 4 ++--
 .../work_items/components/work_item_actions_spec.js      | 2 +-
 .../components/work_item_attributes_wrapper_spec.js      | 2 +-
 spec/models/group_spec.rb                                | 6 +++---
 spec/models/project_spec.rb                              | 6 +++---
 19 files changed, 37 insertions(+), 35 deletions(-)
 create mode 100644 config/feature_flags/beta/work_items_beta.yml
 delete mode 100644 config/feature_flags/development/work_items_mvc.yml

diff --git a/app/assets/javascripts/work_items/components/work_item_actions.vue b/app/assets/javascripts/work_items/components/work_item_actions.vue
index 4880e7de9d2c1..eed6eb2b6eefb 100644
--- a/app/assets/javascripts/work_items/components/work_item_actions.vue
+++ b/app/assets/javascripts/work_items/components/work_item_actions.vue
@@ -185,7 +185,7 @@ export default {
       };
     },
     canLockWorkItem() {
-      return this.canUpdate && this.glFeatures.workItemsMvc;
+      return this.canUpdate && this.glFeatures.workItemsBeta;
     },
     canPromoteToObjective() {
       return this.canUpdate && this.workItemType === WORK_ITEM_TYPE_VALUE_KEY_RESULT;
diff --git a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
index 662edda13f18e..356ccf659da0c 100644
--- a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
+++ b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue
@@ -310,7 +310,7 @@ export default {
       @error="$emit('error', $event)"
     />
     <participants
-      v-if="workItemParticipants && glFeatures.workItemsMvc"
+      v-if="workItemParticipants && glFeatures.workItemsBeta"
       class="gl-mb-5 gl-pt-5 gl-border-t gl-border-gray-50"
       :number-of-less-participants="10"
       :participants="workItemParticipants.participants.nodes"
diff --git a/app/controllers/groups/work_items_controller.rb b/app/controllers/groups/work_items_controller.rb
index bfb5b74d2a574..c1482f094daea 100644
--- a/app/controllers/groups/work_items_controller.rb
+++ b/app/controllers/groups/work_items_controller.rb
@@ -6,7 +6,7 @@ class WorkItemsController < Groups::ApplicationController
 
     before_action do
       push_force_frontend_feature_flag(:work_items, group&.work_items_feature_flag_enabled?)
-      push_force_frontend_feature_flag(:work_items_mvc, group&.work_items_mvc_feature_flag_enabled?)
+      push_force_frontend_feature_flag(:work_items_beta, group&.work_items_beta_feature_flag_enabled?)
       push_force_frontend_feature_flag(:work_items_mvc_2, group&.work_items_mvc_2_feature_flag_enabled?)
       push_force_frontend_feature_flag(:linked_work_items, group&.linked_work_items_feature_flag_enabled?)
     end
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 5acb4eb4b2d5d..2ca7c7e368a3e 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -36,7 +36,7 @@ class GroupsController < Groups::ApplicationController
     push_frontend_feature_flag(:or_issuable_queries, group)
     push_frontend_feature_flag(:frontend_caching, group)
     push_force_frontend_feature_flag(:work_items, group.work_items_feature_flag_enabled?)
-    push_force_frontend_feature_flag(:work_items_mvc, group.work_items_mvc_feature_flag_enabled?)
+    push_force_frontend_feature_flag(:work_items_beta, group.work_items_beta_feature_flag_enabled?)
     push_force_frontend_feature_flag(:work_items_mvc_2, group.work_items_mvc_2_feature_flag_enabled?)
     push_force_frontend_feature_flag(:linked_work_items, group.linked_work_items_feature_flag_enabled?)
     push_frontend_feature_flag(:issues_grid_view)
diff --git a/app/controllers/projects/incidents_controller.rb b/app/controllers/projects/incidents_controller.rb
index da040c081af1e..9a592046c6e58 100644
--- a/app/controllers/projects/incidents_controller.rb
+++ b/app/controllers/projects/incidents_controller.rb
@@ -8,7 +8,7 @@ class Projects::IncidentsController < Projects::ApplicationController
   before_action :load_incident, only: [:show]
   before_action do
     push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?)
-    push_force_frontend_feature_flag(:work_items_mvc, @project&.work_items_mvc_feature_flag_enabled?)
+    push_force_frontend_feature_flag(:work_items_beta, @project&.work_items_beta_feature_flag_enabled?)
     push_force_frontend_feature_flag(:work_items_mvc_2, @project&.work_items_mvc_2_feature_flag_enabled?)
     push_force_frontend_feature_flag(:linked_work_items, @project&.linked_work_items_feature_flag_enabled?)
     push_frontend_feature_flag(:notifications_todos_buttons, current_user)
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index 7a2b00d5aa6ca..06572f87450cd 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -63,8 +63,8 @@ class Projects::IssuesController < Projects::ApplicationController
   end
 
   before_action only: :show do
-    push_frontend_feature_flag(:work_items_mvc, project&.group)
-    push_force_frontend_feature_flag(:work_items_mvc, project&.work_items_mvc_feature_flag_enabled?)
+    push_frontend_feature_flag(:work_items_beta, project&.group)
+    push_force_frontend_feature_flag(:work_items_beta, project&.work_items_beta_feature_flag_enabled?)
     push_force_frontend_feature_flag(:work_items_mvc_2, project&.work_items_mvc_2_feature_flag_enabled?)
     push_frontend_feature_flag(:epic_widget_edit_confirmation, project)
     push_frontend_feature_flag(:display_work_item_epic_issue_sidebar, project)
diff --git a/app/controllers/projects/work_items_controller.rb b/app/controllers/projects/work_items_controller.rb
index 84cc1b16136fa..9b75f5e7b9853 100644
--- a/app/controllers/projects/work_items_controller.rb
+++ b/app/controllers/projects/work_items_controller.rb
@@ -9,7 +9,7 @@ class Projects::WorkItemsController < Projects::ApplicationController
   before_action :authorize_import_access!, only: [:import_csv, :authorize] # rubocop:disable Rails/LexicallyScopedActionFilter
   before_action do
     push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
-    push_force_frontend_feature_flag(:work_items_mvc, project&.work_items_mvc_feature_flag_enabled?)
+    push_force_frontend_feature_flag(:work_items_beta, project&.work_items_beta_feature_flag_enabled?)
     push_force_frontend_feature_flag(:work_items_mvc_2, project&.work_items_mvc_2_feature_flag_enabled?)
     push_force_frontend_feature_flag(:linked_work_items, project&.linked_work_items_feature_flag_enabled?)
   end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 77e0715dbef9e..1206b3f43a92a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -48,7 +48,7 @@ class ProjectsController < Projects::ApplicationController
     push_licensed_feature(:file_locks) if @project.present? && @project.licensed_feature_available?(:file_locks)
     push_licensed_feature(:security_orchestration_policies) if @project.present? && @project.licensed_feature_available?(:security_orchestration_policies)
     push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?)
-    push_force_frontend_feature_flag(:work_items_mvc, @project&.work_items_mvc_feature_flag_enabled?)
+    push_force_frontend_feature_flag(:work_items_beta, @project&.work_items_beta_feature_flag_enabled?)
     push_force_frontend_feature_flag(:work_items_mvc_2, @project&.work_items_mvc_2_feature_flag_enabled?)
     push_force_frontend_feature_flag(:linked_work_items, @project&.linked_work_items_feature_flag_enabled?)
   end
diff --git a/app/models/group.rb b/app/models/group.rb
index f0464155a2af8..725e1d89edc21 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -876,8 +876,8 @@ def work_items_feature_flag_enabled?
     feature_flag_enabled_for_self_or_ancestor?(:work_items)
   end
 
-  def work_items_mvc_feature_flag_enabled?
-    feature_flag_enabled_for_self_or_ancestor?(:work_items_mvc)
+  def work_items_beta_feature_flag_enabled?
+    feature_flag_enabled_for_self_or_ancestor?(:work_items_beta, type: :beta)
   end
 
   def work_items_mvc_2_feature_flag_enabled?
diff --git a/app/models/project.rb b/app/models/project.rb
index c255ccfc7fa9a..4d303fe24c8d9 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -3151,8 +3151,8 @@ def work_items_feature_flag_enabled?
     group&.work_items_feature_flag_enabled? || Feature.enabled?(:work_items, self)
   end
 
-  def work_items_mvc_feature_flag_enabled?
-    group&.work_items_mvc_feature_flag_enabled? || Feature.enabled?(:work_items_mvc)
+  def work_items_beta_feature_flag_enabled?
+    group&.work_items_beta_feature_flag_enabled? || Feature.enabled?(:work_items_beta, type: :beta)
   end
 
   def work_items_mvc_2_feature_flag_enabled?
diff --git a/config/feature_flags/beta/work_items_beta.yml b/config/feature_flags/beta/work_items_beta.yml
new file mode 100644
index 0000000000000..22d79f0e38b1a
--- /dev/null
+++ b/config/feature_flags/beta/work_items_beta.yml
@@ -0,0 +1,9 @@
+---
+name: work_items_beta
+feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/377912
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144141
+rollout_issue_url: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17549
+milestone: '16.10'
+group: group::project management
+type: beta
+default_enabled: false
diff --git a/config/feature_flags/development/work_items_mvc.yml b/config/feature_flags/development/work_items_mvc.yml
deleted file mode 100644
index 928175c70bab0..0000000000000
--- a/config/feature_flags/development/work_items_mvc.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: work_items_mvc
-introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101062"
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/377912
-milestone: '15.5'
-type: development
-group: group::project management
-default_enabled: false
diff --git a/doc/architecture/blueprints/work_items/index.md b/doc/architecture/blueprints/work_items/index.md
index 74690d34088f2..e08ef1fc3d0da 100644
--- a/doc/architecture/blueprints/work_items/index.md
+++ b/doc/architecture/blueprints/work_items/index.md
@@ -85,6 +85,7 @@ All Work Item types share the same pool of predefined widgets and are customized
 | [WorkItemWidgetStatus](../../../api/graphql/reference/index.md#workitemwidgetstatus) | Status of a work item when type is Requirement, with possible status types being `unverified`, `satisfied`, or `failed` | | |No|
 | [WorkItemWidgetTestReports](../../../api/graphql/reference/index.md#workitemwidgettestreports) | Test reports associated with a work item | | | |
 | [WorkItemWidgetWeight](../../../api/graphql/reference/index.md#workitemwidgetweight) | Set weight of a work item | |`Reporter`|No|
+| WorkItemWidgetLock | Lock/Unlock a work item | |`Reporter`|No|
 
 #### Widget availability (updating)
 
@@ -144,12 +145,12 @@ Task is a special Work Item type. Tasks can be added to issues as child items an
 
 ### Feature flags
 
-Since this is a large project with numerous moving parts, feature flags are being used to track promotions of available widgets. The table below shows the different feature flags that are being used, and the audience that they are available to.  
+Since this is a large project with numerous moving parts, feature flags are being used to track promotions of available widgets. The table below shows the different feature flags that are being used, and the audience that they are available to.
 
 | feature flag name | audience |
 |---|---|
 | `work_items` | defaulted to on |
-| `work_items_mvc` | `gitlab-org`, `gitlab-com` |
+| `work_items_beta` | `gitlab-org`, `gitlab-com` |
 | `work_items_mvc_2` | `gitlab-org/plan-stage` |
 
 ## Motivation
diff --git a/doc/user/okrs.md b/doc/user/okrs.md
index b68f5c53fd4bc..40ab3dafe890f 100644
--- a/doc/user/okrs.md
+++ b/doc/user/okrs.md
@@ -485,10 +485,10 @@ system note in the OKR's comments, for example:
 
 ## Lock discussion
 
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags.md) named `work_items_mvc`. Disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags.md) named `work_items_beta`. Disabled by default.
 
 FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../administration/feature_flags.md) named `work_items_mvc`.
+On self-managed GitLab, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../administration/feature_flags.md) named `work_items_beta`.
 On GitLab.com, this feature is not available.
 This feature is not ready for production use.
 
diff --git a/doc/user/tasks.md b/doc/user/tasks.md
index 86dd1b4a77415..3338c91120250 100644
--- a/doc/user/tasks.md
+++ b/doc/user/tasks.md
@@ -492,10 +492,10 @@ system note in the task's comments, for example:
 
 ## Lock discussion
 
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags.md) named `work_items_mvc`. Disabled by default.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/398649) in GitLab 16.9 [with a flag](../administration/feature_flags.md) named `work_items_beta`. Disabled by default.
 
 FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../administration/feature_flags.md) named `work_items_mvc`.
+On self-managed GitLab, by default this feature is not available. To make it available, an administrator can [enable the feature flag](../administration/feature_flags.md) named `work_items_beta`.
 On GitLab.com, this feature is not available.
 This feature is not ready for production use.
 
diff --git a/spec/frontend/work_items/components/work_item_actions_spec.js b/spec/frontend/work_items/components/work_item_actions_spec.js
index b838c9a6a2869..f16960f241450 100644
--- a/spec/frontend/work_items/components/work_item_actions_spec.js
+++ b/spec/frontend/work_items/components/work_item_actions_spec.js
@@ -140,7 +140,7 @@ describe('WorkItemActions component', () => {
       },
       provide: {
         isGroup: false,
-        glFeatures: { workItemsMvc: true, workItemsMvc2: true },
+        glFeatures: { workItemsBeta: true, workItemsMvc2: true },
       },
       mocks: {
         $toast,
diff --git a/spec/frontend/work_items/components/work_item_attributes_wrapper_spec.js b/spec/frontend/work_items/components/work_item_attributes_wrapper_spec.js
index 5dfe27c41817b..e91c9cd0d5e13 100644
--- a/spec/frontend/work_items/components/work_item_attributes_wrapper_spec.js
+++ b/spec/frontend/work_items/components/work_item_attributes_wrapper_spec.js
@@ -50,7 +50,7 @@ describe('WorkItemAttributesWrapper component', () => {
         hasIssuableHealthStatusFeature: true,
         projectNamespace: 'namespace',
         glFeatures: {
-          workItemsMvc: true,
+          workItemsBeta: true,
           workItemsMvc2,
         },
       },
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 697235339435f..9c3c990bdbdb3 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -3621,10 +3621,10 @@ def define_cache_expectations(cache_key)
     end
   end
 
-  describe '#work_items_mvc_feature_flag_enabled?' do
+  describe '#work_items_beta_feature_flag_enabled?' do
     it_behaves_like 'checks self and root ancestor feature flag' do
-      let(:feature_flag) { :work_items_mvc }
-      let(:feature_flag_method) { :work_items_mvc_feature_flag_enabled? }
+      let(:feature_flag) { :work_items_beta }
+      let(:feature_flag_method) { :work_items_beta_feature_flag_enabled? }
     end
   end
 
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 936303d0be60e..192a46598e154 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -8627,12 +8627,12 @@ def has_external_wiki
     end
   end
 
-  describe '#work_items_mvc_feature_flag_enabled?' do
+  describe '#work_items_beta_feature_flag_enabled?' do
     let_it_be(:group_project) { create(:project, :in_subgroup) }
 
     it_behaves_like 'checks parent group feature flag' do
-      let(:feature_flag_method) { :work_items_mvc_feature_flag_enabled? }
-      let(:feature_flag) { :work_items_mvc }
+      let(:feature_flag_method) { :work_items_beta_feature_flag_enabled? }
+      let(:feature_flag) { :work_items_beta }
       let(:subject_project) { group_project }
     end
   end
-- 
GitLab