nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: xanzy/go-gitlab
Pull request #1679 (2023-03-23 17:13:23)

Add alert status to group hooks


Patch:
diff --git a/group_hooks.go b/group_hooks.go
index bbbef54..a408948 100644
--- a/group_hooks.go
+++ b/group_hooks.go
@@ -44,6 +44,7 @@ type GroupHook struct {
 	ReleasesEvents           bool       `json:"releases_events"`
 	SubGroupEvents           bool       `json:"subgroup_events"`
 	EnableSSLVerification    bool       `json:"enable_ssl_verification"`
+	AlertStatus              string     `json:"alert_status"`
 	CreatedAt                *time.Time `json:"created_at"`
 }
 


Test patch:
diff --git a/group_hooks_test.go b/group_hooks_test.go
index 7480bbb..1dde62a 100644
--- a/group_hooks_test.go
+++ b/group_hooks_test.go
@@ -49,6 +49,7 @@ func TestListGroupHooks(t *testing.T) {
 		"releases_events": true,
 		"subgroup_events": true,
 		"enable_ssl_verification": true,
+		"alert_status": "executable",
 		"created_at": "2012-10-12T17:04:47Z"
 	}
 ]`)
@@ -78,6 +79,7 @@ func TestListGroupHooks(t *testing.T) {
 		ReleasesEvents:           true,
 		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
+		AlertStatus:              "executable",
 		CreatedAt:                &datePointer,
 	}}
 
@@ -110,6 +112,7 @@ func TestGetGroupHook(t *testing.T) {
 	"releases_events": true,
 	"subgroup_events": true,
 	"enable_ssl_verification": true,
+	"alert_status": "executable",
 	"created_at": "2012-10-12T17:04:47Z"
 }`)
 	})
@@ -138,6 +141,7 @@ func TestGetGroupHook(t *testing.T) {
 		ReleasesEvents:           true,
 		SubGroupEvents:           true,
 		EnableSSLVerification:    true,
+		AlertStatus:              "executable",
 		CreatedAt:                &datePointer,
 	}
Repository: xanzy/go-gitlab
Pull request #1685 (2023-04-07 15:38:01)

Added missing fields in DeploymentEvent
Added StatusChangedAt, DeploymentID, EnvironmentSlug, and EnvironmentExternalURL in DeploymentEvent


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index cf79b37..5044444 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -143,12 +143,16 @@ type CommitCommentEvent struct {
 // GitLab API docs:
 // https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#deployment-events
 type DeploymentEvent struct {
-	ObjectKind    string `json:"object_kind"`
-	Status        string `json:"status"`
-	DeployableID  int    `json:"deployable_id"`
-	DeployableURL string `json:"deployable_url"`
-	Environment   string `json:"environment"`
-	Project       struct {
+	ObjectKind             string `json:"object_kind"`
+	Status                 string `json:"status"`
+	StatusChangedAt        string `json:"status_changed_at"`
+	DeploymentID           int    `json:"deployment_id"`
+	DeployableID           int    `json:"deployable_id"`
+	DeployableURL          string `json:"deployable_url"`
+	Environment            string `json:"environment"`
+	EnvironmentSlug        string `json:"environment_slug"`
+	EnvironmentExternalURL string `json:"environment_external_url"`
+	Project                struct {
 		ID                int     `json:"id"`
 		Name              string  `json:"name"`
 		Description       string  `json:"description"`


Test patch:
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index 1bc42c5..421e3c6 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -174,6 +174,22 @@ func TestDeploymentEventUnmarshal(t *testing.T) {
 	if event.Ref != "1.0.0" {
 		t.Errorf("Ref is %s, want %s", event.Ref, "1.0.0")
 	}
+
+	if event.StatusChangedAt != "2021-04-28 21:50:00 +0200" {
+		t.Errorf("StatusChangedAt is %s, want %s", event.StatusChangedAt, "2021-04-28 21:50:00 +0200")
+	}
+
+	if event.DeploymentID != 15 {
+		t.Errorf("DeploymentID is %d, want %d", event.DeploymentID, 15)
+	}
+
+	if event.EnvironmentSlug != "staging" {
+		t.Errorf("EnvironmentSlug is %s, want %s", event.EnvironmentSlug, "staging")
+	}
+
+	if event.EnvironmentExternalURL != "https://staging.example.com" {
+		t.Errorf("EnvironmentExternalURL is %s, want %s", event.EnvironmentExternalURL, "https://staging.example.com")
+	}
 }
 
 func TestIssueCommentEventUnmarshal(t *testing.T) {
diff --git a/testdata/webhooks/deployment.json b/testdata/webhooks/deployment.json
index ce3c131..781935e 100644
--- a/testdata/webhooks/deployment.json
+++ b/testdata/webhooks/deployment.json
@@ -1,9 +1,13 @@
 {
   "object_kind": "deployment",
   "status": "success",
+  "status_changed_at":"2021-04-28 21:50:00 +0200",
+  "deployment_id": 15,
   "deployable_id": 796,
   "deployable_url": "http://10.126.0.2:3000/root/test-deployment-webhooks/-/jobs/796",
   "environment": "staging",
+  "environment_slug": "staging",
+  "environment_external_url": "https://staging.example.com",
   "project": {
     "id": 30,
     "name": "test-deployment-webhooks",
Repository: xanzy/go-gitlab
Pull request #1698 (2023-04-12 23:00:35)

Added detailed_merge_status in PipelineEvent


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index 5044444..b4d74bf 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -722,16 +722,17 @@ type PipelineEvent struct {
 		} `json:"variables"`
 	} `json:"object_attributes"`
 	MergeRequest struct {
-		ID                 int    `json:"id"`
-		IID                int    `json:"iid"`
-		Title              string `json:"title"`
-		SourceBranch       string `json:"source_branch"`
-		SourceProjectID    int    `json:"source_project_id"`
-		TargetBranch       string `json:"target_branch"`
-		TargetProjectID    int    `json:"target_project_id"`
-		State              string `json:"state"`
-		MergeRequestStatus string `json:"merge_status"`
-		URL                string `json:"url"`
+		ID                  int    `json:"id"`
+		IID                 int    `json:"iid"`
+		Title               string `json:"title"`
+		SourceBranch        string `json:"source_branch"`
+		SourceProjectID     int    `json:"source_project_id"`
+		TargetBranch        string `json:"target_branch"`
+		TargetProjectID     int    `json:"target_project_id"`
+		State               string `json:"state"`
+		MergeRequestStatus  string `json:"merge_status"`
+		DetailedMergeStatus string `json:"detailed_merge_status"`
+		URL                 string `json:"url"`
 	} `json:"merge_request"`
 	User    *EventUser `json:"user"`
 	Project struct {


Test patch:
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index 421e3c6..e64034b 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -711,6 +711,10 @@ func TestPipelineEventUnmarshal(t *testing.T) {
 	if event.SourcePipline.Project.ID != 41 {
 		t.Errorf("Source Pipline Project ID is %v, want %v", event.SourcePipline.Project.ID, 41)
 	}
+
+	if event.MergeRequest.DetailedMergeStatus != "mergeable" {
+		t.Errorf("MergeRequest.DetailedMergeStatus is %v, want %v", event.MergeRequest.DetailedMergeStatus, "mergeable")
+	}
 }
 
 func TestPushEventUnmarshal(t *testing.T) {
diff --git a/testdata/webhooks/pipeline.json b/testdata/webhooks/pipeline.json
index 55fe118..50df632 100644
--- a/testdata/webhooks/pipeline.json
+++ b/testdata/webhooks/pipeline.json
@@ -35,6 +35,7 @@
     "target_project_id": 1,
     "state": "opened",
     "merge_status": "can_be_merged",
+    "detailed_merge_status": "mergeable",
     "url": "http://192.168.64.1:3005/gitlab-org/gitlab-test/merge_requests/1"
   },
   "user": {
Repository: xanzy/go-gitlab
Pull request #1699 (2023-04-12 23:10:50)

Added EventName and Project.ID in PushEvent


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index 5044444..6933d66 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -812,6 +812,7 @@ type PipelineEvent struct {
 // https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#push-events
 type PushEvent struct {
 	ObjectKind   string `json:"object_kind"`
+	EventName    string `json:"event_name"`
 	Before       string `json:"before"`
 	After        string `json:"after"`
 	Ref          string `json:"ref"`
@@ -823,6 +824,7 @@ type PushEvent struct {
 	UserAvatar   string `json:"user_avatar"`
 	ProjectID    int    `json:"project_id"`
 	Project      struct {
+		ID                int             `json:"id"`
 		Name              string          `json:"name"`
 		Description       string          `json:"description"`
 		AvatarURL         string          `json:"avatar_url"`


Test patch:
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index 421e3c6..eb4a335 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -725,6 +725,10 @@ func TestPushEventUnmarshal(t *testing.T) {
 		t.Errorf("Push Event is null")
 	}
 
+	if event.EventName != "push" {
+		t.Errorf("EventName is %v, want %v", event.EventName, "push")
+	}
+
 	if event.ProjectID != 15 {
 		t.Errorf("ProjectID is %v, want %v", event.ProjectID, 15)
 	}
@@ -733,6 +737,10 @@ func TestPushEventUnmarshal(t *testing.T) {
 		t.Errorf("Username is %s, want %s", event.UserName, exampleEventUserName)
 	}
 
+	if event.Project.ID != 15 {
+		t.Errorf("Project.ID is %v, want %v", event.Project.ID, 15)
+	}
+
 	if event.Commits[0] == nil || event.Commits[0].Timestamp == nil {
 		t.Errorf("Commit Timestamp isn't nil")
 	}
diff --git a/testdata/webhooks/push.json b/testdata/webhooks/push.json
index 3470046..75fd30a 100644
--- a/testdata/webhooks/push.json
+++ b/testdata/webhooks/push.json
@@ -1,5 +1,6 @@
 {
   "object_kind": "push",
+  "event_name": "push",
   "before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
   "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
   "ref": "refs/heads/master",
Repository: xanzy/go-gitlab
Pull request #1708 (2023-04-22 02:02:38)

refactor: add pipeline iid in the webhook event
Added another missing attribute in webhook events.


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index cb1dd5b..3899c17 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -784,6 +784,7 @@ type PipelineEvent struct {
 	ObjectKind       string `json:"object_kind"`
 	ObjectAttributes struct {
 		ID             int      `json:"id"`
+		IID            int      `json:"iid"`
 		Ref            string   `json:"ref"`
 		Tag            bool     `json:"tag"`
 		SHA            string   `json:"sha"`


Test patch:
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index bcd005e..69ae200 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -932,7 +932,11 @@ func TestPipelineEventUnmarshal(t *testing.T) {
 	}
 
 	if event.ObjectAttributes.ID != 31 {
-		t.Errorf("ObjectAttributes.ID is %v, want %v", event.ObjectAttributes.ID, 1977)
+		t.Errorf("ObjectAttributes.ID is %v, want %v", event.ObjectAttributes.ID, 31)
+	}
+
+	if event.ObjectAttributes.IID != 123 {
+		t.Errorf("ObjectAttributes.IID is %v, want %v", event.ObjectAttributes.ID, 123)
 	}
 
 	if event.ObjectAttributes.DetailedStatus != "passed" {
diff --git a/testdata/webhooks/pipeline.json b/testdata/webhooks/pipeline.json
index 50df632..27d0e93 100644
--- a/testdata/webhooks/pipeline.json
+++ b/testdata/webhooks/pipeline.json
@@ -2,6 +2,7 @@
   "object_kind": "pipeline",
   "object_attributes": {
     "id": 31,
+    "iid": 123,
     "ref": "master",
     "tag": false,
     "sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
Repository: xanzy/go-gitlab
Pull request #1719 (2023-05-15 17:30:54)

Add missing Project lint options
The two different project lint calls were missing some options from https://docs.gitlab.com/ee/api/lint.html#validate-a-projects-ci-configuration


Patch:
diff --git a/validate.go b/validate.go
index 4b49dad..1a0f56a 100644
--- a/validate.go
+++ b/validate.go
@@ -85,8 +85,10 @@ func (s *ValidateService) Lint(opts *LintOptions, options ...RequestOptionFunc)
 // GitLab API docs:
 // https://docs.gitlab.com/ee/api/lint.html#validate-a-ci-yaml-configuration-with-a-namespace
 type ProjectNamespaceLintOptions struct {
-	Content *string `url:"content,omitempty" json:"content,omitempty"`
-	DryRun  *bool   `url:"dry_run,omitempty" json:"dry_run,omitempty"`
+	Content     *string `url:"content,omitempty" json:"content,omitempty"`
+	DryRun      *bool   `url:"dry_run,omitempty" json:"dry_run,omitempty"`
+	IncludeJobs *bool   `url:"include_jobs,omitempty" json:"include_jobs,omitempty"`
+	Ref         *string `url:"ref,omitempty" json:"ref,omitempty"`
 }
 
 // ProjectNamespaceLint validates .gitlab-ci.yml content by project.
@@ -119,7 +121,9 @@ func (s *ValidateService) ProjectNamespaceLint(pid interface{}, opt *ProjectName
 // GitLab API docs:
 // https://docs.gitlab.com/ee/api/lint.html#validate-a-projects-ci-configuration
 type ProjectLintOptions struct {
-	DryRun *bool `url:"dry_run,omitempty" json:"dry_run,omitempty"`
+	DryRun      *bool   `url:"dry_run,omitempty" json:"dry_run,omitempty"`
+	IncludeJobs *bool   `url:"include_jobs,omitempty" json:"include_jobs,omitempty"`
+	Ref         *string `url:"ref,omitempty" json:"ref,omitempty"`
 }
 
 // ProjectLint validates .gitlab-ci.yml content by project.


Test patch:
diff --git a/validate_test.go b/validate_test.go
index 05452c0..55e9d62 100644
--- a/validate_test.go
+++ b/validate_test.go
@@ -163,8 +163,10 @@ func TestValidateProjectNamespace(t *testing.T) {
 		{
 			description: "valid",
 			request: &ProjectNamespaceLintOptions{
-				Content: String("{'build': {'script': 'echo build'}}"),
-				DryRun:  Bool(false),
+				Content:     String("{'build': {'script': 'echo build'}}"),
+				DryRun:      Bool(false),
+				IncludeJobs: Bool(true),
+				Ref:         String("foo"),
 			},
 			response: `{
 				"valid": true,
Repository: xanzy/go-gitlab
Pull request #1724 (2023-05-30 15:48:14)

Fix Issue Event Weight Type
This PR resolves #1705 


Patch:
diff --git a/event_webhook_types.go b/event_webhook_types.go
index 7c51a01..b90f4fa 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -333,7 +333,7 @@ type IssueEvent struct {
 		HumanTotalTimeSpent string   `json:"human_total_time_spent"`
 		HumanTimeEstimate   string   `json:"human_time_estimate"`
 		HumanTimeChange     string   `json:"human_time_change"`
-		Weight              string   `json:"weight"`
+		Weight              int      `json:"weight"`
 		IID                 int      `json:"iid"`
 		URL                 string   `json:"url"`
 		State               string   `json:"state"`


Test patch:
diff --git a/testdata/webhooks/issue.json b/testdata/webhooks/issue.json
index 2f10e1e..db06ec0 100644
--- a/testdata/webhooks/issue.json
+++ b/testdata/webhooks/issue.json
@@ -53,7 +53,7 @@
     "human_total_time_spent": null,
     "human_time_estimate": null,
     "human_time_change": null,
-    "weight": null,
+    "weight": 10,
     "iid": 23,
     "url": "http://example.com/diaspora/issues/23",
     "state": "opened",
Repository: xanzy/go-gitlab
Pull request #1747 (2023-06-27 05:45:45)

Add support for user associations_count
https://docs.gitlab.com/ee/api/users.html#list-associations-count-for-user


Patch:
diff --git a/users.go b/users.go
index b19955a..a77852e 100644
--- a/users.go
+++ b/users.go
@@ -398,6 +398,36 @@ func (s *UsersService) SetUserStatus(opt *UserStatusOptions, options ...RequestO
 	return status, resp, nil
 }
 
+// UserAssociationsCount represents the user associations count.
+//
+// Gitlab API docs: https://docs.gitlab.com/ee/api/users.html#list-associations-count-for-user
+type UserAssociationsCount struct {
+	GroupsCount        int `json:"groups_count"`
+	ProjectsCount      int `json:"projects_count"`
+	IssuesCount        int `json:"issues_count"`
+	MergeRequestsCount int `json:"merge_requests_count"`
+}
+
+// GetUserAssociationsCount gets a list of a specified user associations.
+//
+// Gitlab API docs: https://docs.gitlab.com/ee/api/users.html#list-associations-count-for-user
+func (s *UsersService) GetUserAssociationsCount(user int, options ...RequestOptionFunc) (*UserAssociationsCount, *Response, error) {
+	u := fmt.Sprintf("users/%d/associations_count", user)
+
+	req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	uac := new(UserAssociationsCount)
+	resp, err := s.client.Do(req, uac)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return uac, resp, nil
+}
+
 // SSHKey represents a SSH key.
 //
 // GitLab API docs: https://docs.gitlab.com/ee/api/users.html#list-ssh-keys


Test patch:
diff --git a/testdata/get_user_associations_count.json b/testdata/get_user_associations_count.json
new file mode 100644
index 0000000..acb8f31
--- /dev/null
+++ b/testdata/get_user_associations_count.json
@@ -0,0 +1,6 @@
+{
+  "groups_count": 1,
+  "projects_count": 2,
+  "issues_count": 3,
+  "merge_requests_count": 4
+}
diff --git a/users_test.go b/users_test.go
index 0cd9179..565aacd 100644
--- a/users_test.go
+++ b/users_test.go
@@ -583,6 +583,28 @@ func TestGetMemberships(t *testing.T) {
 	assert.Equal(t, want, memberships)
 }
 
+func TestGetUserAssociationsCount(t *testing.T) {
+	mux, client := setup(t)
+
+	path := "/api/v4/users/1/associations_count"
+
+	mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		mustWriteHTTPResponse(t, w, "testdata/get_user_associations_count.json")
+	})
+
+	userAssociationsCount, _, err := client.Users.GetUserAssociationsCount(1)
+	require.NoError(t, err)
+
+	want := &UserAssociationsCount{
+		GroupsCount:        1,
+		ProjectsCount:      2,
+		IssuesCount:        3,
+		MergeRequestsCount: 4,
+	}
+	require.Equal(t, want, userAssociationsCount)
+}
+
 func TestGetSingleSSHKeyForUser(t *testing.T) {
 	mux, client := setup(t)
Repository: xanzy/go-gitlab
Pull request #1776 (2023-08-16 14:15:34)

Add snippet endpoint to get all snippets available to the user
Add endpoint to get all snippets available to the user. 

Docs: https://docs.gitlab.com/ee/api/snippets.html#list-all-snippets
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127696



Patch:
diff --git a/snippets.go b/snippets.go
index 12687c3..c25548b 100644
--- a/snippets.go
+++ b/snippets.go
@@ -57,6 +57,7 @@ type Snippet struct {
 		Path   string `json:"path"`
 		RawURL string `json:"raw_url"`
 	} `json:"files"`
+	RepositoryStorage string `json:"repository_storage"`
 }
 
 func (s Snippet) String() string {
@@ -281,3 +282,33 @@ func (s *SnippetsService) ExploreSnippets(opt *ExploreSnippetsOptions, options .
 
 	return ps, resp, nil
 }
+
+// ListAllSnippetsOptions represents the available ListAllSnippets() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/snippets.html#list-all-snippets
+type ListAllSnippetsOptions struct {
+	ListOptions
+	CreatedAfter      *ISOTime `url:"created_after,omitempty" json:"created_after,omitempty"`
+	CreatedBefore     *ISOTime `url:"created_before,omitempty" json:"created_before,omitempty"`
+	RepositoryStorage *string  `url:"repository_storage,omitempty" json:"repository_storage,omitempty"`
+}
+
+// ListAllSnippets gets all snippets the current user has access to.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ee/api/snippets.html#list-all-snippets
+func (s *SnippetsService) ListAllSnippets(opt *ListAllSnippetsOptions, options ...RequestOptionFunc) ([]*Snippet, *Response, error) {
+	req, err := s.client.NewRequest(http.MethodGet, "snippets/all", opt, options)
+	if err != nil {
+		return nil, nil, err
+	}
+
+	var ps []*Snippet
+	resp, err := s.client.Do(req, &ps)
+	if err != nil {
+		return nil, resp, err
+	}
+
+	return ps, resp, nil
+}


Test patch:
diff --git a/snippets_test.go b/snippets_test.go
index 42f904c..7da054b 100644
--- a/snippets_test.go
+++ b/snippets_test.go
@@ -129,3 +129,20 @@ func TestSnippetsService_ExploreSnippets(t *testing.T) {
 	want := []*Snippet{{ID: 42, Title: "test"}}
 	require.Equal(t, want, ss)
 }
+
+func TestSnippetsService_ListAllSnippets(t *testing.T) {
+	mux, client := setup(t)
+
+	mux.HandleFunc("/api/v4/snippets/all", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprint(w, `[{"id":113,"title":"Internal Snippet"}, {"id":114,"title":"Private Snippet"}]`)
+	})
+
+	opt := &ListAllSnippetsOptions{ListOptions: ListOptions{Page: 1, PerPage: 10}}
+
+	ss, _, err := client.Snippets.ListAllSnippets(opt)
+	require.NoError(t, err)
+
+	want := []*Snippet{{ID: 113, Title: "Internal Snippet"}, {ID: 114, Title: "Private Snippet"}}
+	require.Equal(t, want, ss)
+}
Repository: xanzy/go-gitlab
Pull request #1777 (2023-08-18 01:49:51)

Fix typo on function : GetGgpSignature


Patch:
diff --git a/commits.go b/commits.go
index 7c724c2..0c597d8 100644
--- a/commits.go
+++ b/commits.go
@@ -571,10 +571,10 @@ type GPGSignature struct {
 	KeySubkeyID        int    `json:"gpg_key_subkey_id"`
 }
 
-// GetGPGSiganature gets a GPG signature of a commit.
+// GetGPGSignature gets a GPG signature of a commit.
 //
 // GitLab API docs: https://docs.gitlab.com/ee/api/commits.html#get-gpg-signature-of-a-commit
-func (s *CommitsService) GetGPGSiganature(pid interface{}, sha string, options ...RequestOptionFunc) (*GPGSignature, *Response, error) {
+func (s *CommitsService) GetGPGSignature(pid interface{}, sha string, options ...RequestOptionFunc) (*GPGSignature, *Response, error) {
 	project, err := parseID(pid)
 	if err != nil {
 		return nil, nil, err


Test patch:
diff --git a/commits_test.go b/commits_test.go
index 38c43e0..fd00e0c 100644
--- a/commits_test.go
+++ b/commits_test.go
@@ -232,7 +232,7 @@ func TestGetGPGSignature(t *testing.T) {
 		mustWriteHTTPResponse(t, w, "testdata/get_signature.json")
 	})
 
-	sig, resp, err := client.Commits.GetGPGSiganature("1", "b0b3a907f41409829b307a28b82fdbd552ee5a27", nil)
+	sig, resp, err := client.Commits.GetGPGSignature("1", "b0b3a907f41409829b307a28b82fdbd552ee5a27", nil)
 	if err != nil {
 		t.Fatalf("Commits.GetGPGSignature returned error: %v, response: %v", err, resp)
 	}
Repository: xanzy/go-gitlab
Pull request #1787 (2023-09-03 04:42:19)

fix: squash is bool parameter not string
@svanharmelen , I am not sure how I missed this, but I apologize for this. It’s a small correction. 


Patch:
diff --git a/merge_trains.go b/merge_trains.go
index cbfd997..e55917f 100644
--- a/merge_trains.go
+++ b/merge_trains.go
@@ -140,7 +140,7 @@ func (s *MergeTrainsService) GetMergeRequestOnAMergeTrain(pid interface{}, merge
 type AddMergeRequestToMergeTrainOptions struct {
 	WhenPipelineSucceeds *bool   `url:"when_pipeline_succeeds,omitempty" json:"when_pipeline_succeeds,omitempty"`
 	SHA                  *string `url:"sha,omitempty" json:"sha,omitempty"`
-	Squash               *string `url:"squash,omitempty" json:"squash,omitempty"`
+	Squash               *bool   `url:"squash,omitempty" json:"squash,omitempty"`
 }
 
 // AddMergeRequestToMergeTrain Add a merge request to the merge train targeting


Test patch:
diff --git a/merge_trains_test.go b/merge_trains_test.go
index e1d61fa..fe4d997 100644
--- a/merge_trains_test.go
+++ b/merge_trains_test.go
@@ -225,7 +225,7 @@ func TestAddMergeRequestToMergeTrain(t *testing.T) {
 		mustWriteHTTPResponse(t, w, "testdata/add_merge_request_in_merge_train.json")
 	})
 
-	opt := &AddMergeRequestToMergeTrainOptions{WhenPipelineSucceeds: Bool(true)}
+	opt := &AddMergeRequestToMergeTrainOptions{WhenPipelineSucceeds: Bool(true), Squash: Bool(true)}
 
 	mergeTrains, _, err := client.MergeTrains.AddMergeRequestToMergeTrain(597, 1, opt)
 	if err != nil {