Skip to content

DRIVERS-3712 Tag Atlas resources with mongodb-owner/mongodb-env - #932

Merged
blink1073 merged 5 commits into
mongodb-labs:masterfrom
blink1073:atlas-DRIVERS-3712
Nov 10, 2026
Merged

blink1073 merged 5 commits into
mongodb-labs:masterfrom
blink1073:atlas-DRIVERS-3712

Conversation

@blink1073

@blink1073 blink1073 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

DRIVERS-3712

Summary

The Atlas deployment setups tag every deployment they create with mongodb-owner/mongodb-env. With VERIFY_MONGODB_TAGS set, they verify the tags and fail the task when one is missing.

Changes in this PR

  • The shared Atlas deployment creator injects the policy tags, so every consumer gets tagged deployments: the Atlas task group, the auth_oidc setups, and the lambda task's cluster.
  • Each Atlas-consuming setup verifies the created deployment's tags when VERIFY_MONGODB_TAGS is set; endpoints that serve clusters and serverless instances alike fetch with ${DEPLOYMENT_TYPE}.
  • The Atlas README documents the tags, the overrides, and the opt-in gate.

Test Plan

Unit tests: .github/scripts/test_tag_verify_atlas.py (gate presence in all five setups, the deployment-type endpoint, the tag injection).

Red/green patch pair on the MongoDB Python driver; only the tags differ:

  • Red (untagged baseline): the oidc tasks and the lambda task (its setup phase) fail at the Atlas tag checks. The azure task succeeds because it does not use Atals.
  • Green (tagged), all tasks pass with verify-tags OK

@blink1073 blink1073 changed the title DRIVERS-3712 Implement Cloud Tag Policy for drivers-evergreen-tools DRIVERS-3712 Tag Atlas resources with mongodb-owner/mongodb-env Nov 10, 2026
@blink1073
blink1073 requested a balanced review from Copilot November 10, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Tag injection affects both cluster and serverless creation, but structural tests and placeholder live-run links leave API acceptance and opt-in verification unconfirmed.

No open issues 🎉

What changed in this PR

Implements DRIVERS-3712 by adding policy tags to Atlas deployments created through the shared helper and optional tag verification across Atlas-consuming setups.

Changes:

  • Injects mongodb-owner and mongodb-env tags, with configurable values.
  • Adds verification gated by VERIFY_MONGODB_TAGS to five setup scripts.
  • Adds structural regression tests and documents tag defaults and overrides.
File Description
.github/​scripts/​test_tag_verify_atlas.py Checks gate presence, endpoint selection, tag injection, and shell syntax.
.evergreen/​auth_oidc/​setup.sh Adds optional Atlas deployment tag verification.
.evergreen/​auth_oidc/​k8s/​setup.sh Adds optional tag verification for Kubernetes OIDC deployments.
.evergreen/​auth_oidc/​gcp/​setup.sh Adds optional tag verification for GCP OIDC deployments.
.evergreen/​auth_oidc/​azure_func/​setup.sh Adds optional verification using the deployment-type endpoint.
.evergreen/​atlas/​setup-atlas-cluster.sh Adds optional verification for clusters and serverless instances.
.evergreen/​atlas/​README.md Documents policy tag defaults and environment-variable overrides.
.evergreen/​atlas/​atlas-utils.sh Injects policy tags into shared deployment creation requests.

Review effort: Balanced

@blink1073
blink1073 marked this pull request as ready for review November 10, 2026 16:58
@blink1073
blink1073 requested a review from a team as a code owner November 10, 2026 16:58
@blink1073
blink1073 requested a review from papafe November 10, 2026 16:58
@codeowners-service-app

Copy link
Copy Markdown

Assigned PavelSafronov for team dbx-drivers-tools-maintainers because papafe is out of office.

@PavelSafronov PavelSafronov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should .evergreen/serverless/create-instance.sh be updated with a VERIFY_MONGODB_TAGS check?

@blink1073

Copy link
Copy Markdown
Member Author

Serverless support was dropped in DRIVERS-3115

Comment thread .evergreen/atlas/setup-atlas-cluster.sh Outdated
MONGODB_URI="mongodb+srv://${DRIVERS_ATLAS_USER}:${DRIVERS_ATLAS_PASSWORD}@${URI}"

# Verify the cluster's tags when requested (DRIVERS-3712).
if [ -n "${VERIFY_MONGODB_TAGS:-}" ]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: this logic repeats 5 times, maybe consolidate it as verify_deployment_tags in atlas-utils.sh?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

@blink1073
blink1073 merged commit 5d52ccd into mongodb-labs:master Nov 10, 2026
94 of 95 checks passed
@blink1073
blink1073 deleted the atlas-DRIVERS-3712 branch November 10, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants