Skip to content

Preserve PR context and fix dependency comment accuracy - #302

Open
lelia wants to merge 10 commits into
mainfrom
lelia/patched-version-and-pr-context
Open

Preserve PR context and fix dependency comment accuracy#302
lelia wants to merge 10 commits into
mainfrom
lelia/patched-version-and-pr-context

Conversation

@lelia

@lelia lelia commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • show API-provided patched versions in console findings and GitHub/GitLab security comments
  • detect pull request and merge request context in supported CI environments and propagate it into scan metadata
  • preserve nested GitLab repository paths and self-hosted SCM hosts when constructing change links
  • apply change links to already-compared scan pairs through duplicate updates
  • create full scans for all non-PR/MR SCM pipelines, including default-branch pushes
  • preserve added, updated, removed, and replaced dependency classifications in overview comments
  • make per-alert ignore instructions round-trip through both GitHub and GitLab, including scoped packages
  • use provider-neutral copy in shared security comments
  • bump the CLI version to 2.8.0

Implementation notes

Pull request context is resolved from explicit configuration first, then from standard provider CI variables. An explicitly supplied zero still disables association.

The diff scan link is sent with on_duplicate=update, allowing reruns of an existing before/after pair to attach the change URL. Deployments that do not support that behavior retain the existing conflict-resolution fallback.

Dependency change categories remain distinct in the report model and overview table. Alert comparison still treats updated dependencies as part of the current scan and replaced dependencies as part of the baseline, preserving the existing blocking semantics.

Generated ignore commands now include the ecosystem, while parsing remains compatible with older bare package commands and splits scoped package names from their version at the final @.

With an SCM adapter active, the detected event type is authoritative: only pull request or merge request events create diff scans. API-only diff flags cannot turn an ordinary branch pipeline into a diff scan.

Testing

  • 579 passed, 2 skipped across tests/unit and tests/core
  • Ruff and whitespace checks for all newly changed files

Refs: CE-94, CE-215, CE-337, CE-376, CE-424, CE-441

@lelia
lelia temporarily deployed to socket-firewall August 13, 2026 00:45 — with GitHub Actions Inactive
@lelia
lelia force-pushed the lelia/patched-version-and-pr-context branch from e3e708b to 695703b Compare September 2, 2026 23:10
@lelia
lelia marked this pull request as ready for review September 2, 2026 23:10
@lelia
lelia requested a review from a team as a code owner September 2, 2026 23:10
@lelia
lelia force-pushed the lelia/patched-version-and-pr-context branch from 695703b to 3cd0355 Compare September 2, 2026 23:12
@lelia
lelia deployed to socket-firewall September 2, 2026 23:13 — with GitHub Actions Active
@lelia
lelia marked this pull request as draft September 3, 2026 18:50
lelia and others added 9 commits September 3, 2026 15:12
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The GitHub comment adapter and pull request link construction each parsed
BUILDKITE_REPO independently. Consolidate on socketsecurity.core.git_remote,
which also reports the remote host (needed for self-hosted GitHub Enterprise
and GitLab) and preserves nested GitLab subgroup paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
external_href is only honored while a diff scan is being created, so a
re-run over the same before/after pair left the Dashboard report with no
link back to its pull request. Send on_duplicate=update alongside it, which
applies the link to the existing diff scan and answers 200 with the same
envelope as a create.

The 409-and-resolve path is retained for runs with no pull request context
and for deployments that predate on_duplicate=update.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lelia
lelia force-pushed the lelia/patched-version-and-pr-context branch from 3cd0355 to 0e03a6f Compare September 3, 2026 19:14
@lelia
lelia deployed to socket-firewall September 3, 2026 19:14 — with GitHub Actions Active
@lelia lelia changed the title Show patched versions and preserve pull request context Preserve PR context and fix dependency comment accuracy Sep 3, 2026
@lelia
lelia deployed to socket-firewall September 3, 2026 22:46 — with GitHub Actions Active
@lelia
lelia marked this pull request as ready for review September 3, 2026 22:53
@lelia
lelia deployed to socket-firewall September 3, 2026 22:54 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant