Skip to content

RFE: DPTv2 success-only completion, partial-result phase, and status conditions #2476

Open

Description

@coderabbitai

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

  1. 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.
  2. Reserve the successful terminal phase for successful completion of all requested tests.
  3. Introduce a distinct terminal partial-result phase for mixed outcomes. Select and document the final phase name.
  4. Add a status conditions array that explains aggregate and individual test outcomes. Define stable condition types, reasons, messages, and transition semantics.
  5. Update controller aggregation and terminal-state handling to use these semantics. Keep individual test diagnostics available.
  6. Update API/CRD schemas, status consumers, e2e helpers, and documentation. Document compatibility and migration from the existing status model.
  7. 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.yaml and 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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions