From 40c6ef00e25f86f165c6767475dd82c475e4eaac Mon Sep 17 00:00:00 2001 From: amalik Date: Thu, 29 May 2025 13:52:32 +0530 Subject: [PATCH 1/5] feat: Add Workflow Automation Destination and Channel types --- pkg/entities/types.go | 12 ++++++++++++ pkg/notifications/types.go | 8 ++++++++ pkg/workflows/types.go | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/pkg/entities/types.go b/pkg/entities/types.go index fc493f11e..b54b1d541 100644 --- a/pkg/entities/types.go +++ b/pkg/entities/types.go @@ -245,6 +245,8 @@ var AiNotificationsChannelTypeTypes = struct { SLACK_LEGACY AiNotificationsChannelType // Webhook channel type WEBHOOK AiNotificationsChannelType + // Workflow Automation channel type + WORKFLOW_AUTOMATION AiNotificationsChannelType }{ // Email channel type EMAIL: "EMAIL", @@ -276,6 +278,8 @@ var AiNotificationsChannelTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // Webhook channel type WEBHOOK: "WEBHOOK", + // Workflow Automation channel type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiNotificationsDestinationStatus - Destination statuses @@ -379,6 +383,8 @@ var AiNotificationsDestinationTypeTypes = struct { SLACK_LEGACY AiNotificationsDestinationType // WebHook destination type WEBHOOK AiNotificationsDestinationType + // Workflow Automation destination type + WORKFLOW_AUTOMATION AiNotificationsDestinationType }{ // Email destination type EMAIL: "EMAIL", @@ -406,6 +412,8 @@ var AiNotificationsDestinationTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // WebHook destination type WEBHOOK: "WEBHOOK", + // Workflow Automation destination type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiNotificationsProduct - Product types @@ -555,6 +563,8 @@ var AiWorkflowsDestinationTypeTypes = struct { SLACK_LEGACY AiWorkflowsDestinationType // Webhook Destination Configuration type WEBHOOK AiWorkflowsDestinationType + // Workflow Automation Destination Configuration type + WORKFLOW_AUTOMATION AiWorkflowsDestinationType }{ // Email Destination Configuration type EMAIL: "EMAIL", @@ -582,6 +592,8 @@ var AiWorkflowsDestinationTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // Webhook Destination Configuration type WEBHOOK: "WEBHOOK", + // Workflow Automation Destination Configuration type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiWorkflowsEnrichmentType - Type of Enrichment diff --git a/pkg/notifications/types.go b/pkg/notifications/types.go index 4e1c844db..147c2f06f 100644 --- a/pkg/notifications/types.go +++ b/pkg/notifications/types.go @@ -152,6 +152,8 @@ var AiNotificationsChannelTypeTypes = struct { SLACK_LEGACY AiNotificationsChannelType // Webhook channel type WEBHOOK AiNotificationsChannelType + // Workflow Automation channel type + WORKFLOW_AUTOMATION AiNotificationsChannelType }{ // Email channel type EMAIL: "EMAIL", @@ -183,6 +185,8 @@ var AiNotificationsChannelTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // Webhook channel type WEBHOOK: "WEBHOOK", + // Workflow Automation channel type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiNotificationsDestinationFields - Destination fields @@ -329,6 +333,8 @@ var AiNotificationsDestinationTypeTypes = struct { SLACK_LEGACY AiNotificationsDestinationType // WebHook destination type WEBHOOK AiNotificationsDestinationType + // Workflow Automation destination type + WORKFLOW_AUTOMATION AiNotificationsDestinationType }{ // Email destination type EMAIL: "EMAIL", @@ -356,6 +362,8 @@ var AiNotificationsDestinationTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // WebHook destination type WEBHOOK: "WEBHOOK", + // Workflow Automation destination type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiNotificationsErrorType - Error types diff --git a/pkg/workflows/types.go b/pkg/workflows/types.go index f4783dd7b..5419fbc11 100644 --- a/pkg/workflows/types.go +++ b/pkg/workflows/types.go @@ -97,6 +97,8 @@ var AiWorkflowsDestinationTypeTypes = struct { SLACK_LEGACY AiWorkflowsDestinationType // Webhook Destination Configuration type WEBHOOK AiWorkflowsDestinationType + // Workflow Automation Destination Configuration type + WORKFLOW_AUTOMATION AiWorkflowsDestinationType }{ // Email Destination Configuration type EMAIL: "EMAIL", @@ -124,6 +126,8 @@ var AiWorkflowsDestinationTypeTypes = struct { SLACK_LEGACY: "SLACK_LEGACY", // Webhook Destination Configuration type WEBHOOK: "WEBHOOK", + // Workflow Automation Destination Configuration type + WORKFLOW_AUTOMATION: "WORKFLOW_AUTOMATION", } // AiWorkflowsEnrichmentType - Type of Enrichment From 837a1386183e853f37733e379924f5efcdf37eb4 Mon Sep 17 00:00:00 2001 From: Pulipelly Shashank Reddy Date: Mon, 9 Jun 2025 14:37:37 +0530 Subject: [PATCH 2/5] fix: fixed a distributed tracing bug in the browser package (#1304) --- .../agentapplications_integration_test.go | 59 +++++++++++++++++-- pkg/agentapplications/types.go | 2 +- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/pkg/agentapplications/agentapplications_integration_test.go b/pkg/agentapplications/agentapplications_integration_test.go index 881c2ee7e..12ee7d493 100644 --- a/pkg/agentapplications/agentapplications_integration_test.go +++ b/pkg/agentapplications/agentapplications_integration_test.go @@ -46,7 +46,7 @@ func TestIntegrationAgentApplicationBrowser_Basic(t *testing.T) { require.True(t, deleteResult.Success) } -func TestIntegrationAgentApplicationBrowser_WithSettings(t *testing.T) { +func TestIntegrationAgentApplicationBrowser_EnableThenDisableSettings(t *testing.T) { t.Parallel() testAccountID, err := testhelpers.GetTestAccountID() @@ -57,9 +57,10 @@ func TestIntegrationAgentApplicationBrowser_WithSettings(t *testing.T) { client := newAgentApplicationIntegrationTestClient(t) appName := testhelpers.GenerateRandomName(10) cookiesEnabled := true + distributedTracingEnabled := true settings := AgentApplicationBrowserSettingsInput{ CookiesEnabled: &cookiesEnabled, - DistributedTracingEnabled: true, + DistributedTracingEnabled: &distributedTracingEnabled, LoaderType: AgentApplicationBrowserLoaderTypes.LITE, } @@ -93,6 +94,54 @@ func TestIntegrationAgentApplicationBrowser_WithSettings(t *testing.T) { require.True(t, deleteResult.Success) } +func TestIntegrationAgentApplicationBrowser_DisableThenEnableSettings(t *testing.T) { + t.Parallel() + + testAccountID, err := testhelpers.GetTestAccountID() + if err != nil { + t.Skipf("%s", err) + } + + client := newAgentApplicationIntegrationTestClient(t) + appName := testhelpers.GenerateRandomName(10) + cookiesEnabled := false + distributedTracingEnabled := false + settings := AgentApplicationBrowserSettingsInput{ + CookiesEnabled: &cookiesEnabled, + DistributedTracingEnabled: &distributedTracingEnabled, + LoaderType: AgentApplicationBrowserLoaderTypes.LITE, + } + + // Create + createResult, err := client.AgentApplicationCreateBrowser(testAccountID, appName, settings) + require.NoError(t, err) + require.NotNil(t, createResult) + require.Equal(t, appName, createResult.Name) + + cookiesEnabled = true + // Update + updateSettings := AgentApplicationSettingsUpdateInput{ + BrowserMonitoring: &AgentApplicationSettingsBrowserMonitoringInput{ + Loader: &AgentApplicationSettingsBrowserLoaderInputTypes.PRO, + DistributedTracing: &AgentApplicationSettingsBrowserDistributedTracingInput{ + Enabled: true, + }, + Privacy: &AgentApplicationSettingsBrowserPrivacyInput{ + CookiesEnabled: &cookiesEnabled, + }, + }, + } + updateResult, err := client.AgentApplicationSettingsUpdate(createResult.GUID, updateSettings) + require.NoError(t, err) + require.NotNil(t, updateResult) + + // Delete + deleteResult, err := client.AgentApplicationDelete(createResult.GUID) + require.NoError(t, err) + require.NotNil(t, deleteResult) + require.True(t, deleteResult.Success) +} + func TestIntegrationAgentApplicationBrowser_InvalidLoaderTypeInput(t *testing.T) { t.Parallel() @@ -104,9 +153,10 @@ func TestIntegrationAgentApplicationBrowser_InvalidLoaderTypeInput(t *testing.T) client := newAgentApplicationIntegrationTestClient(t) appName := testhelpers.GenerateRandomName(10) cookiesEnabled := true + distributedTracingEnabled := true settings := AgentApplicationBrowserSettingsInput{ CookiesEnabled: &cookiesEnabled, - DistributedTracingEnabled: true, + DistributedTracingEnabled: &distributedTracingEnabled, LoaderType: AgentApplicationBrowserLoader("INVALID"), } @@ -132,10 +182,11 @@ func TestIntegrationAgentApplicationEnableAPMBrowser_WithSettings(t *testing.T) t.Parallel() cookiesEnabled := true + distributedTracingEnabled := true client := newAgentApplicationIntegrationTestClient(t) settings := AgentApplicationBrowserSettingsInput{ CookiesEnabled: &cookiesEnabled, - DistributedTracingEnabled: true, + DistributedTracingEnabled: &distributedTracingEnabled, LoaderType: AgentApplicationBrowserLoaderTypes.PRO, } diff --git a/pkg/agentapplications/types.go b/pkg/agentapplications/types.go index 1bf0f34c9..b6d2c8e15 100644 --- a/pkg/agentapplications/types.go +++ b/pkg/agentapplications/types.go @@ -233,7 +233,7 @@ type AgentApplicationBrowserSettingsInput struct { // Configure cookies. The default is enabled: true. CookiesEnabled *bool `json:"cookiesEnabled,omitempty"` // Configure distributed tracing in browser apps. The default is enabled: true. - DistributedTracingEnabled bool `json:"distributedTracingEnabled,omitempty"` + DistributedTracingEnabled *bool `json:"distributedTracingEnabled,omitempty"` // Determines which browser loader is configured. The default is "SPA". LoaderType AgentApplicationBrowserLoader `json:"loaderType,omitempty"` } From caf698f609f2757998dd4d21eec1cf12e485902a Mon Sep 17 00:00:00 2001 From: nr-developer-toolkit <62031461+nr-developer-toolkit@users.noreply.github.com> Date: Mon, 9 Jun 2025 09:20:30 +0000 Subject: [PATCH 3/5] chore(release): release v2.61.2 --- CHANGELOG.md | 9 ++++++++- internal/version/version.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c07f2842..ca24c2664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + +## [v2.61.2] - 2025-06-09 +### Bug Fixes +- fixed a distributed tracing bug in the browser package ([#1304](https://github.com/newrelic/newrelic-client-go/issues/1304)) +- **build:** add PR checks similar to Terraform, fix failing tests, broken code and obsolete deps ([#1295](https://github.com/newrelic/newrelic-client-go/issues/1295)) + ## [v2.61.1] - 2025-05-26 ### Bug Fixes @@ -2043,7 +2049,8 @@ - extract paging implementation - rename packages for clarity, promote Config to the public package -[Unreleased]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.1...HEAD +[Unreleased]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.2...HEAD +[v2.61.2]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.1...v2.61.2 [v2.61.1]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.0...v2.61.1 [v2.61.0]: https://github.com/newrelic/newrelic-client-go/compare/v2.60.0...v2.61.0 [v2.60.0]: https://github.com/newrelic/newrelic-client-go/compare/v2.59.0...v2.60.0 diff --git a/internal/version/version.go b/internal/version/version.go index 27227af50..27b5f6ff3 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -1,4 +1,4 @@ package version // Version of this library -const Version string = "2.61.1" +const Version string = "2.61.2" From e4b94c9aa6668de7fec9ac64bdca23eb26a60565 Mon Sep 17 00:00:00 2001 From: pchawla-NR Date: Fri, 13 Jun 2025 14:06:32 +0530 Subject: [PATCH 4/5] feat(cloud): added auto-discovery slug to cloud configure integration api (#1307) --- pkg/cloud/cloud_api.go | 24 ++++++++++++++++++++ pkg/cloud/types.go | 50 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/pkg/cloud/cloud_api.go b/pkg/cloud/cloud_api.go index 18ddf543a..f67e96747 100644 --- a/pkg/cloud/cloud_api.go +++ b/pkg/cloud/cloud_api.go @@ -236,6 +236,12 @@ const CloudConfigureIntegrationMutation = `mutation( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsAutoDiscoveryIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAzureApimanagementIntegration { __typename inventoryPollingInterval @@ -1027,6 +1033,12 @@ const CloudDisableIntegrationMutation = `mutation( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsAutoDiscoveryIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAzureApimanagementIntegration { __typename inventoryPollingInterval @@ -2100,6 +2112,12 @@ const getLinkedAccountQuery = `query( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsAutoDiscoveryIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAzureApimanagementIntegration { __typename inventoryPollingInterval @@ -2949,6 +2967,12 @@ const getLinkedAccountsQuery = `query( inventoryPollingInterval metricsPollingInterval } + ... on CloudAwsAutoDiscoveryIntegration { + __typename + awsRegions + inventoryPollingInterval + metricsPollingInterval + } ... on CloudAzureApimanagementIntegration { __typename inventoryPollingInterval diff --git a/pkg/cloud/types.go b/pkg/cloud/types.go index afd4da063..c8ee04bfd 100644 --- a/pkg/cloud/types.go +++ b/pkg/cloud/types.go @@ -471,6 +471,8 @@ type CloudAwsDisableIntegrationsInput struct { AwsWafv2 []CloudDisableAccountIntegrationInput `json:"awsWafv2,omitempty"` // X-Ray integration AwsXray []CloudDisableAccountIntegrationInput `json:"awsXray,omitempty"` + // Auto Discovery integration + AwsAutoDiscovery []CloudDisableAccountIntegrationInput `json:"awsAutoDiscovery,omitempty"` // Billing integration Billing []CloudDisableAccountIntegrationInput `json:"billing,omitempty"` // CloudFront integration @@ -843,6 +845,8 @@ type CloudAwsIntegrationsInput struct { AwsWafv2 []CloudAwsWafv2IntegrationInput `json:"awsWafv2,omitempty"` // X-Ray integration AwsXray []CloudAwsXrayIntegrationInput `json:"awsXray,omitempty"` + // Aws Auto Discovery Integration + AwsAutoDiscovery []CloudAwsAutoDiscoveryIntegrationInput `json:"awsAutoDiscovery,omitempty"` // Billing integration Billing []CloudBillingIntegrationInput `json:"billing,omitempty"` // CloudFront integration @@ -1547,6 +1551,44 @@ type CloudAwsXrayIntegrationInput struct { MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` } +// CloudAwsAutoDiscoveryIntegration - Aws Auto Discovery Integration +type CloudAwsAutoDiscoveryIntegration struct { + // Specify each AWS region that includes the resources that you want to monitor. + AwsRegions []string `json:"awsRegions,omitempty"` + // The object creation date, in epoch (Unix) time + CreatedAt nrtime.EpochSeconds `json:"createdAt"` + // The cloud service integration identifier. + ID int `json:"id,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The parent linked account identifier. + LinkedAccount CloudLinkedAccount `json:"linkedAccount,omitempty"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` + // The cloud service integration name. + Name string `json:"name,omitempty"` + // The parent NewRelic account identifier. + NrAccountId int `json:"nrAccountId"` + // The cloud service used in the integration. + Service CloudService `json:"service,omitempty"` + // The object last update date, in epoch (Unix) time + UpdatedAt nrtime.EpochSeconds `json:"updatedAt"` +} + +func (x *CloudAwsAutoDiscoveryIntegration) ImplementsCloudIntegration() {} + +// CloudAwsAutoDiscoveryIntegrationInput - AWS Auto Discovery Integration +type CloudAwsAutoDiscoveryIntegrationInput struct { + // Specify each AWS region that includes the resources that you want to monitor. + AwsRegions []string `json:"awsRegions,omitempty"` + // [DEPRECATED] Multiple polling interval is no longer supported, use only metrics_polling_interval + InventoryPollingInterval int `json:"inventoryPollingInterval,omitempty"` + // The linked account identifier. + LinkedAccountId int `json:"linkedAccountId"` + // The data polling interval in seconds. + MetricsPollingInterval int `json:"metricsPollingInterval,omitempty"` +} + // CloudAzureAPImanagementIntegration - Api Management Integration type CloudAzureAPImanagementIntegration struct { // The object creation date, in epoch (Unix) time @@ -6254,6 +6296,14 @@ func UnmarshalCloudIntegrationInterface(b []byte) (*CloudIntegrationInterface, e var xxx CloudIntegrationInterface = &interfaceType + return &xxx, nil + case "CloudAwsAutoDiscoveryIntegration": + var interfaceType CloudAwsAutoDiscoveryIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + var xxx CloudIntegrationInterface = &interfaceType return &xxx, nil case "CloudAzureApimanagementIntegration": var interfaceType CloudAzureAPImanagementIntegration From be59a5173bee0114a491b1ce1a09205f5dab2d70 Mon Sep 17 00:00:00 2001 From: nr-developer-toolkit <62031461+nr-developer-toolkit@users.noreply.github.com> Date: Fri, 13 Jun 2025 08:38:14 +0000 Subject: [PATCH 5/5] chore(release): release v2.62.0 --- CHANGELOG.md | 8 +++++++- internal/version/version.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca24c2664..f5cca22bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +## [v2.62.0] - 2025-06-13 +### Features +- **cloud:** added auto-discovery slug to cloud configure integration api ([#1307](https://github.com/newrelic/newrelic-client-go/issues/1307)) + ## [v2.61.2] - 2025-06-09 ### Bug Fixes @@ -2049,7 +2054,8 @@ - extract paging implementation - rename packages for clarity, promote Config to the public package -[Unreleased]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.2...HEAD +[Unreleased]: https://github.com/newrelic/newrelic-client-go/compare/v2.62.0...HEAD +[v2.62.0]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.2...v2.62.0 [v2.61.2]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.1...v2.61.2 [v2.61.1]: https://github.com/newrelic/newrelic-client-go/compare/v2.61.0...v2.61.1 [v2.61.0]: https://github.com/newrelic/newrelic-client-go/compare/v2.60.0...v2.61.0 diff --git a/internal/version/version.go b/internal/version/version.go index 27b5f6ff3..fa609c4e4 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -1,4 +1,4 @@ package version // Version of this library -const Version string = "2.61.2" +const Version string = "2.62.0"