Skip to content

Deduplicate oversized Code Scanning Fixer patches - #50059

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-add-patch-size-dedup-backoff
Aug 3, 2026
Merged

Deduplicate oversized Code Scanning Fixer patches#50059
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-add-patch-size-dedup-backoff

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Scanning Fixer repeatedly submitted the same ~41 MB binary-removal patch against a 4 MB safe-output cap. Unchanged alerts now avoid repeated remediation attempts after an oversized patch is detected.

  • Oversized-patch preflight

    • Measures the complete binary diff before emitting create-pull-request.
    • Skips PR creation, discards local edits, and emits noop when the patch exceeds 4,096 KB.
  • Persistent alert deduplication

    • Stores oversized outcomes with alert fingerprint, measured size, cap, and timestamp.
    • Excludes alerts with a matching cached fingerprint on future runs.
    • Reconsiders alerts when rule, location, or message changes.
  • Restricted shell access

    • Allows only git diff, git restore, and wc for patch measurement and cleanup.
{
  "alert_number": 123,
  "fingerprint": "...",
  "outcome": "patch_too_large",
  "patch_bytes": 42416128,
  "max_patch_bytes": 4194304
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add patch-size dedup and backoff to Code Scanning Fixer Deduplicate oversized Code Scanning Fixer patches Aug 3, 2026
Copilot AI requested a review from pelikhan August 3, 2026 18:45
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PR Triage: #50059

  • Category: bug
  • Risk: medium
  • Score: 50/100 (Impact 28 + Urgency 10 + Quality 12)
  • Recommended action: defer
  • Batch: pr-batch:draft-small

Draft PR, no CI runs yet. Fixes safe-output cap deduplication for Code Scanning Fixer patches. Will re-assess once CI runs and draft is marked ready.

Generated by 🔧 PR Triage Agent · auto · 51.1 AIC · ⌖ 4.08 AIC · ⊞ 8K ·

@pelikhan
pelikhan marked this pull request as ready for review August 3, 2026 19:03
Copilot AI review requested due to automatic review settings August 3, 2026 19:03
@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot do not package lock file changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds oversized-patch preflight and cached alert deduplication to Code Scanning Fixer.

Changes:

  • Measures patches against the 4 MB limit.
  • Caches oversized outcomes using alert fingerprints.
  • Adds restricted shell commands for measurement and cleanup.
Show a summary per file
File Description
.github/workflows/code-scanning-fixer.md Adds preflight, deduplication, and cleanup instructions.
.github/workflows/code-scanning-fixer.lock.yml Regenerates the compiled workflow and tool permissions.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

### 7. Create Pull Request

Before emitting `create-pull-request`, preflight the complete generated patch, including binary removals:
- Measure `git diff --binary --no-ext-diff` in bytes. The default `create-pull-request` safe-output limit is 4,096 KB (4,194,304 bytes).
- shared/otlp.md
tools:
cli-proxy: true
bash: ["git diff:*", "git restore:*", wc]
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot do not package lock file changes

Removed the generated lock-file changes in ff3b296.

@pelikhan
pelikhan merged commit bb74b8e into main Aug 3, 2026
@pelikhan
pelikhan deleted the copilot/deep-report-add-patch-size-dedup-backoff branch August 3, 2026 20:05
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.4

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Add patch-size dedup/backoff to Code Scanning Fixer for binary-removal alerts

3 participants