diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-14 09:11:10 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-14 09:11:10 +0000 |
commit | ce684df4733d86a49126792721f549612a778590 (patch) | |
tree | 9f8561f0aa54e5dd7bfd5354b5f77d48ab22a9ce | |
parent | b02c014a8fd04fd3675d74d22ce855388ec66daa (diff) | |
download | gitlab-ce-ce684df4733d86a49126792721f549612a778590.tar.gz |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.checksum | 2 | ||||
-rw-r--r-- | Gemfile.lock | 4 | ||||
-rw-r--r-- | app/graphql/resolvers/board_list_issues_resolver.rb | 2 | ||||
-rw-r--r-- | app/graphql/resolvers/board_list_resolver.rb | 3 | ||||
-rw-r--r-- | app/graphql/resolvers/board_lists_resolver.rb | 2 | ||||
-rw-r--r-- | app/graphql/resolvers/concerns/board_item_filterable.rb | 6 | ||||
-rw-r--r-- | doc/user/project/issues/managing_issues.md | 6 | ||||
-rw-r--r-- | doc/user/tasks.md | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | spec/requests/api/graphql/boards/board_list_query_spec.rb | 18 |
12 files changed, 38 insertions, 15 deletions
@@ -511,7 +511,7 @@ gem 'ssh_data', '~> 1.3' gem 'spamcheck', '~> 1.0.0' # Gitaly GRPC protocol definitions -gem 'gitaly', '~> 15.9.0-rc1' +gem 'gitaly', '~> 15.9.0-rc3' # KAS GRPC protocol definitions gem 'kas-grpc', '~> 0.0.2' diff --git a/Gemfile.checksum b/Gemfile.checksum index b1ad21e7fc0..b27673ba538 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -197,7 +197,7 @@ {"name":"gettext_i18n_rails","version":"1.8.0","platform":"ruby","checksum":"95e5cf8440b1e08705b27f2bccb56143272c5a7a0dabcf54ea1bd701140a496f"}, {"name":"gettext_i18n_rails_js","version":"1.3.0","platform":"ruby","checksum":"5d10afe4be3639bff78c50a56768c20f39aecdabc580c08aa45573911c2bd687"}, {"name":"git","version":"1.11.0","platform":"ruby","checksum":"7e95ba4da8298a0373ef1a6862aa22007d761f3c8274b675aa787966fecea0f1"}, -{"name":"gitaly","version":"15.9.0.pre.rc1","platform":"ruby","checksum":"c5ebbe6b1f2770020b0857a6a03bf1f52cd0be9ae05dbbb296316b3e7d75b42b"}, +{"name":"gitaly","version":"15.9.0.pre.rc3","platform":"ruby","checksum":"6ac64320a70417131a4b97f5dd45d4e203d60703cc3cba156561e7f8c50a4abe"}, {"name":"gitlab","version":"4.19.0","platform":"ruby","checksum":"3f645e3e195dbc24f0834fbf83e8ccfb2056d8e9712b01a640aad418a6949679"}, {"name":"gitlab-chronic","version":"0.10.5","platform":"ruby","checksum":"f80f18dc699b708870a80685243331290bc10cfeedb6b99c92219722f729c875"}, {"name":"gitlab-dangerfiles","version":"3.6.7","platform":"ruby","checksum":"ebd898ec0e8ed3edea281b2f703000c502c6b412cbcadc1265ddbc31ffb0c579"}, diff --git a/Gemfile.lock b/Gemfile.lock index e1332aa7b74..ed7765fa52c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -563,7 +563,7 @@ GEM rails (>= 3.2.0) git (1.11.0) rchardet (~> 1.8) - gitaly (15.9.0.pre.rc1) + gitaly (15.9.0.pre.rc3) grpc (~> 1.0) gitlab (4.19.0) httparty (~> 0.20) @@ -1674,7 +1674,7 @@ DEPENDENCIES gettext (~> 3.3) gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails_js (~> 1.3) - gitaly (~> 15.9.0.pre.rc1) + gitaly (~> 15.9.0.pre.rc3) gitlab-chronic (~> 0.10.5) gitlab-dangerfiles (~> 3.6.7) gitlab-experiment (~> 0.7.1) diff --git a/app/graphql/resolvers/board_list_issues_resolver.rb b/app/graphql/resolvers/board_list_issues_resolver.rb index d70acdf7ca0..03b12dbb12e 100644 --- a/app/graphql/resolvers/board_list_issues_resolver.rb +++ b/app/graphql/resolvers/board_list_issues_resolver.rb @@ -13,7 +13,7 @@ module Resolvers alias_method :list, :object def resolve(**args) - filters = item_filters(args[:filters]) + filters = item_filters(args[:filters], list.board.resource_parent) mutually_exclusive_milestone_args!(filters) filter_params = filters.merge(board_id: list.board.id, id: list.id) diff --git a/app/graphql/resolvers/board_list_resolver.rb b/app/graphql/resolvers/board_list_resolver.rb index d853846b674..f9d3541cd5f 100644 --- a/app/graphql/resolvers/board_list_resolver.rb +++ b/app/graphql/resolvers/board_list_resolver.rb @@ -19,9 +19,8 @@ module Resolvers description: 'Filters applied when getting issue metadata in the board list.' def resolve(id: nil, issue_filters: {}) - context.scoped_set!(:issue_filters, item_filters(issue_filters)) - Gitlab::Graphql::Lazy.with_value(find_list(id: id)) do |list| + context.scoped_set!(:issue_filters, item_filters(issue_filters, list&.board&.resource_parent)) list if authorized_resource?(list) end end diff --git a/app/graphql/resolvers/board_lists_resolver.rb b/app/graphql/resolvers/board_lists_resolver.rb index 4dae3b4a9d1..5fc813f4acb 100644 --- a/app/graphql/resolvers/board_lists_resolver.rb +++ b/app/graphql/resolvers/board_lists_resolver.rb @@ -22,7 +22,7 @@ module Resolvers def resolve_with_lookahead(id: nil, issue_filters: {}) lists = board_lists(id) - context.scoped_set!(:issue_filters, item_filters(issue_filters)) + context.scoped_set!(:issue_filters, item_filters(issue_filters, board.resource_parent)) List.preload_preferences_for_user(lists, current_user) if load_preferences? diff --git a/app/graphql/resolvers/concerns/board_item_filterable.rb b/app/graphql/resolvers/concerns/board_item_filterable.rb index 035cdbbd282..dcd2f265573 100644 --- a/app/graphql/resolvers/concerns/board_item_filterable.rb +++ b/app/graphql/resolvers/concerns/board_item_filterable.rb @@ -5,7 +5,7 @@ module BoardItemFilterable private - def item_filters(args) + def item_filters(args, resource_parent) filters = args.to_h set_filter_values(filters) @@ -45,10 +45,6 @@ module BoardItemFilterable def rewrite_param_name(filters, old_name, new_name) filters[new_name] = filters.delete(old_name) if filters[old_name].present? end - - def resource_parent - respond_to?(:board) ? board.resource_parent : list.board.resource_parent - end end ::BoardItemFilterable.prepend_mod_with('Resolvers::BoardItemFilterable') diff --git a/doc/user/project/issues/managing_issues.md b/doc/user/project/issues/managing_issues.md index 034e7903af0..84c90f99279 100644 --- a/doc/user/project/issues/managing_issues.md +++ b/doc/user/project/issues/managing_issues.md @@ -26,6 +26,12 @@ To edit an issue: > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9 [with a flag](../../../administration/feature_flags.md) named `work_items_mvc_2`. Disabled by default. +FLAG: +On self-managed GitLab, by default this feature is not available. +To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `work_items_mvc_2`. +On GitLab.com, this feature is not available. +The feature is not ready for production use. + Prerequisites: - You must have at least the Reporter role for the project, or be the author or assignee of the issue. diff --git a/doc/user/tasks.md b/doc/user/tasks.md index ff18abfab5b..c832090e35d 100644 --- a/doc/user/tasks.md +++ b/doc/user/tasks.md @@ -62,6 +62,12 @@ To create a task: > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/377307) in GitLab 15.9 [with a flag](../administration/feature_flags.md) named `work_items_mvc_2`. Disabled by default. +FLAG: +On self-managed GitLab, by default this feature is not available. +To make it available, ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `work_items_mvc_2`. +On GitLab.com, this feature is not available. +The feature is not ready for production use. + Prerequisites: - You must have at least the Reporter role for the project. diff --git a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml index 222f534387a..eb8e5de5b56 100644 --- a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.gitlab-ci.yml @@ -15,6 +15,7 @@ variables: DS_EXCLUDED_ANALYZERS: "" DS_EXCLUDED_PATHS: "spec, test, tests, tmp" DS_MAJOR_VERSION: 3 + DS_SCHEMA_MODEL: 15 dependency_scanning: stage: test diff --git a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml index 67057e916a8..655ac6ee712 100644 --- a/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Dependency-Scanning.latest.gitlab-ci.yml @@ -15,6 +15,7 @@ variables: DS_EXCLUDED_ANALYZERS: "" DS_EXCLUDED_PATHS: "spec, test, tests, tmp" DS_MAJOR_VERSION: 3 + DS_SCHEMA_MODEL: 15 dependency_scanning: stage: test diff --git a/spec/requests/api/graphql/boards/board_list_query_spec.rb b/spec/requests/api/graphql/boards/board_list_query_spec.rb index b5ed0fe35d5..6ddcf8a13fd 100644 --- a/spec/requests/api/graphql/boards/board_list_query_spec.rb +++ b/spec/requests/api/graphql/boards/board_list_query_spec.rb @@ -9,9 +9,11 @@ RSpec.describe 'Querying a Board list', feature_category: :team_planning do let_it_be(:project) { create(:project) } let_it_be(:board) { create(:board, resource_parent: project) } let_it_be(:label) { create(:label, project: project, name: 'foo') } + let_it_be(:extra_label1) { create(:label, project: project) } + let_it_be(:extra_label2) { create(:label, project: project) } let_it_be(:list) { create(:list, board: board, label: label) } - let_it_be(:issue1) { create(:issue, project: project, labels: [label]) } - let_it_be(:issue2) { create(:issue, project: project, labels: [label], assignees: [current_user]) } + let_it_be(:issue1) { create(:issue, project: project, labels: [label, extra_label1]) } + let_it_be(:issue2) { create(:issue, project: project, labels: [label, extra_label2], assignees: [current_user]) } let_it_be(:issue3) { create(:issue, project: project, labels: [label], confidential: true) } let(:filters) { {} } @@ -66,6 +68,18 @@ RSpec.describe 'Querying a Board list', feature_category: :team_planning do is_expected.to include({ 'issuesCount' => 1, 'title' => list.title }) end end + + context 'when filtering by OR labels' do + let(:filters) { { or: { labelNames: [extra_label1.title, extra_label2.title] } } } + + before_all do + project.add_developer(current_user) + end + + it 'filters issues metadata' do + is_expected.to include({ 'issuesCount' => 2, 'title' => list.title }) + end + end end end |