Skip to content

feat: add support for 20240701 MongoCluster #4773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alombardo4
Copy link

What this PR does

This adds support for CosmosDB Vcore (MongoCluster) and its associated firewall rules. I chose to use the latest stable API version available (2024-07-01)

How does this PR make you feel?

gif

Checklist

  • this PR contains documentation
  • this PR contains tests
  • this PR contains YAML Samples

Copy link
Member

@theunrepentantgeek theunrepentantgeek left a comment

Choose a reason for hiding this comment

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

Looks good. Once you've removed a few things that shouldn't be needed in the PR, we'll trigger CI. You can run the same checks locally by running task ci if you want to check for errors in advance.

@theunrepentantgeek
Copy link
Member

The CI test run failed with this error:

kube_per_test_context.go:167: creating recorder: required environment variable "AZURE_SUBSCRIPTION_ID" was not supplied
--- FAIL: Test_Samples_CreationAndDeletion/Test_Documentdb_v1api20240701_CreationAndDeletion (0.00s)```

What does this mean? There's no recording of the new sample, so it's trying to run live against Azure, which doesn't work.

The fix is easy - commit a recording that shows the sample works. (See Create a sample for more information).

@alombardo4
Copy link
Author

The CI test run failed with this error:

kube_per_test_context.go:167: creating recorder: required environment variable "AZURE_SUBSCRIPTION_ID" was not supplied
--- FAIL: Test_Samples_CreationAndDeletion/Test_Documentdb_v1api20240701_CreationAndDeletion (0.00s)```

What does this mean? There's no recording of the new sample, so it's trying to run live against Azure, which doesn't work.

The fix is easy - commit a recording that shows the sample works. (See Create a sample for more information).

@theunrepentantgeek Thanks! I've just added a new recording

@theunrepentantgeek
Copy link
Member

There's something failing in CI that I need to investigate further, I'll report back once I've worked out what's going on.

@matthchr
Copy link
Member

The issue with CI seems to be that the replay test is having trouble finishing in time because it took a long time for the mongo DB to be created when recording, so there are a lot of requests/responses to Azure to play through to simulate, which is taking longer than the 2m timeout. It should be able to go through them pretty quickly though due to how we have requeues configured... I'll look into it further.

@matthchr
Copy link
Member

Can you either re-record the recording for the sample test (the other recording is fine), or manually go edit the sample recording file and remove some of the >300 calls to https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/eastus/mongoClusterAzureAsyncOperation/9c57b7c4-d387-439c-88fd-05d42ea2b9b9, so that the sample replay test can complete faster?

I'll also see if I can't fix what's causing us to take longer than we should trying to get through 300 requests, we should be able to do it in 120s in replay mode.

@alombardo4
Copy link
Author

Can you either re-record the recording for the sample test (the other recording is fine), or manually go edit the sample recording file and remove some of the >300 calls to https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/eastus/mongoClusterAzureAsyncOperation/9c57b7c4-d387-439c-88fd-05d42ea2b9b9, so that the sample replay test can complete faster?

I'll also see if I can't fix what's causing us to take longer than we should trying to get through 300 requests, we should be able to do it in 120s in replay mode.

Ah thanks! I manually cut down most of those repeated polling calls, so now there's just a handful (<10). The whole recording is now 27 requests.

@matthchr
Copy link
Member

/ok-to-test sha=94a85f1

@matthchr
Copy link
Member

I think you removed too much from the recording?

[produce-markdown-summary] logr.go:280: I2025-06-20T19:09:52Z] documentdb_firewallrule "msg"="Owner exists but is not ready. Current condition" name="aso-mongodb-cluster" namespace="aso-test-samples-creationanddeletion-test-documentdb-v1ap-26c4a" ready="Condition [Ready], Status = "False", ObservedGeneration = 1, Severity = "Error", Reason = "ReconciliationFailedPermanently", Message = "cannot find go-vcr recording for request from test \"Test_Samples_CreationAndDeletion/Test_Documentdb_v1api20240701_CreationAndDeletion\" (cassette: \"recordings/Test_Samples_CreationAndDeletion/Test_Documentdb_v1api20240701_CreationAndDeletion\") (no responses recorded for this method/URL): GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-xzavsc/providers/Microsoft.DocumentDB/mongoClusters/aso-mongodb-cluster?api-version=2024-07-01 (attempt: 0)\n\n", LastTransitionTime = "2025-06-20 19:09:07 +0000 UTC""

(no responses recorded for this method/URL): GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-xzavsc/providers/Microsoft.DocumentDB/mongoClusters/aso-mongodb-cluster?api-version=2024-07-01  (attempt: 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants