From 5033f18896180e46c8aa21f2a69a616a83098e87 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Sun, 7 Apr 2024 15:36:15 -0500 Subject: [PATCH] Fixes #1526 - If provider connection string is specified use it. (#1540) * Fixes #1526 - If provider connection string is specified use it. * Attempt to fix the pr branch builds * Attempt to fix the build workflow * make sure the finished build status runs * Removed finished * Update build.yaml * Updates to build workflow * Update build.yaml --------- Co-authored-by: Eric J. Smith --- .github/workflows/build.yaml | 17 ++++++++++------- .../Configuration/MessageBusOptions.cs | 5 +---- .../Configuration/MetricOptions.cs | 5 +---- .../Configuration/QueueOptions.cs | 5 +---- .../Configuration/StorageOptions.cs | 5 +---- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2a4f3363a4..a37756dfbf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,10 @@ name: Build -on: [push, pull_request] + +on: + push: + branches: [main] + pull_request: + env: TERM: xterm DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true @@ -144,7 +149,7 @@ jobs: - name: Run Integration Tests run: echo "npm run test:integration" - build-docker: + build-and-push-docker: runs-on: ubuntu-latest needs: [version] @@ -206,7 +211,7 @@ jobs: username: ${{ env.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Wait for test jobs + - name: Wait for test jobs # doing it this way so we don't have to copy artifacts between jobs uses: yogeshlonkar/wait-for-jobs@v0 with: jobs: 'test-api,test-client' @@ -245,7 +250,7 @@ jobs: deploy: if: "${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.event_name != 'pull_request' }}" - needs: [version,build-docker] + needs: [version,build-and-push-docker] runs-on: ubuntu-latest timeout-minutes: 30 env: @@ -260,9 +265,7 @@ jobs: - name: Install Helm if: "${{ env.DOCKER_USERNAME != '' && github.event_name != 'pull_request' }}" - uses: azure/setup-helm@v3 - with: - version: v3.13.0 + uses: azure/setup-helm@v4 - name: Deploy Changes to Development Environment if: "${{ env.DOCKER_USERNAME != '' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}" diff --git a/src/Exceptionless.Core/Configuration/MessageBusOptions.cs b/src/Exceptionless.Core/Configuration/MessageBusOptions.cs index b69407028f..4dc00110b1 100644 --- a/src/Exceptionless.Core/Configuration/MessageBusOptions.cs +++ b/src/Exceptionless.Core/Configuration/MessageBusOptions.cs @@ -26,10 +26,7 @@ public static MessageBusOptions ReadFromConfiguration(IConfiguration config, App options.Provider = options.Data.GetString(nameof(options.Provider)); string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null; - if (!String.IsNullOrEmpty(providerConnectionString)) - options.Data.AddRange(providerConnectionString.ParseConnectionString()); - - options.ConnectionString = options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); + options.ConnectionString = !String.IsNullOrEmpty(providerConnectionString) ? providerConnectionString : options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); return options; } diff --git a/src/Exceptionless.Core/Configuration/MetricOptions.cs b/src/Exceptionless.Core/Configuration/MetricOptions.cs index d3875b5c19..390cc328e6 100644 --- a/src/Exceptionless.Core/Configuration/MetricOptions.cs +++ b/src/Exceptionless.Core/Configuration/MetricOptions.cs @@ -20,10 +20,7 @@ public static MetricOptions ReadFromConfiguration(IConfiguration config) options.Provider = options.Data.GetString(nameof(options.Provider)); string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null; - if (!String.IsNullOrEmpty(providerConnectionString)) - options.Data.AddRange(providerConnectionString.ParseConnectionString()); - - options.ConnectionString = options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); + options.ConnectionString = !String.IsNullOrEmpty(providerConnectionString) ? providerConnectionString : options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); return options; } diff --git a/src/Exceptionless.Core/Configuration/QueueOptions.cs b/src/Exceptionless.Core/Configuration/QueueOptions.cs index 9ab058ca66..e24ff43a27 100644 --- a/src/Exceptionless.Core/Configuration/QueueOptions.cs +++ b/src/Exceptionless.Core/Configuration/QueueOptions.cs @@ -24,10 +24,7 @@ public static QueueOptions ReadFromConfiguration(IConfiguration config, AppOptio options.Provider = options.Data.GetString(nameof(options.Provider)); string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null; - if (!String.IsNullOrEmpty(providerConnectionString)) - options.Data.AddRange(providerConnectionString.ParseConnectionString()); - - options.ConnectionString = options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); + options.ConnectionString = !String.IsNullOrEmpty(providerConnectionString) ? providerConnectionString : options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); return options; } diff --git a/src/Exceptionless.Core/Configuration/StorageOptions.cs b/src/Exceptionless.Core/Configuration/StorageOptions.cs index 2c114e973d..4a082c742a 100644 --- a/src/Exceptionless.Core/Configuration/StorageOptions.cs +++ b/src/Exceptionless.Core/Configuration/StorageOptions.cs @@ -26,10 +26,7 @@ public static StorageOptions ReadFromConfiguration(IConfiguration config, AppOpt options.Provider = options.Data.GetString(nameof(options.Provider)); string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null; - if (!String.IsNullOrEmpty(providerConnectionString)) - options.Data.AddRange(providerConnectionString.ParseConnectionString()); - - options.ConnectionString = options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); + options.ConnectionString = !String.IsNullOrEmpty(providerConnectionString) ? providerConnectionString : options.Data.BuildConnectionString(new HashSet { nameof(options.Provider) }); return options; }