diff --git a/CHANGELOG.md b/CHANGELOG.md index 4437126..8430101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Documented legacy `id` removal in 1.0.0 and version-based migration while retaining current acceptance and optional `testId`. + - Clarified durable attachment references, optional producer-local paths and producer-defined digest metadata. - Added coordinated cross-process retry examples and clarified logical-run correlation and final-attempt duration. diff --git a/schema/ctrf.schema.json b/schema/ctrf.schema.json index 761d395..8cfc232 100644 --- a/schema/ctrf.schema.json +++ b/schema/ctrf.schema.json @@ -138,7 +138,7 @@ "required": [ "name", "status", "duration" ], "properties": { "id": { - "description": "Legacy identifier for the test case (UUID). New producers should prefer testId", + "description": "Deprecated test-case identifier (UUID), scheduled for removal in CTRF 1.0.0. Still accepted in this version; prefer optional testId when providing case identity", "type": "string", "format": "uuid", "minLength": 1 diff --git a/spec/ctrf.md b/spec/ctrf.md index bd0bbaf..efbd719 100644 --- a/spec/ctrf.md +++ b/spec/ctrf.md @@ -885,7 +885,7 @@ Each field within the test object is described in the subsections below. ### 9.1. `id` -> **Legacy.** `id` is retained for backward compatibility. New producers SHOULD prefer `testId` (Section 9.2). +> **Deprecated.** `id` is retained for backward compatibility and is scheduled for removal in CTRF 1.0.0. Producers SHOULD use `testId` (Section 9.2) instead when providing test-case identity; `testId` remains OPTIONAL. **Description:** A unique, stable identifier for the test case. @@ -895,7 +895,9 @@ A unique, stable identifier for the test case. If present, it MUST be a valid UUID as defined in [RFC9562]. Producers SHOULD prefer `testId` for new implementations. When both `id` and `testId` are present, consumers SHOULD use `testId`. -Consumers SHOULD treat `id` as legacy unless a producer documents stronger semantics. +Consumers SHOULD treat `id` as legacy. + +Migration follows the document's declared specification version. Reports declaring CTRF 1.0.0 will be required to omit `id`; producers emitting earlier specification versions can continue to follow those versions' contracts. Consumers reading those earlier reports SHOULD use `testId` in preference to `id` when both are present. This deprecation notice does not remove `id` from the current schema or require producers to supply `testId`. ### 9.2. `testId` @@ -2252,7 +2254,7 @@ to this specification. "required": [ "name", "status", "duration" ], "properties": { "id": { - "description": "Legacy identifier for the test case (UUID). New producers should prefer testId", + "description": "Deprecated test-case identifier (UUID), scheduled for removal in CTRF 1.0.0. Still accepted in this version; prefer optional testId when providing case identity", "type": "string", "format": "uuid", "minLength": 1 diff --git a/tests/normative/valid-documents.test.json b/tests/normative/valid-documents.test.json index 8c28c54..01f770b 100644 --- a/tests/normative/valid-documents.test.json +++ b/tests/normative/valid-documents.test.json @@ -63,6 +63,38 @@ "description": "Merged coordinated retry report", "valid": true, "dataPath": "../../examples/coordinated-retry-merged.json" + }, + { + "description": "Legacy id remains accepted alongside optional testId before 1.0.0", + "valid": true, + "data": { + "reportFormat": "CTRF", + "specVersion": "0.2.0", + "results": { + "tool": { + "name": "example-runner" + }, + "summary": { + "tests": 1, + "passed": 1, + "failed": 0, + "pending": 0, + "skipped": 0, + "other": 0, + "start": 1609459200000, + "stop": 1609459201000 + }, + "tests": [ + { + "name": "should pass", + "status": "passed", + "duration": 100, + "id": "12345678-1234-4234-8234-123456789abc", + "testId": "preferred-case-key" + } + ] + } + } } ] }