nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: amp-labs/connectors
Pull request #208 (2024-04-11 21:29:19)

[ENG-926] Update Salesforce catalog to support bulk delete.


Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index e1d30865..aa1db1c5 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -69,7 +69,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 				Insert: false,
 				Update: false,
 				Upsert: true,
-				Delete: false,
+				Delete: true,
 			},
 			Proxy:     true,
 			Read:      true,


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 4498b3e4..d1de3dbe 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -28,7 +28,7 @@ var testCases = []struct { // nolint
 					Insert: false,
 					Update: false,
 					Upsert: true,
-					Delete: false,
+					Delete: true,
 				},
 				Subscribe: false,
 				Proxy:     true,
Repository: amp-labs/connectors
Pull request #248 (2024-04-23 19:41:00)

enable proxy mode for webflow


Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index dd8f2ad5..e1e0bab9 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -1071,7 +1071,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 				Upsert: false,
 				Delete: false,
 			},
-			Proxy:     false,
+			Proxy:     true,
 			Read:      false,
 			Subscribe: false,
 			Write:     false,


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 8af37ea3..afb16542 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -1175,7 +1175,7 @@ var testCases = []struct { // nolint
 					Upsert: false,
 					Delete: false,
 				},
-				Proxy:     false,
+				Proxy:     true,
 				Read:      false,
 				Subscribe: false,
 				Write:     false,
Repository: amp-labs/connectors
Pull request #320 (2024-05-13 21:46:57)

fix: Remove client_id as a token metadata field from Gong connector
The OAuth token returned by Gong does not actually include a client_id field, which led to the following error:

