From 76af220fb86a3d7c85d9a219e0a892287d787369 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 9 Dec 2024 12:46:48 -0700 Subject: [PATCH 1/3] Deprecate :labels negatable filter value This mismatch caused negated label filters to not work. We can't change any of the other values around this field because they're also used by the Issues list, so we need to update the name of this negatable field. Luckily, `labels` is the deprecated name, so we shouldn't have any problem doing this. Changelog: fixed --- app/graphql/resolvers/merge_requests_resolver.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/graphql/resolvers/merge_requests_resolver.rb b/app/graphql/resolvers/merge_requests_resolver.rb index a0af588ee090c4..1dbea70fb542ca 100644 --- a/app/graphql/resolvers/merge_requests_resolver.rb +++ b/app/graphql/resolvers/merge_requests_resolver.rb @@ -162,10 +162,14 @@ def self.accept_reviewer argument :author_username, GraphQL::Types::String, required: false, description: 'Filters merge requests to exclude any that are authored by the given user.' - argument :labels, [GraphQL::Types::String], + argument :label_name, [GraphQL::Types::String], required: false, - as: :label_name, description: 'Filters merge requests to exclude any that have the labels provided in the given array.' + argument :labels, [GraphQL::Types::String], + as: :label_name, + required: false, + description: 'Filters merge requests to exclude any that have the labels provided in the given array.', + deprecated: { reason: 'Use `labelName`', milestone: '17.1' } argument :milestone_title, GraphQL::Types::String, required: false, description: 'Filters merge requests to those not in the given milestone.' -- GitLab From fc6de1db67c4f6c1ab6d0d45cf653f860c9df47f Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 9 Dec 2024 13:20:58 -0700 Subject: [PATCH 2/3] Update GraphQL docs to use negated labelName instead of labels --- doc/api/graphql/reference/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 3f34169b1d11ed..8faf4127d3f844 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -44065,7 +44065,8 @@ Defines which user roles, users, or groups can merge into a protected branch. | `approvedBy` | [`[String!]`](#string) | Filters merge requests to exclude any that are approved by usernames in the given array. | | `assigneeUsernames` | [`[String!]`](#string) | Filters merge requests to exclude any that are assigned to the usernames in the given array. | | `authorUsername` | [`String`](#string) | Filters merge requests to exclude any that are authored by the given user. | -| `labels` | [`[String!]`](#string) | Filters merge requests to exclude any that have the labels provided in the given array. | +| `labelName` | [`[String!]`](#string) | Filters merge requests to exclude any that have the labels provided in the given array. | +| `labels` **{warning-solid}** | [`[String!]`](#string) | **Deprecated:** Use `labelName`. Deprecated in GitLab 17.1. | | `milestoneTitle` | [`String`](#string) | Filters merge requests to those not in the given milestone. | | `myReactionEmoji` | [`String`](#string) | Filters merge requests to those without the given reaction from the authenticated user. | | `releaseTag` | [`String`](#string) | Filters merge requests to those without the given release tag. | -- GitLab From 123986a4c2026a81d42a0b54af5e53b19733b972 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 9 Dec 2024 16:49:19 -0700 Subject: [PATCH 3/3] Update milestone that this negatable field was actually deprecated - It was deprecated now, in 17.7 - It was SUPPOSED to be deprecated along with the non-negated field, in 17.1 --- app/graphql/resolvers/merge_requests_resolver.rb | 2 +- doc/api/graphql/reference/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/graphql/resolvers/merge_requests_resolver.rb b/app/graphql/resolvers/merge_requests_resolver.rb index 1dbea70fb542ca..c7b7e8835bd76d 100644 --- a/app/graphql/resolvers/merge_requests_resolver.rb +++ b/app/graphql/resolvers/merge_requests_resolver.rb @@ -169,7 +169,7 @@ def self.accept_reviewer as: :label_name, required: false, description: 'Filters merge requests to exclude any that have the labels provided in the given array.', - deprecated: { reason: 'Use `labelName`', milestone: '17.1' } + deprecated: { reason: 'Use `labelName`', milestone: '17.7' } argument :milestone_title, GraphQL::Types::String, required: false, description: 'Filters merge requests to those not in the given milestone.' diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 8faf4127d3f844..3403fd7c221e11 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -44066,7 +44066,7 @@ Defines which user roles, users, or groups can merge into a protected branch. | `assigneeUsernames` | [`[String!]`](#string) | Filters merge requests to exclude any that are assigned to the usernames in the given array. | | `authorUsername` | [`String`](#string) | Filters merge requests to exclude any that are authored by the given user. | | `labelName` | [`[String!]`](#string) | Filters merge requests to exclude any that have the labels provided in the given array. | -| `labels` **{warning-solid}** | [`[String!]`](#string) | **Deprecated:** Use `labelName`. Deprecated in GitLab 17.1. | +| `labels` **{warning-solid}** | [`[String!]`](#string) | **Deprecated:** Use `labelName`. Deprecated in GitLab 17.7. | | `milestoneTitle` | [`String`](#string) | Filters merge requests to those not in the given milestone. | | `myReactionEmoji` | [`String`](#string) | Filters merge requests to those without the given reaction from the authenticated user. | | `releaseTag` | [`String`](#string) | Filters merge requests to those without the given release tag. | -- GitLab