Skip to content

fix(platform): make mongodb-application depend on its operator - #3845

Open
myasnikovdaniil wants to merge 1 commit into
mainfrom
fix/mongodb-application-dependson
Open

fix(platform): make mongodb-application depend on its operator#3845
myasnikovdaniil wants to merge 1 commit into
mainfrom
fix/mongodb-application-dependson

Conversation

@myasnikovdaniil

@myasnikovdaniil myasnikovdaniil commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

The mongodb chart renders kind: PerconaServerMongoDB from psmdb.percona.com/v1, but cozystack.mongodb-application depended only on cozystack.networking and cozystack.cozystack-engine. So mongodb-rd registers the ApplicationDefinition as soon as the engine is up, a tenant can create a MongoDB before the operator exists, and its HelmRelease then fails with no matches for kind "PerconaServerMongoDB".

Every other operator-backed application here already carries the edge. This is the same defect #3817 fixes for etcd, and it was found while reviewing that one.

It also closes a test-selection gap. Without the edge cozystack.mongodb-operator reaches no runnable suite, so every change to the operator escalates to the full 21-suite run instead of selecting mongodb. See src_to_suites() in hack/select-e2e.sh.

Checks

packages/core/platform/tests/sources_mongodb_application_dependson_test.yaml pins the edge alongside the two baseline ones, mirroring the etcd guard. Mutation checked: removing the edge turns it red, restoring it turns it green.

hack/select-install.sh --validate reports the graph still has no cycle, 99 sources. Platform helm unit tests are 134 across 31 suites.

The exposure this adds

An administrator who lists cozystack.mongodb-operator in bundles.disabledPackages while keeping the application now leaves it DependenciesNotReady. That is the same exposure postgres, mariadb, kafka, redis and etcd already carry, with Package.spec.ignoreDependencies as the escape hatch.

Release note

fix(platform): the mongodb application now waits for the mongodb operator, so a tenant can no longer create a MongoDB before the CRD that serves it exists

Summary by CodeRabbit

  • Bug Fixes

    • Ensured the MongoDB operator is available before MongoDB application components are registered or deployed.
    • Preserved required dependencies on networking and the platform engine.
  • Tests

    • Added coverage verifying the MongoDB application dependency configuration.

The mongodb chart renders kind: PerconaServerMongoDB from
psmdb.percona.com/v1, but cozystack.mongodb-application depended only on
networking and cozystack-engine. So mongodb-rd registers the
ApplicationDefinition as soon as the engine is up, and a tenant can
create a MongoDB before the operator exists; its HelmRelease then fails
with no matches for kind "PerconaServerMongoDB".

This is the same defect #3817 fixed for etcd, found while reviewing it.
Every other operator-backed app here already carries the edge.

It also closes a test-selection gap: without it cozystack.mongodb-operator
reaches no runnable suite, so every change to the operator escalates to
the full 21-suite run instead of selecting mongodb.

select-install.sh --validate reports the graph still has no cycle.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@github-actions github-actions Bot added size/M This PR changes 30-99 lines, ignoring generated files area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug labels Aug 16, 2026
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a841d66-755f-4752-b71b-3d847a913a53

📥 Commits

Reviewing files that changed from the base of the PR and between 66cd0fb and fcec3b0.

📒 Files selected for processing (2)
  • packages/core/platform/sources/mongodb-application.yaml
  • packages/core/platform/tests/sources_mongodb_application_dependson_test.yaml

Included review availability: Your plan includes up to 8 reviews per rolling hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The default MongoDB application package now depends on cozystack.mongodb-operator. A Chainsaw test verifies this dependency and preserves the networking and engine dependencies.

Changes

MongoDB application dependency

Layer / File(s) Summary
Declare and validate MongoDB dependencies
packages/core/platform/sources/mongodb-application.yaml, packages/core/platform/tests/sources_mongodb_application_dependson_test.yaml
The MongoDB application declares cozystack.mongodb-operator as a prerequisite. The Chainsaw test verifies the operator, networking, and engine dependencies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fcec3

The MongoDB application now waits for its operator before becoming available, preventing creation before the required CRD exists. The change is localized and covered by a regression test; no actionable merge-blocking risk remains after normal checks.

Suggested reviewers: lexfrei

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding the MongoDB operator as a dependency of the MongoDB application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/mongodb-application-dependson

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant