Repository: xanzy/go-gitlab
Pull request #1820 (2023-10-08 07:33:54)

:sparkles: Appearance API
https://docs.gitlab.com/ee/api/appearance.html
https://github.com/xanzy/go-gitlab/issues/1819


Patch:
diff --git a/appearance.go b/appearance.go
new file mode 100644
index 0000000..f21893c
--- /dev/null
+++ b/appearance.go
@@ -0,0 +1,110 @@
+//
+// Copyright 2023, 徐晓伟 <xuxiaowei@xuxiaowei.com.cn>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package gitlab
+
+import "net/http"
+
+// AppearanceService handles communication with appearance of the Gitlab API.
+//
+// Gitlab API docs : https://docs.gitlab.com/ee/api/appearance.html
+type AppearanceService struct {
+	client *Client
+}
+
+// Appearance represents a GitLab appearance.
+//
+// Gitlab API docs : https://docs.gitlab.com/ee/api/appearance.html
+type Appearance struct {
+	Title                       string `json:"title"`
+	Description                 string `json:"description"`
+	PWAName                     string `json:"pwa_name"`
+	PWAShortName                string `json:"pwa_short_name"`
+	PWADescription              string `json:"pwa_description"`
+	PWAIcon                     string `json:"pwa_icon"`
+	Logo                        string `json:"logo"`
+	HeaderLogo                  string `json:"header_logo"`
+	Favicon                     string `json:"favicon"`
+	NewProjectGuidelines        string `json:"new_project_guidelines"`
+	ProfileImageGuidelines      string `json:"profile_image_guidelines"`
+	HeaderMessage               string `json:"header_message"`
+	FooterMessage               string `json:"footer_message"`
+	MessageBackgroundColor      string `json:"message_background_color"`
+	MessageFontColor            string `json:"message_font_color"`
+	EmailHeaderAndFooterEnabled bool   `json:"email_header_and_footer_enabled"`
+}
+
+// GetAppearance gets the current appearance configuration of the GitLab instance.
+//
+// Gitlab API docs:
+// https://docs.gitlab.com/ee/api/appearance.html#get-current-appearance-configuration
+func (s *AppearanceService) GetAppearance(options ...RequestOptionFunc) (*Appearance, *Response, error) {
+	req, err := s.client.NewRequest(http.MethodGet, "application/appearance", nil, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	as := new(Appearance)
+	resp, err := s.client.Do(req, as)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return as, resp, nil
+}
+
+// ChangeAppearanceOptions represents the available ChangeAppearance() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/appearance.html#change-appearance-configuration
+type ChangeAppearanceOptions struct {
+	Title                       *string `url:"title,omitempty" json:"title,omitempty"`
+	Description                 *string `url:"description,omitempty" json:"description,omitempty"`
+	PWAName                     *string `url:"pwa_name,omitempty" json:"pwa_name,omitempty"`
+	PWAShortName                *string `url:"pwa_short_name,omitempty" json:"pwa_short_name,omitempty"`
+	PWADescription              *string `url:"pwa_description,omitempty" json:"pwa_description,omitempty"`
+	PWAIcon                     *string `url:"pwa_icon,omitempty" json:"pwa_icon,omitempty"`
+	Logo                        *string `url:"logo,omitempty" json:"logo,omitempty"`
+	HeaderLogo                  *string `url:"header_logo,omitempty" json:"header_logo,omitempty"`
+	Favicon                     *string `url:"favicon,omitempty" json:"favicon,omitempty"`
+	NewProjectGuidelines        *string `url:"new_project_guidelines,omitempty" json:"new_project_guidelines,omitempty"`
+	ProfileImageGuidelines      *string `url:"profile_image_guidelines,omitempty" json:"profile_image_guidelines,omitempty"`
+	HeaderMessage               *string `url:"header_message,omitempty" json:"header_message,omitempty"`
+	FooterMessage               *string `url:"footer_message,omitempty" json:"footer_message,omitempty"`
+	MessageBackgroundColor      *string `url:"message_background_color,omitempty" json:"message_background_color,omitempty"`
+	MessageFontColor            *string `url:"message_font_color,omitempty" json:"message_font_color,omitempty"`
+	EmailHeaderAndFooterEnabled *bool   `url:"email_header_and_footer_enabled,omitempty" json:"email_header_and_footer_enabled,omitempty"`
+	URL                         *string `url:"url,omitempty" json:"url,omitempty"`
+}
+
+// ChangeAppearance changes the appearance configuration.
+//
+// Gitlab API docs:
+// https://docs.gitlab.com/ee/api/appearance.html#change-appearance-configuration
+func (s *AppearanceService) ChangeAppearance(opt *ChangeAppearanceOptions, options ...RequestOptionFunc) (*Appearance, *Response, error) {
+	req, err := s.client.NewRequest(http.MethodPut, "application/appearance", opt, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	as := new(Appearance)
+	resp, err := s.client.Do(req, as)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return as, resp, nil
+}
diff --git a/gitlab.go b/gitlab.go
index 0f882bf..b1844a9 100644
--- a/gitlab.go
+++ b/gitlab.go
@@ -105,6 +105,7 @@ type Client struct {
 
 	// Services used for talking to different parts of the GitLab API.
 	AccessRequests               *AccessRequestsService
+	Appearance                   *AppearanceService
 	Applications                 *ApplicationsService
 	AuditEvents                  *AuditEventsService
 	Avatar                       *AvatarRequestsService
@@ -328,6 +329,7 @@ func newClient(options ...ClientOptionFunc) (*Client, error) {
 
 	// Create all the public services.
 	c.AccessRequests = &AccessRequestsService{client: c}
+	c.Appearance = &AppearanceService{client: c}
 	c.Applications = &ApplicationsService{client: c}
 	c.AuditEvents = &AuditEventsService{client: c}
 	c.Avatar = &AvatarRequestsService{client: c}
diff --git a/merge_requests.go b/merge_requests.go
index 458255f..f5b68fd 100644
--- a/merge_requests.go
+++ b/merge_requests.go
@@ -202,7 +202,6 @@ type ListMergeRequestsOptions struct {
 	Scope                  *string           `url:"scope,omitempty" json:"scope,omitempty"`
 	AuthorID               *int              `url:"author_id,omitempty" json:"author_id,omitempty"`
 	AuthorUsername         *string           `url:"author_username,omitempty" json:"author_username,omitempty"`
-	NotAuthorUsername      *string           `url:"not[author_username],omitempty" json:"not[author_username],omitempty"`
 	AssigneeID             *AssigneeIDValue  `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
 	ApproverIDs            *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
 	ApprovedByIDs          *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`
@@ -263,7 +262,6 @@ type ListProjectMergeRequestsOptions struct {
 	Scope                  *string           `url:"scope,omitempty" json:"scope,omitempty"`
 	AuthorID               *int              `url:"author_id,omitempty" json:"author_id,omitempty"`
 	AuthorUsername         *string           `url:"author_username,omitempty" json:"author_username,omitempty"`
-	NotAuthorUsername      *string           `url:"not[author_username],omitempty" json:"not[author_username],omitempty"`
 	AssigneeID             *AssigneeIDValue  `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
 	ApproverIDs            *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
 	ApprovedByIDs          *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`
@@ -325,7 +323,6 @@ type ListGroupMergeRequestsOptions struct {
 	Scope                  *string           `url:"scope,omitempty" json:"scope,omitempty"`
 	AuthorID               *int              `url:"author_id,omitempty" json:"author_id,omitempty"`
 	AuthorUsername         *string           `url:"author_username,omitempty" json:"author_username,omitempty"`
-	NotAuthorUsername      *string           `url:"not[author_username],omitempty" json:"not[author_username],omitempty"`
 	AssigneeID             *AssigneeIDValue  `url:"assignee_id,omitempty" json:"assignee_id,omitempty"`
 	ApproverIDs            *ApproverIDsValue `url:"approver_ids,omitempty" json:"approver_ids,omitempty"`
 	ApprovedByIDs          *ApproverIDsValue `url:"approved_by_ids,omitempty" json:"approved_by_ids,omitempty"`


Test patch:
diff --git a/appearance_test.go b/appearance_test.go
new file mode 100644
index 0000000..49ac351
--- /dev/null
+++ b/appearance_test.go
@@ -0,0 +1,151 @@
+//
+// Copyright 2023, 徐晓伟 <xuxiaowei@xuxiaowei.com.cn>
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package gitlab
+
+import (
+	"fmt"
+	"net/http"
+	"reflect"
+	"testing"
+)
+
+func TestGetAppearance(t *testing.T) {
+	mux, client := setup(t)
+
+	mux.HandleFunc("/api/v4/application/appearance", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprint(w, `{
+ 		 	"title": "GitLab Test Instance",
+ 		 	"description": "gitlab-test.example.com",
+ 		 	"pwa_name": "GitLab PWA",
+ 		 	"pwa_short_name": "GitLab",
+ 		 	"pwa_description": "GitLab as PWA",
+ 		 	"pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
+ 		 	"logo": "/uploads/-/system/appearance/logo/1/logo.png",
+ 		 	"header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
+ 		 	"favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
+ 		 	"new_project_guidelines": "Please read the FAQs for help.",
+ 		 	"profile_image_guidelines": "Custom profile image guidelines",
+ 		 	"header_message": "",
+ 		 	"footer_message": "",
+ 		 	"message_background_color": "#e75e40",
+ 		 	"message_font_color": "#ffffff",
+ 		 	"email_header_and_footer_enabled": false
+ 		}`)
+	})
+
+	appearance, _, err := client.Appearance.GetAppearance()
+	if err != nil {
+		t.Errorf("Appearance.GetAppearance returned error: %v", err)
+	}
+
+	want := &Appearance{
+		Title:                       "GitLab Test Instance",
+		Description:                 "gitlab-test.example.com",
+		PWAName:                     "GitLab PWA",
+		PWAShortName:                "GitLab",
+		PWADescription:              "GitLab as PWA",
+		PWAIcon:                     "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
+		Logo:                        "/uploads/-/system/appearance/logo/1/logo.png",
+		HeaderLogo:                  "/uploads/-/system/appearance/header_logo/1/header.png",
+		Favicon:                     "/uploads/-/system/appearance/favicon/1/favicon.png",
+		NewProjectGuidelines:        "Please read the FAQs for help.",
+		ProfileImageGuidelines:      "Custom profile image guidelines",
+		HeaderMessage:               "",
+		FooterMessage:               "",
+		MessageBackgroundColor:      "#e75e40",
+		MessageFontColor:            "#ffffff",
+		EmailHeaderAndFooterEnabled: false,
+	}
+
+	if !reflect.DeepEqual(want, appearance) {
+		t.Errorf("Appearance.GetAppearance returned %+v, want %+v", appearance, want)
+	}
+}
+
+func TestChangeAppearance(t *testing.T) {
+	mux, client := setup(t)
+
+	mux.HandleFunc("/api/v4/application/appearance", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPut)
+		fmt.Fprint(w, `{
+		 	"title": "GitLab Test Instance - 001",
+ 		 	"description": "gitlab-test.example.com",
+ 		 	"pwa_name": "GitLab PWA",
+ 		 	"pwa_short_name": "GitLab",
+ 		 	"pwa_description": "GitLab as PWA",
+ 		 	"pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
+ 		 	"logo": "/uploads/-/system/appearance/logo/1/logo.png",
+ 		 	"header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
+ 		 	"favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
+ 		 	"new_project_guidelines": "Please read the FAQs for help.",
+ 		 	"profile_image_guidelines": "Custom profile image guidelines",
+ 		 	"header_message": "",
+ 		 	"footer_message": "",
+ 		 	"message_background_color": "#e75e40",
+ 		 	"message_font_color": "#ffffff",
+ 		 	"email_header_and_footer_enabled": false
+ 		}`)
+	})
+
+	opt := &ChangeAppearanceOptions{
+		Title:                       String("GitLab Test Instance - 001"),
+		Description:                 String("gitlab-test.example.com"),
+		PWAName:                     String("GitLab PWA"),
+		PWAShortName:                String("GitLab"),
+		PWADescription:              String("GitLab as PWA"),
+		PWAIcon:                     String("/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png"),
+		Logo:                        String("/uploads/-/system/appearance/logo/1/logo.png"),
+		HeaderLogo:                  String("/uploads/-/system/appearance/header_logo/1/header.png"),
+		Favicon:                     String("/uploads/-/system/appearance/favicon/1/favicon.png"),
+		NewProjectGuidelines:        String("Please read the FAQs for help."),
+		ProfileImageGuidelines:      String("Custom profile image guidelines"),
+		HeaderMessage:               String(""),
+		FooterMessage:               String(""),
+		MessageBackgroundColor:      String("#e75e40"),
+		MessageFontColor:            String("#ffffff"),
+		EmailHeaderAndFooterEnabled: Bool(false),
+	}
+
+	appearance, _, err := client.Appearance.ChangeAppearance(opt)
+	if err != nil {
+		t.Errorf("Appearance.ChangeAppearance returned error: %v", err)
+	}
+
+	want := &Appearance{
+		Title:                       "GitLab Test Instance - 001",
+		Description:                 "gitlab-test.example.com",
+		PWAName:                     "GitLab PWA",
+		PWAShortName:                "GitLab",
+		PWADescription:              "GitLab as PWA",
+		PWAIcon:                     "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
+		Logo:                        "/uploads/-/system/appearance/logo/1/logo.png",
+		HeaderLogo:                  "/uploads/-/system/appearance/header_logo/1/header.png",
+		Favicon:                     "/uploads/-/system/appearance/favicon/1/favicon.png",
+		NewProjectGuidelines:        "Please read the FAQs for help.",
+		ProfileImageGuidelines:      "Custom profile image guidelines",
+		HeaderMessage:               "",
+		FooterMessage:               "",
+		MessageBackgroundColor:      "#e75e40",
+		MessageFontColor:            "#ffffff",
+		EmailHeaderAndFooterEnabled: false,
+	}
+
+	if !reflect.DeepEqual(want, appearance) {
+		t.Errorf("Appearance.GetAppearance returned %+v, want %+v", appearance, want)
+	}
+}
diff --git a/merge_requests_test.go b/merge_requests_test.go
index cfee816..b7301ca 100644
--- a/merge_requests_test.go
+++ b/merge_requests_test.go
@@ -202,120 +202,6 @@ func TestListProjectMergeRequests(t *testing.T) {
 	}
 }
 
-func TestListProjectMergeRequestsAuthorUsername(t *testing.T) {
-	mux, client := setup(t)
-
-	path := "/api/v4/projects/278964/merge_requests"
-
-	mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
-		testMethod(t, r, http.MethodGet)
-		testParams(t, r, "assignee_id=Any&author_username=hfyngvason&with_labels_details=true&with_merge_status_recheck=true")
-		mustWriteHTTPResponse(t, w, "testdata/get_merge_requests_author_username.json")
-	})
-
-	opts := ListProjectMergeRequestsOptions{
-		AssigneeID:             AssigneeID(UserIDAny),
-		AuthorUsername:         String("hfyngvason"),
-		WithLabelsDetails:      Bool(true),
-		WithMergeStatusRecheck: Bool(true),
-	}
-
-	mergeRequests, _, err := client.MergeRequests.ListProjectMergeRequests(278964, &opts)
-
-	require.NoError(t, err)
-	require.Equal(t, 1, len(mergeRequests))
-
-	validStates := []string{"opened", "closed", "locked", "merged"}
-	detailedMergeStatuses := []string{
-		"blocked_status",
-		"broken_status",
-		"checking",
-		"ci_must_pass",
-		"ci_still_running",
-		"discussions_not_resolved",
-		"draft_status",
-		"external_status_checks",
-		"mergeable",
-		"not_approved",
-		"not_open",
-		"policies_denied",
-		"unchecked",
-	}
-	allCreatedBefore := time.Date(2019, 8, 21, 0, 0, 0, 0, time.UTC)
-	allCreatedAfter := time.Date(2019, 8, 17, 0, 0, 0, 0, time.UTC)
-
-	for _, mr := range mergeRequests {
-		require.Equal(t, 278964, mr.ProjectID)
-		require.Contains(t, validStates, mr.State)
-		assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix())
-		assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix())
-		assert.LessOrEqual(t, mr.CreatedAt.Unix(), mr.UpdatedAt.Unix())
-		assert.LessOrEqual(t, mr.TaskCompletionStatus.CompletedCount, mr.TaskCompletionStatus.Count)
-		require.Contains(t, detailedMergeStatuses, mr.DetailedMergeStatus)
-		// list requests do not provide these fields:
-		assert.Nil(t, mr.Pipeline)
-		assert.Nil(t, mr.HeadPipeline)
-		assert.Equal(t, "", mr.DiffRefs.HeadSha)
-	}
-}
-
-func TestListProjectMergeRequestsNotAuthorUsername(t *testing.T) {
-	mux, client := setup(t)
-
-	path := "/api/v4/projects/278964/merge_requests"
-
-	mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
-		testMethod(t, r, http.MethodGet)
-		testParams(t, r, "assignee_id=Any&not%5Bauthor_username%5D=hfyngvason&with_labels_details=true&with_merge_status_recheck=true")
-		mustWriteHTTPResponse(t, w, "testdata/get_merge_requests_not_author_username.json")
-	})
-
-	opts := ListProjectMergeRequestsOptions{
-		AssigneeID:             AssigneeID(UserIDAny),
-		NotAuthorUsername:      String("hfyngvason"),
-		WithLabelsDetails:      Bool(true),
-		WithMergeStatusRecheck: Bool(true),
-	}
-
-	mergeRequests, _, err := client.MergeRequests.ListProjectMergeRequests(278964, &opts)
-
-	require.NoError(t, err)
-	require.Equal(t, 2, len(mergeRequests))
-
-	validStates := []string{"opened", "closed", "locked", "merged"}
-	detailedMergeStatuses := []string{
-		"blocked_status",
-		"broken_status",
-		"checking",
-		"ci_must_pass",
-		"ci_still_running",
-		"discussions_not_resolved",
-		"draft_status",
-		"external_status_checks",
-		"mergeable",
-		"not_approved",
-		"not_open",
-		"policies_denied",
-		"unchecked",
-	}
-	allCreatedBefore := time.Date(2019, 8, 21, 0, 0, 0, 0, time.UTC)
-	allCreatedAfter := time.Date(2019, 8, 17, 0, 0, 0, 0, time.UTC)
-
-	for _, mr := range mergeRequests {
-		require.Equal(t, 278964, mr.ProjectID)
-		require.Contains(t, validStates, mr.State)
-		assert.Less(t, mr.CreatedAt.Unix(), allCreatedBefore.Unix())
-		assert.Greater(t, mr.CreatedAt.Unix(), allCreatedAfter.Unix())
-		assert.LessOrEqual(t, mr.CreatedAt.Unix(), mr.UpdatedAt.Unix())
-		assert.LessOrEqual(t, mr.TaskCompletionStatus.CompletedCount, mr.TaskCompletionStatus.Count)
-		require.Contains(t, detailedMergeStatuses, mr.DetailedMergeStatus)
-		// list requests do not provide these fields:
-		assert.Nil(t, mr.Pipeline)
-		assert.Nil(t, mr.HeadPipeline)
-		assert.Equal(t, "", mr.DiffRefs.HeadSha)
-	}
-}
-
 func TestCreateMergeRequestPipeline(t *testing.T) {
 	mux, client := setup(t)
 
diff --git a/testdata/get_merge_requests_author_username.json b/testdata/get_merge_requests_author_username.json
deleted file mode 100644
index 898528a..0000000
--- a/testdata/get_merge_requests_author_username.json
+++ /dev/null
@@ -1,89 +0,0 @@
-[
-  {
-    "id": 35385049,
-    "iid": 15442,
-    "project_id": 278964,
-    "title": "Draft: Use structured logging for DB load balancer",
-    "description": "## What does this MR do?",
-    "state": "opened",
-    "created_at": "2019-08-20T10:58:54.413Z",
-    "updated_at": "2019-08-20T12:01:49.849Z",
-    "merged_by": null,
-    "merged_at": null,
-    "closed_by": null,
-    "closed_at": null,
-    "target_branch": "master",
-    "source_branch": "use-structured-logging-for-db-load-balancer",
-    "user_notes_count": 1,
-    "upvotes": 0,
-    "downvotes": 0,
-    "assignee": {
-      "id": 4088036,
-      "name": "Hordur Freyr Yngvason",
-      "username": "hfyngvason",
-      "state": "active",
-      "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4088036/avatar.png",
-      "web_url": "https://gitlab.com/hfyngvason"
-    },
-    "author": {
-      "id": 4088036,
-      "name": "Hordur Freyr Yngvason",
-      "username": "hfyngvason",
-      "state": "active",
-      "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4088036/avatar.png",
-      "web_url": "https://gitlab.com/hfyngvason"
-    },
-    "assignees": [
-      {
-        "id": 4088036,
-        "name": "Hordur Freyr Yngvason",
-        "username": "hfyngvason",
-        "state": "active",
-        "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4088036/avatar.png",
-        "web_url": "https://gitlab.com/hfyngvason"
-      }
-    ],
-    "reviewers": [
-      {
-        "id": 2535118,
-        "name": "Thong Kuah",
-        "username": "tkuah",
-        "state": "active",
-        "avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
-        "web_url": "https://gitlab.com/tkuah"
-      }
-    ],
-    "source_project_id": 278964,
-    "target_project_id": 278964,
-    "labels": [
-      "backend",
-      "backstage",
-      "database",
-      "database::review pending",
-      "group::autodevops and kubernetes"
-    ],
-    "work_in_progress": true,
-    "milestone": null,
-    "merge_when_pipeline_succeeds": false,
-    "detailed_merge_status": "mergeable",
-    "sha": "2fc4e8b972ff3208ec63b6143e34ad67ff343ad7",
-    "merge_commit_sha": null,
-    "discussion_locked": null,
-    "should_remove_source_branch": null,
-    "force_remove_source_branch": true,
-    "reference": "!15442",
-    "web_url": "https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15442",
-    "time_stats": {
-      "time_estimate": 0,
-      "total_time_spent": 0,
-      "human_time_estimate": null,
-      "human_total_time_spent": null
-    },
-    "squash": true,
-    "task_completion_status": {
-      "count": 12,
-      "completed_count": 0
-    },
-    "approvals_before_merge": 1
-  }
-]
diff --git a/testdata/get_merge_requests_not_author_username.json b/testdata/get_merge_requests_not_author_username.json
deleted file mode 100644
index 97c83d9..0000000
--- a/testdata/get_merge_requests_not_author_username.json
+++ /dev/null
@@ -1,201 +0,0 @@
-[
-  {
-    "id": 35384461,
-    "iid": 15441,
-    "project_id": 278964,
-    "title": "Draft: Implement public MR-level approval rules API",
-    "description": "## What does this MR do?",
-    "state": "opened",
-    "created_at": "2019-08-20T10:51:56.806Z",
-    "updated_at": "2019-08-20T11:00:25.244Z",
-    "merged_by": null,
-    "merged_at": null,
-    "closed_by": null,
-    "closed_at": null,
-    "target_branch": "master",
-    "source_branch": "12055-public-mr-approval-rules-api",
-    "user_notes_count": 1,
-    "upvotes": 0,
-    "downvotes": 0,
-    "assignee": {
-      "id": 1884221,
-      "name": "Patrick Bajao",
-      "username": "patrickbajao",
-      "state": "active",
-      "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1884221/avatar.png",
-      "web_url": "https://gitlab.com/patrickbajao"
-    },
-    "author": {
-      "id": 1884221,
-      "name": "Patrick Bajao",
-      "username": "patrickbajao",
-      "state": "active",
-      "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1884221/avatar.png",
-      "web_url": "https://gitlab.com/patrickbajao"
-    },
-    "assignees": [
-      {
-        "id": 1884221,
-        "name": "Patrick Bajao",
-        "username": "patrickbajao",
-        "state": "active",
-        "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/1884221/avatar.png",
-        "web_url": "https://gitlab.com/patrickbajao"
-      }
-    ],
-    "source_project_id": 278964,
-    "target_project_id": 278964,
-    "labels": [
-      "Create [DEPRECATED]",
-      "Deliverable",
-      "GitLab Enterprise Edition",
-      "GitLab Starter",
-      "api",
-      "approvals",
-      "backend",
-      "devops::create",
-      "feature",
-      "group::source code",
-      "workflow::In dev"
-    ],
-    "work_in_progress": true,
-    "milestone": {
-      "id": 731038,
-      "iid": 37,
-      "group_id": 9970,
-      "title": "12.3",
-      "description": "",
-      "state": "active",
-      "created_at": "2018-12-07T12:40:55.400Z",
-      "updated_at": "2019-01-16T19:50:20.313Z",
-      "due_date": "2019-09-22",
-      "start_date": "2019-08-08",
-      "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/37"
-    },
-    "merge_when_pipeline_succeeds": false,
-    "detailed_merge_status": "mergeable",
-    "sha": "dbb2b82236b86328f44a1754c9188c0991e707e5",
-    "merge_commit_sha": null,
-    "discussion_locked": null,
-    "should_remove_source_branch": null,
-    "force_remove_source_branch": false,
-    "reference": "!15441",
-    "web_url": "https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15441",
-    "time_stats": {
-      "time_estimate": 0,
-      "total_time_spent": 0,
-      "human_time_estimate": null,
-      "human_total_time_spent": null
-    },
-    "squash": false,
-    "task_completion_status": {
-      "count": 8,
-      "completed_count": 1
-    },
-    "approvals_before_merge": 1
-  },
-  {
-    "id": 35368820,
-    "iid": 15440,
-    "project_id": 278964,
-    "title": "Log in Prometheus current number of host and index",
-    "description": "## What does this MR do?",
-    "state": "opened",
-    "created_at": "2019-08-20T10:20:51.687Z",
-    "updated_at": "2019-08-20T11:06:40.659Z",
-    "merged_by": null,
-    "merged_at": null,
-    "closed_by": null,
-    "closed_at": null,
-    "target_branch": "master",
-    "source_branch": "load-balancing-prometheus",
-    "user_notes_count": 2,
-    "upvotes": 0,
-    "downvotes": 0,
-    "assignee": {
-      "id": 4059128,
-      "name": "Avielle Wolfe",
-      "username": "avielle",
-      "state": "active",
-      "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4059128/avatar.png",
-      "web_url": "https://gitlab.com/avielle"
-    },
-    "author": {
-      "id": 2535118,
-      "name": "Thong Kuah",
-      "username": "tkuah",
-      "state": "active",
-      "avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
-      "web_url": "https://gitlab.com/tkuah"
-    },
-    "assignees": [
-      {
-        "id": 4059128,
-        "name": "Avielle Wolfe",
-        "username": "avielle",
-        "state": "active",
-        "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/4059128/avatar.png",
-        "web_url": "https://gitlab.com/avielle"
-      },
-      {
-        "id": 2535118,
-        "name": "Thong Kuah",
-        "username": "tkuah",
-        "state": "active",
-        "avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
-        "web_url": "https://gitlab.com/tkuah"
-      }
-    ],
-    "source_project_id": 278964,
-    "target_project_id": 278964,
-    "labels": [
-      "Configure [DEPRECATED]",
-      "Observability",
-      "P1",
-      "backend",
-      "backstage",
-      "database",
-      "database::review pending",
-      "devops::configure",
-      "gitlab.com",
-      "group::autodevops and kubernetes",
-      "infradev",
-      "workflow::In dev"
-    ],
-    "work_in_progress": false,
-    "milestone": {
-      "id": 731038,
-      "iid": 37,
-      "group_id": 9970,
-      "title": "12.3",
-      "description": "",
-      "state": "active",
-      "created_at": "2018-12-07T12:40:55.400Z",
-      "updated_at": "2019-01-16T19:50:20.313Z",
-      "due_date": "2019-09-22",
-      "start_date": "2019-08-08",
-      "web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/37"
-    },
-    "merge_when_pipeline_succeeds": false,
-    "detailed_merge_status": "mergeable",
-    "sha": "eae31acf34d2df2aba2ea469e432cab1c6a05b53",
-    "merge_commit_sha": null,
-    "discussion_locked": null,
-    "should_remove_source_branch": null,
-    "force_remove_source_branch": false,
-    "reference": "!15440",
-    "web_url": "https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15440",
-    "time_stats": {
-      "time_estimate": 0,
-      "total_time_spent": 0,
-      "human_time_estimate": null,
-      "human_total_time_spent": null
-    },
-    "squash": false,
-    "task_completion_status": {
-      "count": 12,
-      "completed_count": 1
-    },
-    "approvals_before_merge": 1
-  }
-]