Skip to content

Let findings verify the head commit of a retained review #123

Backlog

Description

@Celestial-0

A build can know both its commit SHA and the ID of a Proofline review. Today proofline findings --review ID reads the review, but the caller has to parse the result to check its head. Supplying both --review and --head is a usage error.

There is also a correctness bug in the existing head search. On CLI 0.10.4 (5dd916f), a loopback console returned a review summary at commit A followed by a completed detail for the same review ID at commit B. The real CLI printed the detail for B with outcome: COMPLETED and exited 0 for findings --repo acme/app --head A --json. The existing departed-repository fixture also uses different SHAs for its summary and detail. This is a client reproduction with synthetic data.

Expected behavior

  1. Allow proofline findings --review ID --head SHA to read the known review directly and check its reported head against the full SHA. A build with the review ID can do this outside a checkout.
  2. Apply the same check when the CLI finds a review by explicit SHA or the checkout's HEAD. Reject a missing or different head before printing findings, a JSON result or SARIF. An error should distinguish the requested head from the head Proofline returned.
  3. Accept equivalent hexadecimal SHAs regardless of letter case. Preserve the existing review-ID-only behavior, including reads of patch reviews without a head. A PR number and a head remain separate lookup choices.
  4. Exercise the public command with a loopback console. Cover successful reads, inconsistent data, the default checkout HEAD, and machine-readable output. The existing review-result format and hosted contract suffice.

The CI command already checks a returned head before using a review. This change covers the read-only findings command that developers and scripts use outside that CI flow. Related CLI change

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