diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 3f898e388c..249c8c3922 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -9,6 +9,10 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: true + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' + type: string + required: false test_group: description: 'Test group to run, e.g. advanced_cluster, empty for all' type: string @@ -103,13 +107,30 @@ env: TF_ACC: 1 TF_LOG: ${{ vars.LOG_LEVEL }} ACCTEST_TIMEOUT: ${{ vars.ACCTEST_TIMEOUT }} - ACCTEST_REGEX_RUN: "^TestAcc" + # Only Migration tests are run when testing a specific previous provider version instead of the latest one + ACCTEST_REGEX_RUN: ${{ inputs.provider_version == '' && '^Test(Acc|Mig)' || '^TestMig' }} MONGODB_ATLAS_BASE_URL: ${{ inputs.mongodb_atlas_base_url }} MONGODB_ATLAS_ORG_ID: ${{ inputs.mongodb_atlas_org_id }} MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.mongodb_atlas_public_key }} MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.mongodb_atlas_private_key }} jobs: + + get-provider-version: + runs-on: ubuntu-latest + outputs: + provider_version: ${{ inputs.provider_version || steps.get_last_release.outputs.last_provider_version }} + steps: + - name: Checkout + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 + - name: Get Last Release + id: get_last_release + shell: bash + run: | + LAST_RELEASE=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/terraform-provider-mongodbatlas/releases/latest | jq -r '.tag_name | ltrimstr("v")') + echo "Last release: $LAST_RELEASE" + echo "last_provider_version=${LAST_RELEASE}" >> "${GITHUB_OUTPUT}" + change-detection: runs-on: ubuntu-latest env: @@ -215,7 +236,7 @@ jobs: - 'internal/service/encryptionatrest/*.go' cluster_outage_simulation: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.cluster_outage_simulation == 'true' || inputs.test_group == 'cluster_outage_simulation' }} runs-on: ubuntu-latest steps: @@ -231,11 +252,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/clusteroutagesimulation run: make testacc advanced_cluster: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.advanced_cluster == 'true' || inputs.test_group == 'advanced_cluster' }} runs-on: ubuntu-latest steps: @@ -251,11 +273,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/advancedcluster run: make testacc cluster: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.cluster == 'true' || inputs.test_group == 'cluster' }} runs-on: ubuntu-latest steps: @@ -271,13 +294,14 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/cluster ./internal/service/globalclusterconfig run: make testacc search_deployment: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.search_deployment == 'true' || inputs.test_group == 'search_deployment' }} runs-on: ubuntu-latest steps: @@ -293,11 +317,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/searchdeployment run: make testacc stream: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.stream == 'true' || inputs.test_group == 'stream' }} runs-on: ubuntu-latest steps: @@ -314,13 +339,14 @@ jobs: - name: Acceptance Tests env: MONGODB_ATLAS_ENABLE_PREVIEW: "true" + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/streaminstance ./internal/service/streamconnection run: make testacc generic: # Acceptance tests that do not use any time-consuming resource (example: cluster) - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }} runs-on: ubuntu-latest steps: @@ -338,13 +364,14 @@ jobs: env: MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ inputs.mongodb_atlas_project_owner_id }} CA_CERT: ${{ secrets.ca_cert }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/backupcompliancepolicy ./internal/service/auditing ./internal/service/x509authenticationdatabaseuser run: make testacc backup: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.backup == 'true' || inputs.test_group == 'backup' }} runs-on: ubuntu-latest steps: @@ -361,6 +388,7 @@ jobs: - name: Acceptance Tests env: MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ inputs.mongodb_atlas_project_owner_id }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/onlinearchive ./internal/service/cloudbackupschedule @@ -370,7 +398,7 @@ jobs: ./internal/service/cloudbackupsnapshotrestorejob run: make testacc project: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.project == 'true' || inputs.test_group == 'project' }} runs-on: ubuntu-latest steps: @@ -396,6 +424,7 @@ jobs: AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/project ./internal/service/projectipaccesslist @@ -403,7 +432,7 @@ jobs: ./internal/service/projectinvitation run: make testacc serverless: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.serverless == 'true' || inputs.test_group == 'serverless' }} runs-on: ubuntu-latest steps: @@ -421,13 +450,14 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/serverlessinstance ./internal/service/privatelinkendpointserverless ./internal/service/privatelinkendpointserviceserverless run: make testacc network: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.network == 'true' || inputs.test_group == 'network' }} runs-on: ubuntu-latest steps: @@ -453,6 +483,7 @@ jobs: AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/networkcontainer ./internal/service/networkpeering @@ -462,7 +493,7 @@ jobs: ./internal/service/privatelinkendpointservicedatafederationonlinearchive run: make testacc config: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.config == 'true' || inputs.test_group == 'config' }} runs-on: ubuntu-latest steps: @@ -486,6 +517,7 @@ jobs: AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }} AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/alertconfiguration ./internal/service/atlasuser @@ -504,7 +536,7 @@ jobs: run: make testacc assume_role: - needs: [ change-detection] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.assume_role == 'true' || inputs.test_group == 'assume_role' }} runs-on: ubuntu-latest steps: @@ -538,11 +570,12 @@ jobs: AWS_ACCESS_KEY_ID: ${{ steps.sts-assume-role.outputs.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ steps.sts-assume-role.outputs.aws_secret_access_key }} AWS_SESSION_TOKEN: ${{ steps.sts-assume-role.outputs.AWS_SESSION_TOKEN }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/provider run: make testacc search_index: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.search_index == 'true' || inputs.test_group == 'search_index' }} runs-on: ubuntu-latest steps: @@ -558,11 +591,12 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/searchindex run: make testacc federated: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.federated == 'true' || inputs.test_group == 'federated' }} runs-on: ubuntu-latest steps: @@ -589,6 +623,7 @@ jobs: AWS_REGION: ${{ vars.aws_region_federation }} AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/federatedsettingsidentityprovider ./internal/service/federateddatabaseinstance @@ -597,7 +632,7 @@ jobs: ./internal/service/federatedquerylimit run: make testacc data_lake: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.data_lake == 'true' || inputs.test_group == 'data_lake' }} runs-on: ubuntu-latest steps: @@ -613,10 +648,11 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/datalakepipeline run: make testacc ldap: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.ldap == 'true' || inputs.test_group == 'ldap' }} runs-on: ubuntu-latest steps: @@ -637,12 +673,13 @@ jobs: MONGODB_ATLAS_LDAP_PASSWORD: ${{ secrets.mongodb_atlas_ldap_password }} MONGODB_ATLAS_LDAP_PORT: ${{ secrets.mongodb_atlas_ldap_port }} MONGODB_ATLAS_LDAP_CA_CERTIFICATE: ${{ secrets.mongodb_atlas_ldap_ca_certificate }} + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: | ./internal/service/ldapconfiguration ./internal/service/ldapverify run: make testacc encryption: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.encryption == 'true' || inputs.test_group == 'encryption' }} runs-on: ubuntu-latest steps: @@ -658,10 +695,11 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/encryptionatrest run: make testacc event_trigger: - needs: [ change-detection ] + needs: [ change-detection, get-provider-version ] if: ${{ needs.change-detection.outputs.event_trigger == 'true' || inputs.test_group == 'event_trigger' }} runs-on: ubuntu-latest steps: @@ -677,5 +715,6 @@ jobs: terraform_wrapper: false - name: Acceptance Tests env: + MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} ACCTEST_PACKAGES: ./internal/service/eventtrigger run: make testacc diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index be780f6a61..6791e915fb 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -9,6 +9,10 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: false + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' + type: string + required: false atlas_cloud_env: description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`' type: string @@ -27,19 +31,22 @@ on: description: 'Terraform version to use, e.g. 1.6.x, empty for latest' type: string required: false - ref: - description: 'The branch, tag or SHA where tests will run, e.g. v1.14.0, empty for default branch' + provider_version: + description: 'Previous MongoDB Atlas Provider version to use in Migration tests, e.g. 1.14.0, empty for latest' type: string - required: false + required: false atlas_cloud_env: description: 'Atlas cloud environment used, can be either `dev` or `qa`, empty for `dev`' type: string required: false - - + ref: + description: 'The branch, tag or SHA where tests will run, e.g. v1.14.0, empty for default branch' + type: string + required: false + jobs: - acc-tests: - name: acc-tests-${{ inputs.terraform_version || 'latest' }}-${{ inputs.atlas_cloud_env || 'dev' }} + tests: + name: tests-${{ inputs.terraform_version || 'latest' }}-${{ inputs.provider_version || 'latest' }}-${{ inputs.atlas_cloud_env || 'dev' }} uses: ./.github/workflows/acceptance-tests-runner.yml secrets: mongodb_atlas_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_QA || secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }} @@ -59,6 +66,7 @@ jobs: with: terraform_version: ${{ inputs.terraform_version || vars.TF_VERSION_LATEST }} + provider_version: ${{ inputs.provider_version }} ref: ${{ inputs.ref }} test_group: ${{ inputs.test_group }} aws_region_federation: ${{ vars.AWS_REGION_FEDERATION }} diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index 88a63128d2..34b66b757a 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -70,8 +70,3 @@ jobs: needs: [build, lint, shellcheck, unit-test, website-lint] secrets: inherit uses: ./.github/workflows/acceptance-tests.yml - call-migration-tests-workflow: - needs: [build, lint, shellcheck, unit-test, website-lint] - secrets: inherit - uses: ./.github/workflows/migration-tests.yml - diff --git a/.github/workflows/generate-changelog.yml b/.github/workflows/generate-changelog.yml index daed041168..46c8488470 100644 --- a/.github/workflows/generate-changelog.yml +++ b/.github/workflows/generate-changelog.yml @@ -7,69 +7,16 @@ on: - .changelog/** workflow_dispatch: jobs: - generate-changelog: + generate-and-update-changelog: if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - run: make tools update-changelog-unreleased-section - - run: | - if [[ $(git status --porcelain) ]]; then - if ${{github.event_name == 'workflow_dispatch'}}; then - MSG="Update CHANGELOG.md (Manual Trigger)" - else - MSG="Update CHANGELOG.md for #${{ github.event.pull_request.number }}" - fi - git config --local user.email changelogbot@mongodb.com - git config --local user.name changelogbot - git remote set-url origin https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} - git add CHANGELOG.md - git commit -m "$MSG" - git push - fi - - slack-notification: - needs: [generate-changelog] - if: ${{ !cancelled() && needs.generate-changelog.result == 'failure' }} - runs-on: ubuntu-latest - steps: - - name: Send Slack message - id: slack - uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 - with: - payload: | - { - "text": "Automatic Changelog update failed", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Automatic Changelog update failed* ${{ secrets.SLACK_ONCALL_TAG }}" - } - }, - { - "type": "actions", - "elements": [ - { - "type": "button", - "text": { - "type": "plain_text", - "text": ":github: Failed action" - }, - "url": "${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}" - } - ] - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + uses: ./.github/workflows/run-script-and-commit.yml + with: + script_call: 'make tools update-changelog-unreleased-section' + file_to_commit: 'CHANGELOG.md' + commit_message: ${{ github.event_name == 'workflow_dispatch' && 'Update CHANGELOG.md (Manual Trigger)' || format('{0}{1}', 'Update CHANGELOG.md for \#', github.event.pull_request.number) }} + secrets: + remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} + gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} + \ No newline at end of file diff --git a/.github/workflows/migration-tests.yml b/.github/workflows/migration-tests.yml deleted file mode 100644 index cd1be24ea1..0000000000 --- a/.github/workflows/migration-tests.yml +++ /dev/null @@ -1,582 +0,0 @@ -name: 'Migration Tests' - -# Used for running migration tests, either triggered manually or called by other workflows. -on: - workflow_dispatch: - inputs: - terraform_version: - description: 'Terraform version to use, e.g. 1.6.x, empty for latest' - type: string - required: false - provider_version: - description: 'Previous MongoDB Atlas Provider version to use, e.g. 1.14.0, empty for latest' - type: string - required: false - test_group: - description: 'Test group to run, e.g. advanced_cluster, empty for all' - type: string - required: false - workflow_call: # workflow runs after Test Suite or code-health - inputs: - terraform_version: - description: 'Terraform version to use, e.g. 1.6.x, empty for latest' - type: string - required: false - provider_version: - description: 'Previous MongoDB Atlas Provider version to use, e.g. 1.14.0, empty for latest' - type: string - required: false - -env: - terraform_version: ${{ inputs.terraform_version || vars.TF_VERSION_LATEST }} - TF_ACC: 1 - TF_LOG: ${{ vars.LOG_LEVEL }} - ACCTEST_TIMEOUT: ${{ vars.ACCTEST_TIMEOUT }} - ACCTEST_REGEX_RUN: "^TestMig" - MONGODB_ATLAS_BASE_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }} - MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_ORG_ID_CLOUD_DEV }} - MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }} - MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }} - -jobs: - get-provider-version: - runs-on: ubuntu-latest - outputs: - provider_version: ${{ inputs.provider_version || steps.get_last_release.outputs.last_provider_version }} - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Get Last Release - id: get_last_release - shell: bash - run: | - LAST_RELEASE=$(curl -sSfL -X GET https://api.github.com/repos/mongodb/terraform-provider-mongodbatlas/releases/latest | jq -r '.tag_name | ltrimstr("v")') - echo "Last release: $LAST_RELEASE" - echo "last_provider_version=${LAST_RELEASE}" >> "${GITHUB_OUTPUT}" - - change-detection: - runs-on: ubuntu-latest - env: - mustTrigger: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.test_group == '') }} - outputs: - project: ${{ steps.filter.outputs.project == 'true' || env.mustTrigger == 'true' }} - config: ${{ steps.filter.outputs.config == 'true' || env.mustTrigger == 'true' }} - advanced_cluster: ${{ steps.filter.outputs.advanced_cluster == 'true' || env.mustTrigger == 'true' }} - backup: ${{ steps.filter.outputs.backup == 'true' || env.mustTrigger == 'true' }} - stream: ${{ steps.filter.outputs.stream == 'true' || env.mustTrigger == 'true' }} - federated: ${{ steps.filter.outputs.federated == 'true' || env.mustTrigger == 'true' }} - search_deployment: ${{ steps.filter.outputs.search_deployment == 'true' || env.mustTrigger == 'true' }} - generic: ${{ steps.filter.outputs.generic == 'true' || env.mustTrigger == 'true' }} - network: ${{ steps.filter.outputs.network == 'true' || env.mustTrigger == 'true' }} - encryption: ${{ steps.filter.outputs.encryption == 'true' || env.mustTrigger == 'true' }} - serverless: ${{ steps.filter.outputs.serverless == 'true' || env.mustTrigger == 'true' }} - data_lake: ${{ steps.filter.outputs.data_lake == 'true' || env.mustTrigger == 'true' }} - cluster_outage_simulation: ${{ steps.filter.outputs.cluster_outage_simulation == 'true' || env.mustTrigger == 'true' }} - cluster: ${{ steps.filter.outputs.cluster == 'true' || env.mustTrigger == 'true' }} - ldap: ${{ steps.filter.outputs.ldap == 'true' || env.mustTrigger == 'true' }} - search_index: ${{ steps.filter.outputs.search_index == 'true' || env.mustTrigger == 'true' }} - steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 - id: filter - if: ${{ inputs.test_group == '' && env.mustTrigger == 'false' }} - with: - filters: | - project: - - 'internal/service/project/*.go' - - 'internal/service/projectipaccesslist/*.go' - - 'internal/service/accesslistapikey/*.go' - - 'internal/service/projectinvitation/*.go' - config: - - 'internal/service/alertconfiguration/*.go' - - 'internal/service/atlasuser/*.go' - - 'internal/service/databaseuser/*.go' - - 'internal/service/projectapikey/*.go' - - 'internal/service/apikey/*.go' - - 'internal/service/teams/*.go' - - 'internal/service/cloudprovideraccess/*.go' - - 'internal/service/customdbrole/*.go' - - 'internal/service/maintenancewindow/*.go' - - 'internal/service/customdnsconfigurationclusteraws/*.go' - - 'internal/service/rolesorgid/*.go' - - 'internal/service/orginvitation/*.go' - - 'internal/service/organization/*.go' - - 'internal/service/thirdpartyintegration/*.go' - backup: - - 'internal/service/onlinearchive/*.go' - - 'internal/service/cloudbackupschedule/*.go' - - 'internal/service/cloudbackupsnapshot/*.go' - - 'internal/service/cloudbackupsnapshotexportbucket/*.go' - - 'internal/service/cloudbackupsnapshotexportjob/*.go' - - 'internal/service/cloudbackupsnapshotrestorejob/*.go' - advanced_cluster: - - 'internal/service/advancedcluster/*.go' - stream: - - 'internal/service/streaminstance/*.go' - - 'internal/service/streamconnection/*.go' - federated: - - 'internal/service/federatedsettingsidentityprovider/*.go' - - 'internal/service/federateddatabaseinstance/*.go' - - 'internal/service/federatedsettingsorgconfig/*.go' - - 'internal/service/federatedsettingsorgrolemapping/*.go' - - 'internal/service/federatedquerylimit/*.go' - search_deployment: - - 'internal/service/searchdeployment/*.go' - generic: - - 'internal/service/backupcompliancepolicy/*.go' - - 'internal/service/auditing/*.go' - - 'internal/service/x509authenticationdatabaseuser/*.go' - network: - - 'internal/service/networkcontainer/*.go' - - 'internal/service/networkpeering/*.go' - - 'internal/service/privateendpointregionalmode/*.go' - - 'internal/service/privatelinkendpoint/*.go' - - 'internal/service/privatelinkendpointservice/*.go' - - 'internal/service/privatelinkendpointservicedatafederationonlinearchive/*.go' - encryption: - - 'internal/service/encryptionatrest/*.go' - serverless: - - 'internal/service/serverlessinstance/*.go' - - 'internal/service/privatelinkendpointserverless/*.go' - - 'internal/service/privatelinkendpointserviceserverless/*.go' - data_lake: - - 'internal/service/datalakepipeline/*.go' - cluster_outage_simulation: - - 'internal/service/clusteroutagesimulation/*.go' - cluster: - - 'internal/service/cluster/*.go' - - 'internal/service/globalclusterconfig/*.go' - ldap: - - 'internal/service/ldapconfiguration/*.go' - - 'internal/service/ldapverify/*.go' - search_index: - - 'internal/service/searchindex/*.go' - - project: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.project == 'true' || inputs.test_group == 'project' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_TEAMS_IDS: ${{ vars.MONGODB_ATLAS_TEAMS_IDS }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ vars.AWS_REGION }} - AWS_SECURITY_GROUP_1: ${{ vars.AWS_SECURITY_GROUP_1 }} - AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} - AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} - AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} - ACCTEST_PACKAGES: | - ./internal/service/project - ./internal/service/projectipaccesslist - ./internal/service/accesslistapikey - ./internal/service/projectinvitation - run: make testacc - - config: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.config == 'true' || inputs.test_group == 'config' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_USERNAME: ${{ vars.MONGODB_ATLAS_USERNAME_CLOUD_DEV }} - AZURE_ATLAS_APP_ID: ${{vars.AZURE_ATLAS_APP_ID}} - AZURE_SERVICE_PRINCIPAL_ID: ${{vars.AZURE_SERVICE_PRINCIPAL_ID}} - AZURE_TENANT_ID: ${{vars.AZURE_TENANT_ID}} - AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/alertconfiguration - ./internal/service/atlasuser - ./internal/service/databaseuser - ./internal/service/projectapikey - ./internal/service/apikey - ./internal/service/teams - ./internal/service/cloudprovideraccess - ./internal/service/customdbrole - ./internal/service/maintenancewindow - ./internal/service/customdnsconfigurationclusteraws - ./internal/service/rolesorgid - ./internal/service/orginvitation - ./internal/service/organization - ./internal/service/thirdpartyintegration - run: make testacc - - backup: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.backup == 'true' || inputs.test_group == 'backup' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/onlinearchive - ./internal/service/cloudbackupschedule - ./internal/service/cloudbackupsnapshot - ./internal/service/cloudbackupsnapshotexportbucket - ./internal/service/cloudbackupsnapshotexportjob - ./internal/service/cloudbackupsnapshotrestorejob - run: make testacc - - advanced_cluster: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.advanced_cluster == 'true' || inputs.test_group == 'advanced_cluster' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/advancedcluster - run: make testacc - - stream: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.stream == 'true' || inputs.test_group == 'stream' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_ENABLE_PREVIEW: "true" - # can be removed when MONGODB_ATLAS_LAST_VERSION supports the new MONGODB_ATLAS_ENABLE_PREVIEW flag - MONGODB_ATLAS_ENABLE_BETA: "true" - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/streaminstance - ./internal/service/streamconnection - run: make testacc - - federated: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.federated == 'true' || inputs.test_group == 'federated' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_FEDERATION_SETTINGS_ID: ${{ vars.MONGODB_ATLAS_FEDERATION_SETTINGS_ID }} - MONGODB_ATLAS_FEDERATED_OKTA_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_OKTA_IDP_ID }} - MONGODB_ATLAS_FEDERATED_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_IDP_ID }} - MONGODB_ATLAS_FEDERATED_OIDC_IDP_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_OIDC_IDP_ID }} - MONGODB_ATLAS_FEDERATED_SSO_URL: ${{ vars.MONGODB_ATLAS_FEDERATED_SSO_URL }} - MONGODB_ATLAS_FEDERATED_ISSUER_URI: ${{ vars.MONGODB_ATLAS_FEDERATED_ISSUER_URI }} - MONGODB_ATLAS_FEDERATED_ORG_ID: ${{ vars.MONGODB_ATLAS_FEDERATED_ORG_ID }} - AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_FEDERATION }} - AWS_REGION: ${{ vars.AWS_REGION_FEDERATION }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/federatedsettingsidentityprovider - ./internal/service/federateddatabaseinstance - ./internal/service/federatedsettingsorgconfig - ./internal/service/federatedsettingsorgrolemapping - ./internal/service/federatedquerylimit - run: make testacc - - search_deployment: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.search_deployment == 'true' || inputs.test_group == 'search_deployment' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/searchdeployment - run: make testacc - - generic: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.generic == 'true' || inputs.test_group == 'generic' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ vars.MONGODB_ATLAS_PROJECT_OWNER_ID }} - CA_CERT: ${{ secrets.CA_CERT }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/backupcompliancepolicy - ./internal/service/auditing - ./internal/service/x509authenticationdatabaseuser - run: make testacc - - network: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.network == 'true' || inputs.test_group == 'network' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_PRIVATE_ENDPOINT_ID: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_ID }} - MONGODB_ATLAS_PRIVATE_ENDPOINT_DNS_NAME: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_DNS_NAME }} - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_REGION: ${{ vars.AWS_REGION }} - AWS_SECURITY_GROUP_1: ${{ vars.AWS_SECURITY_GROUP_1 }} - AWS_SECURITY_GROUP_2: ${{ vars.AWS_SECURITY_GROUP_2 }} - AWS_VPC_CIDR_BLOCK: ${{ vars.AWS_VPC_CIDR_BLOCK }} - AWS_VPC_ID: ${{ vars.AWS_VPC_ID }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/networkcontainer - ./internal/service/networkpeering - ./internal/service/privateendpointregionalmode - ./internal/service/privatelinkendpoint - ./internal/service/privatelinkendpointservice - ./internal/service/privatelinkendpointservicedatafederationonlinearchive - run: make testacc - encryption: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.encryption == 'true' || inputs.test_group == 'encryption' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/encryptionatrest - run: make testacc - serverless: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.serverless == 'true' || inputs.test_group == 'serverless' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/serverlessinstance - ./internal/service/privatelinkendpointserverless - ./internal/service/privatelinkendpointserviceserverless - run: make testacc - data_lake: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.data_lake == 'true' || inputs.test_group == 'data_lake' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/datalakepipeline - run: make testacc - cluster_outage_simulation: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.cluster_outage_simulation == 'true' || inputs.test_group == 'cluster_outage_simulation' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/clusteroutagesimulation - run: make testacc - cluster: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.cluster == 'true' || inputs.test_group == 'cluster' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/cluster - ./internal/service/globalclusterconfig - run: make testacc - ldap: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.ldap == 'true' || inputs.test_group == 'ldap' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LDAP_HOSTNAME: ${{ secrets.MONGODB_ATLAS_LDAP_HOSTNAME }} - MONGODB_ATLAS_LDAP_USERNAME: ${{ secrets.MONGODB_ATLAS_LDAP_USERNAME }} - MONGODB_ATLAS_LDAP_PASSWORD: ${{ secrets.MONGODB_ATLAS_LDAP_PASSWORD }} - MONGODB_ATLAS_LDAP_CA_CERTIFICATE: ${{ secrets.MONGODB_ATLAS_LDAP_CA_CERTIFICATE }} - MONGODB_ATLAS_LDAP_PORT: ${{ secrets.MONGODB_ATLAS_LDAP_PORT }} - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: | - ./internal/service/ldapconfiguration - ./internal/service/ldapverify - run: make testacc - search_index: - needs: [ change-detection, get-provider-version ] - if: ${{ needs.change-detection.outputs.search_index == 'true' || inputs.test_group == 'search_index' }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 - with: - go-version-file: 'go.mod' - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 - with: - terraform_version: ${{ env.terraform_version }} - terraform_wrapper: false - - name: Migration Tests - env: - MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} - ACCTEST_PACKAGES: ./internal/service/searchindex - run: make testacc - \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81227ac2c8..0890aa3674 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: secrets: remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} + passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} update-changelog-header: needs: [ release-config, validate-version-input, update-examples-reference-in-docs ] @@ -71,7 +71,7 @@ jobs: secrets: remote: https://svc-apix-bot:${{ secrets.APIX_BOT_PAT }}@github.com/${{ github.repository }} gpg_private_key: ${{ secrets.APIX_BOT_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} + passphrase: ${{ secrets.APIX_BOT_PASSPHRASE }} create-tag: runs-on: ubuntu-latest diff --git a/.github/workflows/run-script-and-commit.yml b/.github/workflows/run-script-and-commit.yml index 304f710447..85fbc4f003 100644 --- a/.github/workflows/run-script-and-commit.yml +++ b/.github/workflows/run-script-and-commit.yml @@ -13,12 +13,13 @@ on: commit_message: required: true type: string - user_email: + secrets: + remote: required: true - type: string - user_name: + gpg_private_key: + required: true + passphrase: required: true - type: string jobs: run_script_and_commit: @@ -28,16 +29,30 @@ jobs: uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 with: fetch-depth: 0 + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 + with: + go-version-file: 'go.mod' - name: Run specified script run: ${{ inputs.script_call }} + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v2 + with: + git_user_signingkey: true + git_commit_gpgsign: true + env: + GPG_PRIVATE_KEY: ${{ secrets.gpg_private_key }} + PASSPHRASE: ${{ secrets.passphrase }} + - name: Commit changes run: | if [[ $(git status --porcelain) ]]; then git pull - git config --local user.email ${{ inputs.user_email }} - git config --local user.name ${{ inputs.user_name }} + git config --local user.email svc-api-experience-integrations-escalation@mongodb.com + git config --local user.name svc-apix-bot + git remote set-url origin ${{ secrets.remote }} git add ${{ inputs.file_to_commit }} git commit -m "${{ inputs.commit_message }}" git push diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 00fa2af636..d54402df72 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -48,7 +48,7 @@ jobs: secrets: inherit uses: ./.github/workflows/cleanup-test-env.yml - mig-tests: + tests: needs: [clean-before, versions] if: ${{ !cancelled() }} strategy: @@ -57,37 +57,23 @@ jobs: matrix: terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }} provider_version: ${{ fromJSON(needs.versions.outputs.provider_matrix) }} - name: mig-tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }} - secrets: inherit - uses: ./.github/workflows/migration-tests.yml - with: - terraform_version: ${{ matrix.terraform_version }} - provider_version: ${{ matrix.provider_version }} - - acc-tests: - needs: [clean-before, versions] - if: ${{ !cancelled() }} - strategy: - max-parallel: 1 - fail-fast: false - matrix: - terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }} - name: acc-tests-${{ matrix.terraform_version || 'latest' }} + name: tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }} secrets: inherit uses: ./.github/workflows/acceptance-tests.yml with: terraform_version: ${{ matrix.terraform_version }} + provider_version: ${{ matrix.provider_version }} atlas_cloud_env: ${{ inputs.atlas_cloud_env }} clean-after: - needs: [mig-tests, acc-tests] + needs: tests if: ${{ !cancelled() }} secrets: inherit uses: ./.github/workflows/cleanup-test-env.yml slack-notification: - needs: [mig-tests, acc-tests, clean-after] - if: ${{ !cancelled() && github.event_name == 'schedule' && (needs.mig-tests.result == 'failure' || needs.acc-tests.result == 'failure')}} + needs: [tests, clean-after] + if: ${{ !cancelled() && github.event_name == 'schedule' && needs.tests.result == 'failure'}} runs-on: ubuntu-latest steps: - name: Send Slack message diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index 4199703e63..6a87da5b59 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -18,10 +18,10 @@ jobs: - name: Update files run: make tools update-atlas-sdk - name: Verify Changed files - uses: tj-actions/verify-changed-files@3da26b2ca2b2791d4783124ead45684e860c7ee9 + uses: tj-actions/verify-changed-files@5c70053821ef986fa44bfb3e3efd1b8c040046f0 id: verify-changed-files - name: Create PR - uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e + uses: peter-evans/create-pull-request@c55203cfde3e5c11a452d352b4393e68b85b4533 if: steps.verify-changed-files.outputs.files_changed == 'true' with: title: "chore: Updates Atlas Go SDK" diff --git a/.github/workflows/update_tf_compatibility_matrix.yml b/.github/workflows/update_tf_compatibility_matrix.yml index 43d78c81c4..462f8368b9 100644 --- a/.github/workflows/update_tf_compatibility_matrix.yml +++ b/.github/workflows/update_tf_compatibility_matrix.yml @@ -17,10 +17,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: make update-tf-compatibility-matrix - name: Verify Changed files - uses: tj-actions/verify-changed-files@3da26b2ca2b2791d4783124ead45684e860c7ee9 + uses: tj-actions/verify-changed-files@5c70053821ef986fa44bfb3e3efd1b8c040046f0 id: verify-changed-files - name: Create PR - uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e + uses: peter-evans/create-pull-request@c55203cfde3e5c11a452d352b4393e68b85b4533 if: steps.verify-changed-files.outputs.files_changed == 'true' with: title: "doc: Updates Terraform Compatibility Matrix documentation" diff --git a/.golangci.yml b/.golangci.yml index b5bd216b35..8385bd5072 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -98,6 +98,7 @@ linters: - makezero - noctx - tenv + - testpackage # don't enable: # - deadcode diff --git a/go.mod b/go.mod index 60a0c60b05..ae04f60291 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/zclconf/go-cty v1.14.4 go.mongodb.org/atlas v0.36.0 go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0 - go.mongodb.org/atlas-sdk/v20231115008 v20231115008.4.0 + go.mongodb.org/atlas-sdk/v20231115008 v20231115008.5.0 go.mongodb.org/realm v0.1.0 ) diff --git a/go.sum b/go.sum index 50b4195ceb..32a8a05667 100644 --- a/go.sum +++ b/go.sum @@ -776,8 +776,8 @@ go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0 h1:h1X2CGKyN1UFvNs69vp7xpufbbreq6p7bbrg5uJ1sxw= go.mongodb.org/atlas-sdk/v20231001002 v20231001002.0.0/go.mod h1:4TAUPaWPFNSbi8c1hbQLr1wAdkmqi48O7zvyXjBM+a8= -go.mongodb.org/atlas-sdk/v20231115008 v20231115008.4.0 h1:pGzhW2wuxsO6VyimtNUxdS79afQ9XUl3qFMUnprwm2A= -go.mongodb.org/atlas-sdk/v20231115008 v20231115008.4.0/go.mod h1:0707RpWIrNFZ6Msy/dwRDCzC5JVDon61JoOqcbfCujg= +go.mongodb.org/atlas-sdk/v20231115008 v20231115008.5.0 h1:OuV1HfIpZUZa4+BKvtrvDlNqnilkCkdHspuZok6KAbM= +go.mongodb.org/atlas-sdk/v20231115008 v20231115008.5.0/go.mod h1:0707RpWIrNFZ6Msy/dwRDCzC5JVDon61JoOqcbfCujg= go.mongodb.org/realm v0.1.0 h1:zJiXyLaZrznQ+Pz947ziSrDKUep39DO4SfA0Fzx8M4M= go.mongodb.org/realm v0.1.0/go.mod h1:4Vj6iy+Puo1TDERcoh4XZ+pjtwbOzPpzqy3Cwe8ZmDM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= diff --git a/internal/service/networkcontainer/resource_network_container_migration_test.go b/internal/service/networkcontainer/resource_network_container_migration_test.go index b7457f913b..0258e4e67a 100644 --- a/internal/service/networkcontainer/resource_network_container_migration_test.go +++ b/internal/service/networkcontainer/resource_network_container_migration_test.go @@ -13,13 +13,14 @@ import ( func TestMigNetworkContainer_basicAWS(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AWS, "US_EAST_1") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicAWS + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ @@ -35,13 +36,14 @@ func TestMigNetworkContainer_basicAWS(t *testing.T) { func TestMigNetworkContainer_basicAzure(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) cidrBlock = fmt.Sprintf("10.8.%d.0/24", randInt) config = configBasic(projectID, cidrBlock, constant.AZURE, "US_EAST_2") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicAzure + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ @@ -57,13 +59,14 @@ func TestMigNetworkContainer_basicAzure(t *testing.T) { func TestMigNetworkContainer_basicGCP(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) randInt = acctest.RandIntRange(0, 255) gcpCidrBlock = fmt.Sprintf("10.%d.0.0/18", randInt) config = configBasic(projectID, gcpCidrBlock, constant.GCP, "") ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccNetworkContainer_basicGCP + resource.Test(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{ diff --git a/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go b/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go index ad523099a3..6ea5b910aa 100644 --- a/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go +++ b/internal/service/projectipaccesslist/resource_project_ip_access_list_migration_test.go @@ -12,8 +12,8 @@ import ( func TestMigProjectIPAccessList_settingIPAddress(t *testing.T) { var ( - projectID = mig.ProjectIDGlobal(t) - ipAddress = acc.RandomIP(179, 154, 226) + projectID = acc.ProjectIDExecution(t) + ipAddress = acc.RandomIP(180, 154, 226) comment = fmt.Sprintf("TestAcc for ipAddress (%s)", ipAddress) config = configWithIPAddress(projectID, ipAddress, comment) ) @@ -34,8 +34,8 @@ func TestMigProjectIPAccessList_settingIPAddress(t *testing.T) { func TestMigProjectIPAccessList_settingCIDRBlock(t *testing.T) { var ( - projectID = mig.ProjectIDGlobal(t) - cidrBlock = acc.RandomIP(179, 154, 226) + "/32" + projectID = acc.ProjectIDExecution(t) + cidrBlock = acc.RandomIP(180, 154, 226) + "/32" comment = fmt.Sprintf("TestAcc for cidrBlock (%s)", cidrBlock) config = configWithCIDRBlock(projectID, cidrBlock, comment) ) @@ -56,7 +56,7 @@ func TestMigProjectIPAccessList_settingCIDRBlock(t *testing.T) { func TestMigProjectIPAccessList_settingAWSSecurityGroup(t *testing.T) { var ( - projectID = acc.ProjectIDExecution(t) // No mig.ProjectIDGlobal because network container + projectID = acc.ProjectIDExecution(t) awsSGroup = os.Getenv("AWS_SECURITY_GROUP_1") vpcID = os.Getenv("AWS_VPC_ID") vpcCIDRBlock = os.Getenv("AWS_VPC_CIDR_BLOCK") @@ -67,7 +67,8 @@ func TestMigProjectIPAccessList_settingAWSSecurityGroup(t *testing.T) { config = configWithAWSSecurityGroup(projectID, providerName, vpcID, awsAccountID, vpcCIDRBlock, awsRegion, awsSGroup, comment) ) - resource.ParallelTest(t, resource.TestCase{ + // Serial so it doesn't conflict with TestAccProjectIPAccessList_settingAWSSecurityGroup + resource.Test(t, resource.TestCase{ PreCheck: func() { mig.PreCheckPeeringEnvAWS(t) }, CheckDestroy: checkDestroy, Steps: []resource.TestStep{