Skip to content

Ignore unmodified files when using --new-pr or --update_pr#4753

Open
Flamefire wants to merge 8 commits intoeasybuilders:developfrom
Flamefire:better-new-pr
Open

Ignore unmodified files when using --new-pr or --update_pr#4753
Flamefire wants to merge 8 commits intoeasybuilders:developfrom
Flamefire:better-new-pr

Conversation

@Flamefire
Copy link
Copy Markdown
Contributor

@Flamefire Flamefire commented Feb 4, 2025

When including an unmodified EasyConfig with --new-pr an error is shown that a commit message is required because this EC is modified which is not the case.

Adjust the copy_* functions to ignore any unmodified file. This especially omits them in the file_info struct returned that is then used to determine commit message/title etc.

Fixes #4751

Note: While working on this I noticed that new EasyConfigs that are dependencies of added EasyConfigs are ignored in the commit message. I propose to populate file_info instead of the dep_info at

This would also fix the possibly incomplete debug log message Staging all <n> new/modified easyconfigs that doesn't account for those ECs.

Note: View without whitespace changes due to changed indent.

I noticed that when you pass only unmodified Easyconfigs it will crash when trying to determine a label for the branch. This can only be caught in a test actually opening a new PR (in dry-run) so I extended the new_pr/update_pr test.
This increased the time of this (single) test from 58s to 72s.
As most of the time is spent in git fetch I did some mocking to bring the time down to 38s

@boegel boegel added the bug fix label Feb 12, 2025
@boegel boegel added this to the release after 4.9.4 milestone Feb 12, 2025
@boegel boegel modified the milestones: release after 4.9.4, release after 5.0.0 Mar 17, 2025
@boegel boegel modified the milestones: 5.1.1, release after 5.1.1 Jul 3, 2025
@Flamefire Flamefire force-pushed the better-new-pr branch 2 times, most recently from eeb9ded to 0ef5fd2 Compare July 30, 2025 08:29
@Flamefire
Copy link
Copy Markdown
Contributor Author

Rebased

@boegel
Copy link
Copy Markdown
Member

boegel commented Aug 13, 2025

@Flamefire Another merge conflict to fix...

When including an unmodified EasyConfig with `--new-pr` an error is
shown that a commit message is required because this EC is modified
which is not the case.

Adjust the `copy_*` functions to ignore any unmodified file.
This especially ommits them in the `file_info` struct returned that is
then used to determine commit message/title etc.

Fixes easybuilders#4751
@Flamefire
Copy link
Copy Markdown
Contributor Author

Rebased only

@Flamefire Flamefire marked this pull request as draft April 10, 2026 07:12
When all passed easyconfigs got filtered out creating the branch label
fails with an IndexError.
Catch this case early.
Avoid calling `git fetch` muliple times by mocking that call and copy
the existing remote directory.
@Flamefire
Copy link
Copy Markdown
Contributor Author

I noticed that when you pass only unmodified Easyconfigs it will crash when trying to determine a label for the branch. This can only be caught in a test actually opening a new PR (in dry-run) so I extended the new_pr/update_pr test.
This increased the time of this (single) test from 58s to 72s.
As most of the time is spent in git fetch I did some mocking to bring the time down to 38s

@Flamefire Flamefire marked this pull request as ready for review April 10, 2026 13:52
@Flamefire
Copy link
Copy Markdown
Contributor Author

Ok, that seems to work now. I'd say we should get this in soon to be able to catch any remaining issues/corner cases I didn't think of. @boegel ?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--new-pr with existing file leads to error even if not modified

2 participants