![Screenshot 2024-05-13 at 2 41 26 PM](https://github.com/amp-labs/connectors/assets/3990804/bc0abd1b-2cdc-4dfb-a5df-29d1588d4004)



Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index 6134d175..90ea53ca 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -614,8 +614,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			ExplicitScopesRequired:    true,
 			ExplicitWorkspaceRequired: false,
 			TokenMetadataFields: TokenMetadataFields{
-				ScopesField:      "scope",
-				ConsumerRefField: "client_id",
+				ScopesField: "scope",
 			},
 		},
 		Support: Support{


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 8bed8eaf..2a89138d 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -671,8 +671,7 @@ var testCases = []struct { // nolint
 				ExplicitWorkspaceRequired: false,
 				ExplicitScopesRequired:    true,
 				TokenMetadataFields: TokenMetadataFields{
-					ScopesField:      "scope",
-					ConsumerRefField: "client_id",
+					ScopesField: "scope",
 				},
 			},
 			BaseURL: "https://api.gong.io",
Repository: amp-labs/connectors
Pull request #350 (2024-05-15 21:38:51)

[ENG-1141] Rename DynamicsCRM
Renamed the provider


Patch:
diff --git a/microsoftdynamicscrm/connector.go b/microsoftdynamicscrm/connector.go
index 82ee2d4b..78f0a3c2 100644
--- a/microsoftdynamicscrm/connector.go
+++ b/microsoftdynamicscrm/connector.go
@@ -33,7 +33,7 @@ func NewConnector(opts ...Option) (conn *Connector, outErr error) {
 		return nil, err
 	}
 
-	providerInfo, err := providers.ReadInfo(providers.MicrosoftDynamics365CRM, &map[string]string{
+	providerInfo, err := providers.ReadInfo(providers.DynamicsCRM, &map[string]string{
 		"workspace": params.Workspace.Name,
 	})
 	if err != nil {
@@ -60,7 +60,7 @@ func NewConnector(opts ...Option) (conn *Connector, outErr error) {
 }
 
 func (c *Connector) Provider() providers.Provider {
-	return providers.MicrosoftDynamics365CRM
+	return providers.DynamicsCRM
 }
 
 func (c *Connector) String() string {
diff --git a/providers/catalog.go b/providers/catalog.go
index bb1bab80..a919c45e 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -40,7 +40,7 @@ const (
 	Klaviyo                             Provider = "klaviyo"
 	LinkedIn                            Provider = "linkedIn"
 	MicrosoftDynamics365BusinessCentral Provider = "microsoftDynamics365BusinessCentral"
-	MicrosoftDynamics365CRM             Provider = "microsoftDynamics365CRM"
+	DynamicsCRM                         Provider = "dynamicsCRM"
 	Miro                                Provider = "miro"
 	Mock                                Provider = "mock"
 	Monday                              Provider = "monday"
@@ -831,7 +831,7 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 		},
 	},
 
-	MicrosoftDynamics365CRM: {
+	DynamicsCRM: {
 		DisplayName: "Microsoft Dynamics CRM",
 		AuthType:    Oauth2,
 		BaseURL:     "https://{{.workspace}}.api.crm.dynamics.com",


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 1662571b..f669e45b 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -904,7 +904,7 @@ var testCases = []struct { // nolint
 		expectedErr: nil,
 	},
 	{
-		provider:    MicrosoftDynamics365CRM,
+		provider:    DynamicsCRM,
 		description: "MS Dynamics 365 CRM provider config with valid substitutions",
 		substitutions: map[string]string{
 			"workspace": "testing",
Repository: amp-labs/connectors
Pull request #679 (2024-07-10 22:34:34)

fix: do not return error in ReadInfo if there are no substitution variables
Sometimes the server needs to read providerInfo without doing any variable substitutions (e.g. in GetProvider API call), we should not error out, otherwise the UI library will fail to work for providers that have substitution variables (such as Salesforce) because the UI library needs to call GetProvider first to see if it needs to render a workspace entry box. 


Patch:
diff --git a/providers/utils.go b/providers/utils.go
index 99128874..8c3afb37 100644
--- a/providers/utils.go
+++ b/providers/utils.go
@@ -113,7 +113,7 @@ func SetInfo(provider Provider, info ProviderInfo) {
 }
 
 // ReadInfo reads the information from the catalog for specific provider. It also performs string substitution
-// on the values in the config that are surrounded by {{}}.
+// on the values in the config that are surrounded by {{}}, if vars are provided.
 // The catalog variable will be applied such that `{{.VAR_NAME}}` string will be replaced with `VAR_VALUE`.
 func ReadInfo(provider Provider, vars ...paramsbuilder.CatalogVariable) (*ProviderInfo, error) {
 	return NewCustomCatalog().ReadInfo(provider, vars...)
@@ -130,6 +130,11 @@ func (c CustomCatalog) ReadInfo(provider Provider, vars ...paramsbuilder.Catalog
 		return nil, ErrProviderNotFound
 	}
 
+	// No substitution needed
+	if len(vars) == 0 {
+		return &pInfo, nil
+	}
+
 	// Clone before modifying
 	providerInfo, err := clone[ProviderInfo](pInfo)
 	if err != nil {


Test patch:
diff --git a/providers/utils_test.go b/providers/utils_test.go
index f1203678..197a5cc1 100644
--- a/providers/utils_test.go
+++ b/providers/utils_test.go
@@ -14,7 +14,7 @@ var (
 	testCatalog CatalogType = map[string]ProviderInfo{ // nolint:gochecknoglobals
 		"test": {
 			AuthType:    Oauth2,
-			Name:        "Tester Testerson",
+			Name:        "test",
 			BaseURL:     "https://{{.workspace}}.test.com",
 			DisplayName: "Super Test",
 		},
@@ -106,7 +106,7 @@ func TestReadInfo(t *testing.T) { // nolint:funlen
 		expectedErrs []error
 	}{
 		{
-			name: "Custom catalog has missing provider",
+			name: "Returns missing provider error",
 			input: inType{
 				options:  customTestCatalogOption,
 				provider: "nobody knows",
@@ -116,17 +116,22 @@ func TestReadInfo(t *testing.T) { // nolint:funlen
 			expectedErrs: []error{ErrProviderNotFound},
 		},
 		{
-			name: "Provider requires substitution",
+			name: "Works without substitution",
 			input: inType{
 				options:  customTestCatalogOption,
 				provider: "test",
 				vars:     nil,
 			},
-			expected:     nil,
-			expectedErrs: []error{ErrSubstitutionFailure},
+			expected: &ProviderInfo{
+				AuthType:    Oauth2,
+				Name:        "test",
+				BaseURL:     "https://{{.workspace}}.test.com",
+				DisplayName: "Super Test",
+			},
+			expectedErrs: nil,
 		},
 		{
-			name: "Provider requires substitution",
+			name: "Works with substitution",
 			input: inType{
 				options:  customTestCatalogOption,
 				provider: "test",