Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 69 additions & 9 deletions .github/workflows/cleanup-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,81 @@ on:
- cron: "0 3 * * *" # workflow runs every day at 03:00 AM

jobs:
clenup-test-env-general:
cleanup-dev-cfn-test-github:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: terraform-provider-mongodbatlas-checkout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had to see the new file entirely instead of diff to understand this checkout name :-)

uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
sparse-checkout: |
scripts
- uses: mongodb/atlas-github-action@15663d068c40a8582d881560961fce9d45e0df9a
repository: mongodb/terraform-provider-mongodbatlas
ref: 133ee57735e0c8f2b22e74bbd9f8c3fdd8da2f9c
Copy link
Member

@lantoli lantoli Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we control both repos, how about using master directly?
In current approach I can see the benefit that for instance if we change workflow path this won't break. As a con we need to remember to update CFN if we do some improvements in clean GHA in TF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A pro for using the SHA is caching. Not a strong opinion, but prefer keeping as is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer to use master as well. If we change the workflow path or something things will simply fail right? and at least we'll get notified that ways to take an action. With the current approach it's easy to miss out on updating the CFN repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 455c7d5

- name: Cleanup cloud-dev CFN Test GitHub
shell: bash
uses: ./.github/templates/clean-atlas-org
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_PUBLIC_KEY }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what projects are we effectively cleaning with this PR before unifying names?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not many, although the CFNTest org had 98 projects removed.

MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_ORG_ID }}
MONGODB_ATLAS_OPS_MANAGER_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
PROJECT_TO_NOT_DELETE: ${{ vars.CLOUD_DEV_PROJECT_ID }}
run: ./scripts/cleanup-test-env.sh
MONGODB_ATLAS_BASE_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
MONGODB_ATLAS_CLEAN_RETRY_ATTEMPTS: "1"
cleanup-dev-cfntest:
runs-on: ubuntu-latest
steps:
- name: terraform-provider-mongodbatlas-checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: mongodb/terraform-provider-mongodbatlas
ref: 133ee57735e0c8f2b22e74bbd9f8c3fdd8da2f9c
- name: Cleanup cloud-dev CFN Test
uses: ./.github/templates/clean-atlas-org
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.CLOUD_DEV_CFN_TEST_PUBLIC_KEY }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.CLOUD_DEV_CFN_TEST_PRIVATE_KEY }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.CLOUD_DEV_CFN_TEST_ORG_ID }}
MONGODB_ATLAS_BASE_URL: ${{ vars.MONGODB_ATLAS_BASE_URL }}
MONGODB_ATLAS_CLEAN_RETRY_ATTEMPTS: "1"
cleanup-qa-env-rp:
runs-on: ubuntu-latest
steps:
- name: terraform-provider-mongodbatlas-checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: mongodb/terraform-provider-mongodbatlas
ref: 133ee57735e0c8f2b22e74bbd9f8c3fdd8da2f9c
- name: Cleanup cloud-dev CFN Test GitHub
uses: ./.github/templates/clean-atlas-org
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.MONGODB_ATLAS_RP_PUBLIC_KEY_QA }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.MONGODB_ATLAS_RP_PRIVATE_KEY_QA }}
MONGODB_ATLAS_ORG_ID: ${{ vars.MONGODB_ATLAS_RP_ORG_ID_QA }}
MONGODB_ATLAS_BASE_URL: https://cloud-qa.mongodb.com/
MONGODB_ATLAS_CLEAN_RETRY_ATTEMPTS: "1"
cleanup-prod-env-general:
runs-on: ubuntu-latest
steps:
- name: terraform-provider-mongodbatlas-checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: mongodb/terraform-provider-mongodbatlas
ref: 133ee57735e0c8f2b22e74bbd9f8c3fdd8da2f9c
- name: Cleanup cloud-dev CFN Test GitHub
uses: ./.github/templates/clean-atlas-org
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.ATLAS_PUBLIC_KEY_PUBLISHING }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.ATLAS_PRIVATE_KEY_PUBLISHING }}
MONGODB_ATLAS_ORG_ID: ${{ secrets.ATLAS_ORG_ID_PUBLISHING }}
MONGODB_ATLAS_CLEAN_RETRY_ATTEMPTS: "1"
cleanup-prod-data-federation:
runs-on: ubuntu-latest
steps:
- name: terraform-provider-mongodbatlas-checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: mongodb/terraform-provider-mongodbatlas
ref: 133ee57735e0c8f2b22e74bbd9f8c3fdd8da2f9c
- name: Cleanup cloud-dev CFN Test GitHub
uses: ./.github/templates/clean-atlas-org
env:
MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.ATLAS_PUBLIC_KEY_FOR_FEDERATION_PUBLISHING }}
MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.ATLAS_PRIVATE_KEY_FOR_FEDERATION_PUBLISHING }}
MONGODB_ATLAS_ORG_ID: ${{ vars.ATLAS_ORG_ID_FOR_FEDERATION_PUBLISHING }}
MONGODB_ATLAS_CLEAN_RETRY_ATTEMPTS: "1"
70 changes: 0 additions & 70 deletions scripts/cleanup-test-env.sh

This file was deleted.

Loading