nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: google/go-github
Pull request #977 (2018-08-14 15:37:24)

Fixes wrong Accept media type that was causing a 500
https://developer.github.com/v3/issues/#list-issues-for-a-repository
lists
- application/vnd.github.symmetra-preview+json
- application/vnd.github.squirrel-girl-preview
- application/vnd.github.machine-man-preview

which map to

- mediaTypeLabelDescriptionSearchPreview
- mediaTypeReactionsPreview
- mediaTypeIntegrationPreview

gmlewis: Thank you, @phylake! Could you please also update the corresponding test?

This PR generates the Travis CI failure:

```
	github_test.go:115: Header.Get("Accept") returned "application/vnd.github.squirrel-girl-preview, application/vnd.github.symmetra-preview+json, application/vnd.github.machine-man-preview+json", want "application/vnd.github.squirrel-girl-preview, application/vnd.github.symmetra-preview+json, application/vnd.github.sailor-v-preview+json"
```

If you run `go test ./...` locally, you should see the problem.

phylake: I think Travis CI failed to update the status check. It all looks green to me. What should I do?
gmlewis: I restarted the build... Let's see if that fixes it.
gmlewis: That seems to have worked.
gmlewis: It looks like this was mistakenly changed in #910.
Thank you for catching and fixing this, @phylake!
LGTM.
Merging.

Patch:
diff --git a/github/issues.go b/github/issues.go
index 47537544..1e0991ce 100644
--- a/github/issues.go
+++ b/github/issues.go
@@ -228,7 +228,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin
 	}
 
 	// TODO: remove custom Accept headers when APIs fully launch.
-	acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview}
+	acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeIntegrationPreview}
 	req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
 
 	var issues []*Issue


Test patch:
diff --git a/github/issues_test.go b/github/issues_test.go
index d6fe9f3f..22190a02 100644
--- a/github/issues_test.go
+++ b/github/issues_test.go
@@ -109,7 +109,7 @@ func TestIssuesService_ListByRepo(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 
-	acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeLockReasonPreview}
+	acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeLabelDescriptionSearchPreview, mediaTypeIntegrationPreview}
 	mux.HandleFunc("/repos/o/r/issues", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "GET")
 		testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
Repository: google/go-github
Pull request #1096 (2019-01-12 00:40:09)

Fix API endpoints for add and remove repo for installation
Fixes https://github.com/google/go-github/issues/1095

gmlewis: Thank you, @gauntface!
Merging.

Patch:
diff --git a/github/apps_installation.go b/github/apps_installation.go
index ccfecb8d..09d4043f 100644
--- a/github/apps_installation.go
+++ b/github/apps_installation.go
@@ -72,11 +72,12 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opt *ListOpti
 //
 // GitHub API docs: https://developer.github.com/v3/apps/installations/#add-repository-to-installation
 func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) {
-	u := fmt.Sprintf("apps/installations/%v/repositories/%v", instID, repoID)
+	u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID)
 	req, err := s.client.NewRequest("PUT", u, nil)
 	if err != nil {
 		return nil, nil, err
 	}
+	req.Header.Set("Accept", mediaTypeIntegrationPreview)
 
 	r := new(Repository)
 	resp, err := s.client.Do(ctx, req, r)
@@ -91,11 +92,12 @@ func (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (
 //
 // GitHub docs: https://developer.github.com/v3/apps/installations/#remove-repository-from-installation
 func (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) {
-	u := fmt.Sprintf("apps/installations/%v/repositories/%v", instID, repoID)
+	u := fmt.Sprintf("user/installations/%v/repositories/%v", instID, repoID)
 	req, err := s.client.NewRequest("DELETE", u, nil)
 	if err != nil {
 		return nil, err
 	}
+	req.Header.Set("Accept", mediaTypeIntegrationPreview)
 
 	return s.client.Do(ctx, req, nil)
 }


Test patch:
diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go
index 01358c00..745e1e5d 100644
--- a/github/apps_installation_test.go
+++ b/github/apps_installation_test.go
@@ -69,8 +69,9 @@ func TestAppsService_AddRepository(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 
-	mux.HandleFunc("/apps/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) {
+	mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "PUT")
+		testHeader(t, r, "Accept", mediaTypeIntegrationPreview)
 		fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"}}`)
 	})
 
@@ -89,8 +90,9 @@ func TestAppsService_RemoveRepository(t *testing.T) {
 	client, mux, _, teardown := setup()
 	defer teardown()
 
-	mux.HandleFunc("/apps/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) {
+	mux.HandleFunc("/user/installations/1/repositories/1", func(w http.ResponseWriter, r *http.Request) {
 		testMethod(t, r, "DELETE")
+		testHeader(t, r, "Accept", mediaTypeIntegrationPreview)
 		w.WriteHeader(http.StatusNoContent)
 	})
Repository: google/go-github
Pull request #1130 (2019-03-07 02:46:45)

Fix org webhook creation
Hello! This is fixing exactly what #1117 fixed but for org hooks too. The discussion on that PR implies that this only affects GitHub Enterprise but I've been experiencing issues with this in plain ol' GitHub. I suspect this has something to do with this deprecation timeline taking effect at the end of January: https://developer.github.com/v3/guides/replacing-github-services/#deprecation-timeline




Patch:
diff --git a/github/orgs_hooks.go b/github/orgs_hooks.go
index b710ea40..5357eb87 100644
--- a/github/orgs_hooks.go
+++ b/github/orgs_hooks.go
@@ -59,6 +59,7 @@ func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook
 	u := fmt.Sprintf("orgs/%v/hooks", org)
 
 	hookReq := &createHookRequest{
+		Name:   "web",
 		Events: hook.Events,
 		Active: hook.Active,
 		Config: hook.Config,


Test patch:
diff --git a/github/orgs_hooks_test.go b/github/orgs_hooks_test.go
index 50caee89..5ed2e165 100644
--- a/github/orgs_hooks_test.go
+++ b/github/orgs_hooks_test.go
@@ -56,7 +56,7 @@ func TestOrganizationsService_CreateHook(t *testing.T) {
 		json.NewDecoder(r.Body).Decode(v)
 
 		testMethod(t, r, "POST")
-		want := &createHookRequest{}
+		want := &createHookRequest{Name: "web"}
 		if !reflect.DeepEqual(v, want) {
 			t.Errorf("Request body = %+v, want %+v", v, want)
 		}