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

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.

Closes #3850

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 <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
@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

Suggested reviewers: lexfrei

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.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
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.
✨ 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.

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.

myasnikovdaniil NOT LGTM. The change itself is right, the only blocker is the attribution trailer on the commit.

Business context: a tenant can create a MongoDB before the Percona operator and its CRD exist, because the mongodb application never waited for the mongodb operator.

The edge is still missing on current main, and the branch merges into main without conflicts. It matches postgres, mariadb, kafka, redis and etcd, which all list their operator. Both packages come from the paas bundle under the same condition, and nothing depends on cozystack.mongodb-application. The operator itself depends only on networking, prometheus-operator-crds and cert-manager, so there is no cycle, and hack/select-install.sh --validate agrees. The new test runs under make unit-tests. It goes red when I remove the edge and green when I put it back.

The blocker: commit fcec3b0 carries Assisted-By: Claude <[email protected]>. docs/agents/contributing.md lists this exact line under Review Blockers, and the trailer value must be LLM. CI stayed green only because this base predates the Commit trailers job. Main's hack/check-commit-trailers.sh rejects the commit with "attribution trailer value must be exactly LLM", so it will fail after a rebase. Please reword it to Assisted-by: LLM.

While rewording, I'd also drop "found while reviewing it" from the commit body and "it was found while reviewing that one" from the PR body. The PR body becomes the merge commit message, and how the bug was found is not a reason for the change. Keeping #3817 as the precedent is fine.

E2E on this head failed only in kubernetes-previous and kubernetes-latest, and the mongodb suite passed. A dependsOn edge on the mongodb application doesn't reach the Kamaji control-plane suites, so I don't count that against the PR. The branch is 1289 commits behind main, so the rebase for the reword also gets you a fresh run on current code.

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.

audit every operator-backed application for a missing dependsOn edge

2 participants