Skip to content

diff endpoint implements a ref grammar the spec does not define (REQ-OBV-005: slug / current: / history:, controller: draft | UUID) #170

Description

@rubenvdlinde

Surfaced by turning Newman on (#156). Not a regression — the divergence has always been there; nothing measured it until the collection's earlier failures were cleared away.

The spec

openspec/specs/openbuild-version-snapshots/spec.md (status: done), REQ-OBV-005:

The diff endpoint changes shape under the versioned model: diffing two ApplicationVersion rows is the canonical case; comparing two historical states of one ApplicationVersion (time-travel diff on a single row) is the second supported case.

where {fromRef} and {toRef} are either:

  • An ApplicationVersion slug (e.g. staging) — diff is against the current saved state of that version's manifest.
  • The literal current:<versionSlug> — reserved syntax for forward compatibility.
  • A version-history reference history:<versionSlug>:<revisionId>.

The controller

ApplicationsController::resolveVersionBlob() accepts the literal draft, or an ApplicationVersion UUID, and nothing else. None of slug, current:<slug> or history:<slug>:<rev> resolves.

So the second supported case — a time-travel diff on a single row, which is the whole point of the model ADR-002 moved to — is not reachable through the endpoint at all.

Why it went unnoticed

tests/integration/openbuild-versioning.postman_collection.json drove the endpoint with two sibling snapshot UUIDs, which is the append-only model REQ-OBV-002 retired. Those rows are never created, so to interpolated empty and the request 500'd — and the 500 was itself a second defect masking this one.

That 500 is fixed in #156: resolveVersionBlob() documented "Returns null on miss so the caller can surface 404" while ObjectService::find() throws, so both of diffVersions()'s 404 branches were dead code and the throw fell into the outer catch (Throwable) as internal_error. It now answers 404 — the eighth instance of the family #159 fixed, missed there because gate-49 only flags an untranslated lookup outside a try/catch.

With the 500 gone, the endpoint answers 404 and the divergence is what is left.

Deliberately not papered over

The three REQ-OBV-005 assertions are left red in #156, with the reason written into the collection's folder description. Rewriting them to match today's UUID-only behaviour would lock in the divergence and delete the only evidence of it.

What a fix needs

  • resolveVersionBlob() to accept a version slug (scoped to the parent Application), current:<slug>, and history:<slug>:<revisionId> via OR's object-history API.
  • The Newman folder re-pointed at the slug grammar, plus a case that diffs two historical states of one row — the case that has never been testable.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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