Skip to content

feat: enhance create_patch to skip existing identical patches and apply incremental changes #1743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zelosleone
Copy link
Collaborator

WIP

# Conflicts:
#	src/source/patch.rs
#	test/end-to-end/test_create_patch.py
@wolfv wolfv requested a review from Copilot June 27, 2025 08:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enhance create_patch to skip applying patches when there are no changes and generate incremental suffix-only diffs on top of existing patches.

  • Introduce a temporary copy of the original source to apply existing patches and compute only new changes.
  • Emit full diffs when no prior patches exist, and suffix-only diffs otherwise.
  • Persist updated patch lists back to .source_info.json.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/source/create_patch.rs Incremental patch logic, temp directory handling, and updating source info
src/recipe/parser/source.rs Made UrlSource fields public to allow push of newly created patches
Comments suppressed due to low confidence (3)

src/source/create_patch.rs:83

  • Add or update the doc comment for create_patch to describe the new incremental behavior and the conditions under which full vs. suffix-only diffs are generated.
    ];

src/source/create_patch.rs:175

  • Include unit or integration tests that verify suffix-only diffs are correctly generated when existing patches are applied, as well as full diffs when none exist.
                        for entry in WalkDir::new(&target_dir)

src/recipe/parser/source.rs:390

  • [nitpick] The field holds multiple URLs but is named url; consider renaming to urls for consistency with the urls() accessor.
    pub url: Vec<Url>,

@zelosleone zelosleone marked this pull request as ready for review June 27, 2025 14:56
@zelosleone zelosleone requested a review from wolfv June 27, 2025 14:56
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.

2 participants