Skip to content

fix(labels): recover omitted patches from the raw PR diff - #5590

Open
purp wants to merge 1 commit into
NVIDIA:mainfrom
purp:fix/5583-label-patch-fallback/purp
Open

purp wants to merge 1 commit into
NVIDIA:mainfrom
purp:fix/5583-label-patch-fallback/purp

Conversation

@purp

@purp purp commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recover missing or incomplete /label-issue patches from GitHub's raw PR diff. Complete evidence can proceed through the existing preview and apply checks; failed recovery continues to block label writes.

Related Issue

Closes #5583

Relates to #5151 and #5276.

Changes

  • Fetch one raw diff per files refresh when per-file patches are incomplete. Match old/new file paths, validate every hunk and changed-line count, and verify the prepared head/base around fetching.
  • Record recovery provenance, source digest, byte count and revisions. Preserve partial coverage with a diagnostic when recovery fails.
  • Preserve raw response line endings and reject invalid UTF-8. Retain transport size, timeout, retry and mutation protections.
  • Document recovery in the /label-issue command reference.

The existing 2 MiB response bound applies. Binary or metadata-only changes without text hunks remain partial; classifier context budgeting is separate.

Release Notes

Testing

  • 197 offline labeling tests pass with warnings treated as errors: uv run --no-project --offline --python /usr/bin/python3 python -W error -m unittest discover -s tasks/scripts -p 'label_issue*_test.py' -q.
  • Added recovery, file identity, truncation, malformed input, revision race, transport, and preview/apply coverage. Failed recovery produces no writes in the application test.
  • Read-only live preparation recovered the omitted patches on feat(policy): add managed maximum permission modes #2168 (crates/openshell-server/src/grpc/policy.rs) and feat(api)!: model CPU and memory as typed compute resource requirements #3012 (sdk/go/proto/openshellv1/openshell.pb.go), with complete files coverage. No live labels changed.
  • Ruff lint/format checks and git diff --check pass for the changed files.
  • Reviewed related contributor guidance using the sync-agent-infra maintenance map and reviewed the diff with omit-needless-words; no further changes required.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Relevant labeling workflow documentation updated

Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Nov 15, 2026

This branch has not been deployed

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

Labels

state:accepted A maintainer decided OpenShell should pursue this issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(labels): fall back when GitHub omits per-file patches

1 participant