diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 82b088ccf0d..00000000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Deploy - -on: - workflow_dispatch: - inputs: - gitRef: - description: 'Commit, tag or branch name to deploy' - required: true - type: string - default: 'main' - environment: - description: 'Environment to deploy to' - required: true - type: choice - options: - - integration - - staging - - production - default: 'integration' - workflow_run: - workflows: [CI] - types: [completed] - branches: [main] - -jobs: - build-and-publish-image: - name: Build and publish image - if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' - uses: alphagov/govuk-infrastructure/.github/workflows/ci-ecr.yaml@main - with: - gitRef: ${{ github.event.inputs.gitRef || github.ref }} - secrets: - AWS_GOVUK_ECR_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }} - AWS_GOVUK_ECR_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }} - trigger-deploy: - name: Trigger deploy to ${{ github.event.inputs.environment }} - needs: build-and-publish-image - uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yaml@main - with: - imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }} - environment: ${{ github.event.inputs.environment }} - secrets: - WEBHOOK_TOKEN: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_TOKEN }} - WEBHOOK_URL: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_URL }} - GOVUK_CI_GITHUB_API_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }} diff --git a/.github/workflows/set-automatic-deploys-enabled.yaml b/.github/workflows/set-automatic-deploys-enabled.yaml deleted file mode 100644 index 217b0ecba86..00000000000 --- a/.github/workflows/set-automatic-deploys-enabled.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Set automatic_deploys_enabled (optionally image_tag too) - -on: - workflow_dispatch: - inputs: - resetImageTag: - description: 'Reset image tag to main' - required: false - default: false - type: boolean - automaticDeploysEnabled: - description: 'Activate automatic deploys' - required: false - default: true - type: boolean - environment: - description: 'Environment to deploy to' - required: true - type: choice - options: - - integration - - staging - - production - default: 'integration' - -jobs: - set_automatic_deploys_enabled: - name: Set automatic_deploys_enabled to ${{ github.event.inputs.environment }} - uses: alphagov/govuk-infrastructure/.github/workflows/set-automatic-deploys-enabled.yaml@main - with: - resetImageTag: ${{ github.event.inputs.resetImageTag == 'true' }} - automaticDeploysEnabled: ${{ github.event.inputs.automaticDeploysEnabled == 'true' }} - environment: ${{ github.event.inputs.environment }} - secrets: - WEBHOOK_TOKEN: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_TOKEN }} - WEBHOOK_URL: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_URL }} - GOVUK_CI_GITHUB_API_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }} diff --git a/Gemfile.lock b/Gemfile.lock index e6b645675c6..393ebdd6fe4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -400,7 +400,7 @@ GEM minitest-stub-const (0.6) mlanett-redis-lock (0.2.7) redis - mocha (1.15.0) + mocha (2.0.0.alpha.1) msgpack (1.5.6) multi_json (1.15.0) multi_test (1.1.0) diff --git a/app/services/asset_manager/asset_updater.rb b/app/services/asset_manager/asset_updater.rb index f1798d2769a..ff96dafd1fd 100644 --- a/app/services/asset_manager/asset_updater.rb +++ b/app/services/asset_manager/asset_updater.rb @@ -13,11 +13,11 @@ def initialize(attachment_data_id, legacy_url_path) end end - def self.call(*args) - new.call(*args) + def self.call(...) + new.call(...) end - def call(asset_data, legacy_url_path, new_attributes = {}) + def call(asset_data, legacy_url_path, **new_attributes) attributes = find_asset_by(legacy_url_path) asset_deleted = attributes["deleted"] diff --git a/app/services/asset_manager/attachment_updater/update.rb b/app/services/asset_manager/attachment_updater/update.rb index 2be39e4de56..941b2748981 100644 --- a/app/services/asset_manager/attachment_updater/update.rb +++ b/app/services/asset_manager/attachment_updater/update.rb @@ -15,7 +15,7 @@ def call AssetManager::AssetUpdater.call( attachment_data, legacy_url_path, - new_attributes.deep_stringify_keys, + **new_attributes.deep_stringify_keys, ) end diff --git a/test/test_helper.rb b/test/test_helper.rb index 6ad046e8377..6825976c2bb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -31,7 +31,6 @@ Whitehall::Application.load_tasks if Rake::Task.tasks.empty? Mocha.configure do |c| - c.reinstate_undocumented_behaviour_from_v1_9 = false c.stubbing_non_existent_method = :prevent end diff --git a/test/unit/services/asset_manager/asset_updater_test.rb b/test/unit/services/asset_manager/asset_updater_test.rb index 6ebad92d7ec..b3c92a0d8f1 100644 --- a/test/unit/services/asset_manager/asset_updater_test.rb +++ b/test/unit/services/asset_manager/asset_updater_test.rb @@ -117,7 +117,7 @@ class AssetManager::AssetUpdaterTest < ActiveSupport::TestCase .with(@asset_id, "replacement_id" => replacement_id) attributes = { "replacement_legacy_url_path" => replacement_legacy_url_path } - @worker.call(@attachment_data, @legacy_url_path, attributes) + @worker.call(@attachment_data, @legacy_url_path, **attributes) end test "does not mark asset as replaced if already replaced by same asset" do @@ -130,6 +130,6 @@ class AssetManager::AssetUpdaterTest < ActiveSupport::TestCase Services.asset_manager.expects(:update_asset).never attributes = { "replacement_legacy_url_path" => replacement_legacy_url_path } - @worker.call(@attachment_data, @legacy_url_path, attributes) + @worker.call(@attachment_data, @legacy_url_path, **attributes) end end