From 5ada4b1fa224bcb1f83971ab92b145f856934810 Mon Sep 17 00:00:00 2001 From: Eugenia Grieff Date: Fri, 19 Apr 2024 16:53:27 +0200 Subject: [PATCH 1/3] Clean up linked_work_items feature flag Delete flag and clean its code usage Changelog: other --- .../components/work_item_detail.vue | 5 +---- .../groups/work_items_controller.rb | 1 - app/controllers/groups_controller.rb | 1 - .../projects/incidents_controller.rb | 1 - app/controllers/projects/issues_controller.rb | 2 -- .../projects/work_items_controller.rb | 1 - app/controllers/projects_controller.rb | 1 - .../mutations/work_items/linked_items/base.rb | 2 -- .../work_items/linked_items_resolver.rb | 2 -- .../work_items/widgets/linked_items_type.rb | 3 +-- app/models/group.rb | 4 ---- app/models/project.rb | 4 ---- .../development/linked_work_items.yml | 8 ------- doc/api/graphql/reference/index.md | 8 +++---- .../blueprints/work_items/index.md | 2 +- doc/user/okrs.md | 11 ++-------- doc/user/tasks.md | 11 ++-------- .../work_items/widgets/linked_items_type.rb | 19 +++-------------- .../requests/api/graphql/work_item_spec.rb | 21 ------------------- .../work_items/linked_work_items_spec.rb | 1 - .../components/work_item_detail_spec.js | 8 ++----- .../work_items/linked_items/add_spec.rb | 8 ------- .../work_items/linked_items/remove_spec.rb | 8 ------- spec/requests/api/graphql/work_item_spec.rb | 18 ---------------- 24 files changed, 16 insertions(+), 134 deletions(-) delete mode 100644 config/feature_flags/development/linked_work_items.yml diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index 6d081a74453f45..2a952134018013 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -235,9 +235,6 @@ export default { showIntersectionObserver() { return !this.isModal && !this.editMode; }, - hasLinkedWorkItems() { - return this.glFeatures.linkedWorkItems; - }, workItemLinkedItems() { return this.isWidgetPresent(WIDGET_TYPE_LINKED_ITEMS); }, @@ -247,7 +244,7 @@ export default { ); }, showWorkItemLinkedItems() { - return this.hasLinkedWorkItems && this.workItemLinkedItems; + return this.workItemLinkedItems; }, titleClassHeader() { return { diff --git a/app/controllers/groups/work_items_controller.rb b/app/controllers/groups/work_items_controller.rb index 79ac3c14afcb10..6e12f0ea13a9b9 100644 --- a/app/controllers/groups/work_items_controller.rb +++ b/app/controllers/groups/work_items_controller.rb @@ -9,7 +9,6 @@ class WorkItemsController < Groups::ApplicationController push_force_frontend_feature_flag(:work_items, group&.work_items_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 def index diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 251abcc6d84eda..c1ea8af73ee0fc 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -40,7 +40,6 @@ class GroupsController < Groups::ApplicationController push_force_frontend_feature_flag(:work_items, group.work_items_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) push_frontend_feature_flag(:group_multi_select_tokens, group) end diff --git a/app/controllers/projects/incidents_controller.rb b/app/controllers/projects/incidents_controller.rb index 9a592046c6e58c..52bfbd8f64c13c 100644 --- a/app/controllers/projects/incidents_controller.rb +++ b/app/controllers/projects/incidents_controller.rb @@ -10,7 +10,6 @@ class Projects::IncidentsController < Projects::ApplicationController push_force_frontend_feature_flag(:work_items, @project&.work_items_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) end diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 59a17b629e6d42..f7cfd9e801aa80 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -48,7 +48,6 @@ class Projects::IssuesController < Projects::ApplicationController push_frontend_feature_flag(:issues_grid_view) push_frontend_feature_flag(:service_desk_ticket) push_frontend_feature_flag(:issues_list_drawer, project) - push_frontend_feature_flag(:linked_work_items, project) push_frontend_feature_flag(:display_work_item_epic_issue_sidebar, project) push_frontend_feature_flag(:notifications_todos_buttons, current_user) end @@ -69,7 +68,6 @@ class Projects::IssuesController < Projects::ApplicationController 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) - push_force_frontend_feature_flag(:linked_work_items, project.linked_work_items_feature_flag_enabled?) push_frontend_feature_flag(:mention_autocomplete_backend_filtering, project) end diff --git a/app/controllers/projects/work_items_controller.rb b/app/controllers/projects/work_items_controller.rb index c8315060b39513..3e874ecc0bd23e 100644 --- a/app/controllers/projects/work_items_controller.rb +++ b/app/controllers/projects/work_items_controller.rb @@ -12,7 +12,6 @@ class Projects::WorkItemsController < Projects::ApplicationController push_force_frontend_feature_flag(:work_items, project&.work_items_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 feature_category :team_planning diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 772cafb0bb9196..1f8ed8dcb26abe 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -53,7 +53,6 @@ class ProjectsController < Projects::ApplicationController push_force_frontend_feature_flag(:work_items, @project&.work_items_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 layout :determine_layout diff --git a/app/graphql/mutations/work_items/linked_items/base.rb b/app/graphql/mutations/work_items/linked_items/base.rb index 8a6201ffdf7a0e..ae7959dfb204b2 100644 --- a/app/graphql/mutations/work_items/linked_items/base.rb +++ b/app/graphql/mutations/work_items/linked_items/base.rb @@ -32,8 +32,6 @@ def ready?(**args) def resolve(**args) work_item = authorized_find!(id: args.delete(:id)) - raise_resource_not_available_error! unless work_item.resource_parent.linked_work_items_feature_flag_enabled? - service_response = update_links(work_item, args) { diff --git a/app/graphql/resolvers/work_items/linked_items_resolver.rb b/app/graphql/resolvers/work_items/linked_items_resolver.rb index f2ff1205d3abcb..6ce3995ae67ea9 100644 --- a/app/graphql/resolvers/work_items/linked_items_resolver.rb +++ b/app/graphql/resolvers/work_items/linked_items_resolver.rb @@ -22,8 +22,6 @@ def resolve_with_lookahead(**args) private def related_work_items(args) - return WorkItem.none unless work_item.resource_parent.linked_work_items_feature_flag_enabled? - offset_pagination( work_item.linked_work_items(authorize: false, link_type: args[:filter]) ) diff --git a/app/graphql/types/work_items/widgets/linked_items_type.rb b/app/graphql/types/work_items/widgets/linked_items_type.rb index c541a12a0507bd..3b8aae23297eac 100644 --- a/app/graphql/types/work_items/widgets/linked_items_type.rb +++ b/app/graphql/types/work_items/widgets/linked_items_type.rb @@ -14,8 +14,7 @@ class LinkedItemsType < BaseObject null: true, complexity: 5, alpha: { milestone: '16.3' }, extras: [:lookahead], - description: 'Linked items for the work item. Returns `null` ' \ - 'if `linked_work_items` feature flag is disabled.', + description: 'Linked items for the work item.', resolver: Resolvers::WorkItems::LinkedItemsResolver end # rubocop:enable Graphql/AuthorizeTypes diff --git a/app/models/group.rb b/app/models/group.rb index c1579dbb21edcd..73124923150fa5 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -930,10 +930,6 @@ def work_items_mvc_2_feature_flag_enabled? feature_flag_enabled_for_self_or_ancestor?(:work_items_mvc_2) end - def linked_work_items_feature_flag_enabled? - feature_flag_enabled_for_self_or_ancestor?(:linked_work_items) - end - def work_items_rolledup_dates_feature_flag_enabled? feature_flag_enabled_for_self_or_ancestor?(:work_items_rolledup_dates) end diff --git a/app/models/project.rb b/app/models/project.rb index 6cac6f68016739..bb2bb9a1854d30 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -3200,10 +3200,6 @@ def work_items_mvc_2_feature_flag_enabled? group&.work_items_mvc_2_feature_flag_enabled? || Feature.enabled?(:work_items_mvc_2) end - def linked_work_items_feature_flag_enabled? - group&.linked_work_items_feature_flag_enabled? || Feature.enabled?(:linked_work_items, self) - end - def enqueue_record_project_target_platforms return unless Gitlab.com? diff --git a/config/feature_flags/development/linked_work_items.yml b/config/feature_flags/development/linked_work_items.yml deleted file mode 100644 index f50c796b621e3c..00000000000000 --- a/config/feature_flags/development/linked_work_items.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: linked_work_items -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126980 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/418946 -milestone: '16.3' -type: development -group: group::product planning -default_enabled: true diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index c43ea555a0b141..9c3482d06fe89f 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -31337,16 +31337,16 @@ Represents the linked items widget. | Name | Type | Description | | ---- | ---- | ----------- | -| `blocked` | [`Boolean`](#boolean) | Indicates the work item is blocked. Returns `null`if `linked_work_items` feature flag is disabled. | -| `blockedByCount` | [`Int`](#int) | Count of items blocking the work item. Returns `null`if `linked_work_items` feature flag is disabled. | -| `blockingCount` | [`Int`](#int) | Count of items the work item is blocking. Returns `null`if `linked_work_items` feature flag is disabled. | +| `blocked` | [`Boolean`](#boolean) | Indicates the work item is blocked. | +| `blockedByCount` | [`Int`](#int) | Count of items blocking the work item. | +| `blockingCount` | [`Int`](#int) | Count of items the work item is blocking. | | `type` | [`WorkItemWidgetType`](#workitemwidgettype) | Widget type. | #### Fields with arguments ##### `WorkItemWidgetLinkedItems.linkedItems` -Linked items for the work item. Returns `null` if `linked_work_items` feature flag is disabled. +Linked items for the work item. DETAILS: **Introduced** in GitLab 16.3. diff --git a/doc/architecture/blueprints/work_items/index.md b/doc/architecture/blueprints/work_items/index.md index 2f673c51321ef6..b112de4dc6f73d 100644 --- a/doc/architecture/blueprints/work_items/index.md +++ b/doc/architecture/blueprints/work_items/index.md @@ -76,7 +76,7 @@ All Work Item types share the same pool of predefined widgets and are customized | [WorkItemWidgetHierarchy](../../../api/graphql/reference/index.md#workitemwidgethierarchy) | Hierarchy of work items, including support for boolean representing presence of children. **Note:** Hierarchy is currently available only for OKRs. | `okrs_mvc` |`Guest`|No| | [WorkItemWidgetIteration](../../../api/graphql/reference/index.md#workitemwidgetiteration) | Iteration assignment support for work item | |`Reporter`|No| | [WorkItemWidgetLabels](../../../api/graphql/reference/index.md#workitemwidgetlabels) | List of labels added to work items, including support for checking whether scoped labels are supported | |`Reporter`|Yes| -| [WorkItemWidgetLinkedItems](../../../api/graphql/reference/index.md#workitemwidgetlinkeditems) | List of work items added as related to a given work item, with possible relationship types being `relates_to`, `blocks`, and `blocked_by`. Includes support for individual counts of blocked status, blocked by, blocking, and related to. | `linked_work_items`|`Guest`|No| +| [WorkItemWidgetLinkedItems](../../../api/graphql/reference/index.md#workitemwidgetlinkeditems) | List of work items added as related to a given work item, with possible relationship types being `relates_to`, `blocks`, and `blocked_by`. Includes support for individual counts of blocked status, blocked by, blocking, and related to. | |`Guest`|No| | [WorkItemWidgetMilestone](../../../api/graphql/reference/index.md#workitemwidgetmilestone) | Milestone assignment support for work item | |`Reporter`|No| | [WorkItemWidgetNotes](../../../api/graphql/reference/index.md#workitemwidgetnotes) | List of discussions within a work item | |`Guest`|Yes| | [WorkItemWidgetNotifications](../../../api/graphql/reference/index.md#workitemwidgetnotifications) | Notifications subscription status of a work item for current user | |Anyone who can view|No| diff --git a/doc/user/okrs.md b/doc/user/okrs.md index 615979708f7865..e63e4b17472618 100644 --- a/doc/user/okrs.md +++ b/doc/user/okrs.md @@ -487,11 +487,7 @@ 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_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_beta`. -On GitLab.com and GitLab Dedicated, this feature is not available. -This feature is not ready for production use. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. You can prevent public comments in an OKR. When you do, only project members can add and edit comments. @@ -536,10 +532,7 @@ If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags.md) named `linked_work_items`. Enabled by default. > - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7. > - Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8. - -FLAG: -On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can [disable the feature flag](../administration/feature_flags.md) named `linked_work_items`. -On GitLab.com and GitLab Dedicated, this feature is available. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. Linked items are a bi-directional relationship and appear in a block below the Child objectives and key results. You can link an objective, key result, or a task in the same project with each other. diff --git a/doc/user/tasks.md b/doc/user/tasks.md index ac40c7f8577165..b8a80cb28305ff 100644 --- a/doc/user/tasks.md +++ b/doc/user/tasks.md @@ -491,11 +491,7 @@ 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_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_beta`. -On GitLab.com and GitLab Dedicated, this feature is not available. -This feature is not ready for production use. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. You can prevent public comments in a task. When you do, only project members can add and edit comments. @@ -540,10 +536,7 @@ If you find a bug, [comment on the feedback issue](https://gitlab.com/gitlab-org > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416558) in GitLab 16.5 [with a flag](../administration/feature_flags.md) named `linked_work_items`. Disabled by default. > - [Enabled on GitLab.com and self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139394) in GitLab 16.7. > - Adding related items by entering their URLs and IDs [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/427594) in GitLab 16.8. - -FLAG: -On self-managed GitLab, by default this feature is available. To hide the feature, an administrator can [disable the feature flag](../administration/feature_flags.md) named `linked_work_items`. -On GitLab.com, this feature is available. On GitLab Dedicated, this feature is not available. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. Linked items are a bi-directional relationship and appear in a block below the emoji reactions section. You can link an objective, key result, or a task in the same project with each other. diff --git a/ee/app/graphql/ee/types/work_items/widgets/linked_items_type.rb b/ee/app/graphql/ee/types/work_items/widgets/linked_items_type.rb index c671091e35bc2b..4f6b9a7295db05 100644 --- a/ee/app/graphql/ee/types/work_items/widgets/linked_items_type.rb +++ b/ee/app/graphql/ee/types/work_items/widgets/linked_items_type.rb @@ -10,32 +10,23 @@ module LinkedItemsType prepended do field :blocked, GraphQL::Types::Boolean, null: true, - description: 'Indicates the work item is blocked. Returns `null`' \ - 'if `linked_work_items` feature flag is disabled.' + description: 'Indicates the work item is blocked.' field :blocking_count, GraphQL::Types::Int, null: true, - description: 'Count of items the work item is blocking. Returns `null`' \ - 'if `linked_work_items` feature flag is disabled.' + description: 'Count of items the work item is blocking.' field :blocked_by_count, GraphQL::Types::Int, null: true, - description: 'Count of items blocking the work item. Returns `null`' \ - 'if `linked_work_items` feature flag is disabled.' + description: 'Count of items blocking the work item.' def blocked - return unless linked_items_enabled? - aggregator_class.new(context, object.work_item.id) { |count| (count || 0) > 0 } end def blocked_by_count - return unless linked_items_enabled? - aggregator_class.new(context, object.work_item.id) { |count| count || 0 } end def blocking_count - return unless linked_items_enabled? - object.work_item.blocking_issues_count end @@ -44,10 +35,6 @@ def blocking_count def aggregator_class ::Gitlab::Graphql::Aggregations::WorkItems::LazyLinksAggregate end - - def linked_items_enabled? - object.work_item.resource_parent.linked_work_items_feature_flag_enabled? - end end end end diff --git a/ee/spec/requests/api/graphql/work_item_spec.rb b/ee/spec/requests/api/graphql/work_item_spec.rb index df251587337b70..025f436f03e115 100644 --- a/ee/spec/requests/api/graphql/work_item_spec.rb +++ b/ee/spec/requests/api/graphql/work_item_spec.rb @@ -732,27 +732,6 @@ def find_note(work_item, starting_with) ) end end - - context 'when `linked_work_items` feature flag is disabled' do - before do - stub_feature_flags(linked_work_items: false) - end - - it 'returns null fields' do - post_graphql(query, current_user: current_user) - expect(work_item_data).to include( - 'widgets' => include( - hash_including( - 'type' => 'LINKED_ITEMS', - 'blocked' => nil, - 'blockedByCount' => nil, - 'blockingCount' => nil, - 'linkedItems' => { 'nodes' => [] } - ) - ) - ) - end - end end describe 'hierarchy widget' do diff --git a/spec/features/projects/work_items/linked_work_items_spec.rb b/spec/features/projects/work_items/linked_work_items_spec.rb index f9cdd7b78ab733..326855e0ef34c5 100644 --- a/spec/features/projects/work_items/linked_work_items_spec.rb +++ b/spec/features/projects/work_items/linked_work_items_spec.rb @@ -27,7 +27,6 @@ sign_in(user) stub_feature_flags(work_items: true) - stub_feature_flags(linked_work_items: true) visit work_items_path diff --git a/spec/frontend/work_items/components/work_item_detail_spec.js b/spec/frontend/work_items/components/work_item_detail_spec.js index a54c6e71d36e5d..6ed9569b1f2b32 100644 --- a/spec/frontend/work_items/components/work_item_detail_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_spec.js @@ -102,7 +102,6 @@ describe('WorkItemDetail component', () => { error = undefined, workItemsMvc2Enabled = false, workItemsBeta = false, - linkedWorkItemsEnabled = false, } = {}) => { wrapper = shallowMountExtended(WorkItemDetail, { apolloProvider: createMockApollo([ @@ -125,7 +124,6 @@ describe('WorkItemDetail component', () => { provide: { glFeatures: { workItemsMvc2: workItemsMvc2Enabled, - linkedWorkItems: linkedWorkItemsEnabled, workItemsBeta, }, hasIssueWeightsFeature: true, @@ -516,11 +514,11 @@ describe('WorkItemDetail component', () => { }); describe('relationship widget', () => { - it('does not render linked items by default', async () => { + it('renders linked items by default', async () => { createComponent(); await waitForPromises(); - expect(findWorkItemRelationships().exists()).toBe(false); + expect(findWorkItemRelationships().exists()).toBe(true); }); describe('work item has children', () => { @@ -539,7 +537,6 @@ describe('WorkItemDetail component', () => { it('opens the modal with the linked item when `showModal` is emitted', async () => { createComponent({ handler, - linkedWorkItemsEnabled: true, workItemsMvc2Enabled: true, }); await waitForPromises(); @@ -564,7 +561,6 @@ describe('WorkItemDetail component', () => { isModal: true, handler, workItemsMvc2Enabled: true, - linkedWorkItemsEnabled: true, }); await waitForPromises(); diff --git a/spec/requests/api/graphql/mutations/work_items/linked_items/add_spec.rb b/spec/requests/api/graphql/mutations/work_items/linked_items/add_spec.rb index 726d1dcf664dae..78cba3518fa828 100644 --- a/spec/requests/api/graphql/mutations/work_items/linked_items/add_spec.rb +++ b/spec/requests/api/graphql/mutations/work_items/linked_items/add_spec.rb @@ -144,13 +144,5 @@ end end end - - context 'when `linked_work_items` feature flag is disabled' do - before do - stub_feature_flags(linked_work_items: false) - end - - it_behaves_like 'a mutation that returns a top-level access error' - end end end diff --git a/spec/requests/api/graphql/mutations/work_items/linked_items/remove_spec.rb b/spec/requests/api/graphql/mutations/work_items/linked_items/remove_spec.rb index 8455b73793ec0c..bd30129516b5dd 100644 --- a/spec/requests/api/graphql/mutations/work_items/linked_items/remove_spec.rb +++ b/spec/requests/api/graphql/mutations/work_items/linked_items/remove_spec.rb @@ -108,13 +108,5 @@ it_behaves_like 'a mutation that returns top-level errors', errors: ['workItemsIds cannot be empty'] end - - context 'when `linked_work_items` feature flag is disabled' do - before do - stub_feature_flags(linked_work_items: false) - end - - it_behaves_like 'a mutation that returns a top-level access error' - end end end diff --git a/spec/requests/api/graphql/work_item_spec.rb b/spec/requests/api/graphql/work_item_spec.rb index 41f3ccb8977320..6dfcacdefd15fe 100644 --- a/spec/requests/api/graphql/work_item_spec.rb +++ b/spec/requests/api/graphql/work_item_spec.rb @@ -695,24 +695,6 @@ def pagination_results_data(nodes) expect(widget_data.dig("nodes", 0, "linkType")).to eq('relates_to') end end - - context 'when `linked_work_items` feature flag is disabled' do - before do - stub_feature_flags(linked_work_items: false) - post_graphql(query, current_user: current_user) - end - - it 'returns empty result' do - expect(work_item_data).to include( - 'widgets' => include( - hash_including( - 'type' => 'LINKED_ITEMS', - 'linkedItems' => { "nodes" => [] } - ) - ) - ) - end - end end end -- GitLab From 2a2f8cd8ff222f0b98bf1c97bec171d3c23bf9b0 Mon Sep 17 00:00:00 2001 From: Eugenia Grieff Date: Mon, 22 Apr 2024 10:42:44 +0200 Subject: [PATCH 2/3] Fix deleting the wrong part of the documentation --- doc/user/okrs.md | 6 +++++- doc/user/tasks.md | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/user/okrs.md b/doc/user/okrs.md index e63e4b17472618..301659657166a0 100644 --- a/doc/user/okrs.md +++ b/doc/user/okrs.md @@ -487,7 +487,11 @@ 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_beta`. Disabled by default. -> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. + +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_beta`. +On GitLab.com and GitLab Dedicated, this feature is not available. +This feature is not ready for production use. You can prevent public comments in an OKR. When you do, only project members can add and edit comments. diff --git a/doc/user/tasks.md b/doc/user/tasks.md index b8a80cb28305ff..fb4b577bb23421 100644 --- a/doc/user/tasks.md +++ b/doc/user/tasks.md @@ -491,7 +491,11 @@ 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_beta`. Disabled by default. -> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/150148) in GitLab 17.0. Feature flag `linked_work_items` removed. + +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_beta`. +On GitLab.com and GitLab Dedicated, this feature is not available. +This feature is not ready for production use. You can prevent public comments in a task. When you do, only project members can add and edit comments. -- GitLab From 5cfcfd9796bfd61b3fbf24a021784794d1f406ec Mon Sep 17 00:00:00 2001 From: Eugenia Grieff Date: Tue, 23 Apr 2024 11:12:35 +0200 Subject: [PATCH 3/3] Apply review suggestions --- .../work_items/components/work_item_detail.vue | 5 +---- .../work_items/components/work_item_detail_spec.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index 2a952134018013..cd455d9540f724 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -243,9 +243,6 @@ export default { this.workItemType, ); }, - showWorkItemLinkedItems() { - return this.workItemLinkedItems; - }, titleClassHeader() { return { 'gl-sm-display-none! gl-mt-3': this.parentWorkItem, @@ -598,7 +595,7 @@ export default { @addChild="$emit('addChild')" /> { }); describe('relationship widget', () => { - it('renders linked items by default', async () => { - createComponent(); + it('does not render when no linkedItems present', async () => { + const mockEmptyLinkedItems = workItemByIidResponseFactory({ + linkedItems: [], + }); + const handler = jest.fn().mockResolvedValue(mockEmptyLinkedItems); + + createComponent({ handler }); await waitForPromises(); - expect(findWorkItemRelationships().exists()).toBe(true); + expect(findWorkItemRelationships().exists()).toBe(false); }); describe('work item has children', () => { @@ -528,7 +533,7 @@ describe('WorkItemDetail component', () => { const handler = jest.fn().mockResolvedValue(mockWorkItemLinkedItem); it('renders relationship widget when work item has linked items', async () => { - createComponent({ handler, linkedWorkItemsEnabled: true }); + createComponent({ handler }); await waitForPromises(); expect(findWorkItemRelationships().exists()).toBe(true); -- GitLab