Skip to content

feat(review): Add repository URI to SARIF versionControlProvenance #2101

Closed

Description

@dan-petty

Friction

The SARIF export of a review (#1983) writes no versionControlProvenance. SARIF 2.1.0 says it SHALL have a repositoryUri (section 3.23.3), and a ToolRun names the commit but not the repository. A -dirty commit is not a revision of the scanned files (section 3.23.4).

What should happen

  • A ToolRun names the repository URI of the checkout, read from git, with no credential in it.
  • The SARIF export writes versionControlProvenance with repositoryUri and revisionId for a commit that is not dirty, and writes none for a dirty one.

Evidence

  • OASIS SARIF 2.1.0 Errata 01, sections 3.23.3 and 3.23.4.
  • src/devops_cli/security/tool_executor.py: ToolRun holds commit and no repository.

Source: #1983

Proposed design

Problem statement

The SARIF export of a review writes no versionControlProvenance. SARIF 2.1.0 requires a repositoryUri in that object (section 3.23.3). The ToolRun record holds the commit but not the repository. A commit that ends with -dirty is not a valid revision of the scanned files (section 3.23.4). This issue adds the repository URI to ToolRun and makes the SARIF export write versionControlProvenance for clean commits.

Acceptance criteria

  • Criterion 1: ToolRun has a repository_uri field of type str | None.
    Verification: Inspect the ToolRun class in src/devops_cli/security/tool_executor.py and confirm the field exists with the correct type.
  • Criterion 2: The repository URI is read from git and has no credential in it.
    Verification: Run a tool on a checkout whose remote URL contains a token. Confirm ToolRun.repository_uri has no user:password@ part.
  • Criterion 3: The SARIF export writes versionControlProvenance with repositoryUri and revisionId when the commit is not dirty.
    Verification: Run a review on a clean checkout. Parse findings.sarif and confirm versionControlProvenance has both repositoryUri and revisionId.
  • Criterion 4: The SARIF export writes no versionControlProvenance when the commit is dirty or None.
    Verification: Run a review on a checkout with uncommitted changes in a target. Parse findings.sarif and confirm versionControlProvenance is absent.
  • Criterion 5: When the checkout has no remote, repository_uri is None and no versionControlProvenance is written.
    Verification: Run a tool on a git checkout with no remote configured. Confirm ToolRun.repository_uri is None and the SARIF has no versionControlProvenance.

Key questions

  • Which git command reads the repository URI?: Use git remote get-url origin, run through the existing _git helper. When no remote is configured, the field is None. (proposed)
  • Where is the SARIF export code?: The export is devops_cli.security.sarif.to_sarif, as stated in the module docstring of tool_executor.py. [sources: src/devops_cli/security/tool_executor.py]
  • Does the SARIF schema require repositoryUri in versionControlDetails?: Yes. The vendored schema lists repositoryUri as a required property of versionControlDetails. [sources: tests/fixtures/sarif-schema-2.1.0.json:2941]
  • What happens when the checkout has no remote?: repository_uri is None, and the SARIF export writes no versionControlProvenance. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/feature. The candidate proposes a new feature to improve SARIF export capabilities.
    • Priority: P2-Medium. The change improves compliance with SARIF standards but does not fix a defect or security issue.
    • Value: Medium. The change helps users better understand where findings came from and ensures standard compliance.
    • Effort: Medium. The change requires modifying how ToolRun handles repository information and updating SARIF export logic.
    • Related: feat(review): a tool run records its exit code and its success, and the SARIF export writes one invocation for each run #2100, which asks for a different change. Both items work on SARIF export but the first adds version control provenance while the second adds invocation information.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/medium
    on Oct 28, 2026
  5. 3 remaining items

  6. added
    status/planned
    and removed
    status/ready
    on Nov 2, 2026
  7. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 6, 2026
  8. removed
    status/in-review
    on Nov 6, 2026
  9. changed the title [-]feat(review): a tool run names the repository of the checkout, and the SARIF export writes its version control provenance[/-] [+]feat(review): Add repository URI to SARIF versionControlProvenance[/+] on Nov 6, 2026
  10. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 107 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(review): a tool run names the repository of the checkout, and the SARIF export writes its version control provenance
    • After: feat(review): Add repository URI to SARIF versionControlProvenance
    • Source of the summary: the background model
  11. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 16:15 UTC

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

    effort/mediumpriority/p2-mediumscope/reviewsource/agenttype/featurevalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions