Repository navigation
Description
Summary
For a future DataProtectionTest version (DPTv2), make the terminal phase reflect the aggregate result of the requested tests. Reserve the successful completion phase for runs in which all requested tests succeeded. Add a distinct partial-result phase and a status conditions array that explains the results.
Requested by @kaovilai to track the proposal in:
msfrucht#2 (comment)
This is a future API enhancement, not a requirement to expand the scope of PR #2443.
Rationale and current behavior
The referenced review comment expects a phase named "Completed" to mean that all parts succeeded. It proposes a partial-result phase such as PartialFailed, PartialComplete, or PartialSuccess, plus conditions that explain the result. Final phase names remain a design decision.
The current API uses Complete, not Completed. In the inspected PR #2443 branch, updateDPTStatusToComplete sets status.phase to Complete and copies individual test results without checking whether all tests succeeded. The e2e helper CreateDPTAndAssertComplete therefore also checks status.uploadTest.success; phase alone does not establish success.
Required changes
- Define DPTv2 aggregate result semantics for all-success, mixed success/failure, and all-failure runs. Define handling for skipped, disabled, and not-run tests so they cannot produce misleading success.
- Reserve the successful terminal phase for successful completion of all requested tests.
- Introduce a distinct terminal partial-result phase for mixed outcomes. Select and document the final phase name.
- Add a status conditions array that explains aggregate and individual test outcomes. Define stable condition types, reasons, messages, and transition semantics.
- Update controller aggregation and terminal-state handling to use these semantics. Keep individual test diagnostics available.
- Update API/CRD schemas, status consumers, e2e helpers, and documentation. Document compatibility and migration from the existing status model.
- Add regression coverage for aggregate phases and conditions.
Affected areas
api/v1alpha1/dataprotectiontest_types.go: current status model; reference point for DPTv2 API design.internal/controller/dataprotectiontest_controller.go: result aggregation, completion/error status, and terminal-state handling.internal/controller/dataprotectiontest_controller_test.go: controller status coverage.config/crd/bases/oadp.openshift.io_dataprotectiontests.yamland bundled CRD manifests: status schema.tests/e2e/lib/dpt.go: terminal-state polling and success assertions.
These are current implementation reference points, not a prescribed location for the future API version.
Acceptance criteria
- All requested tests succeeding produces the successful terminal phase.
- Mixed successful and failed tests produce a distinct partial-result phase.
- Failed requested tests cannot produce the successful terminal phase.
- Conditions explain the aggregate outcome and identify failed tests with actionable diagnostics.
- Disabled, skipped, and not-run tests have documented behavior.
- Status consumers recognize all terminal phases and do not interpret partial completion as success.
- Tests cover all-success, mixed-result, all-failure, and skipped/not-run cases.
- Compatibility and migration behavior are documented.
References
- Source proposal: fix: address shubham's review feedback on DPT CACertRef handling msfrucht/oadp-operator#2 (comment)
- Related implementation feedback: fix: address shubham's review feedback on DPT CACertRef handling msfrucht/oadp-operator#2
- Upstream PR: OADP-8764: handle CACertRef in DPT #2443
Activity