Skip to content
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

fix issues with applying PR patch in --from-pr #3414

Merged
merged 15 commits into from
Aug 18, 2020

Conversation

Flamefire
Copy link
Contributor

When PRs introduce only new files determining the patch level fails which makes it skip the whole git am part even though the level is not even required. Hence as a first part of the fix the level determination is skipped when using git to apply the patch.

Secondly git am requires an active git repo but we download the base branch via the archive, not a clone. Also the parameter patch is likely wrong as I can't find it in the docu. Hence replace that with git apply which does work for regular folders too.

Fixes #3411

@boegel boegel changed the title Fix applying a patch from a PR via git fix issues with applying PR patch in --from-pr Aug 18, 2020
easybuild/tools/filetools.py Outdated Show resolved Hide resolved
@boegel boegel added the bug fix label Aug 18, 2020
@boegel boegel added this to the next release (4.2.3?) milestone Aug 18, 2020
@Flamefire Flamefire force-pushed the fix_git_patch_permissions branch from 0d55a77 to 176028d Compare August 18, 2020 10:20
@Flamefire Flamefire force-pushed the fix_git_patch_permissions branch from 1955deb to 75c1f62 Compare August 18, 2020 10:27
easybuild/tools/filetools.py Outdated Show resolved Hide resolved
easybuild/tools/filetools.py Outdated Show resolved Hide resolved
Flamefire and others added 3 commits August 18, 2020 12:53
Co-authored-by: Kenneth Hoste <[email protected]>
Changing into the directory of the patch is not required and might even lead to unexpected results
as calling code will suddenly run in a different PWD if the patch happens to be compressed
easybuild/tools/filetools.py Outdated Show resolved Hide resolved
Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

We need to get this covered by the tests too, done in Flamefire#3

boegel and others added 2 commits August 18, 2020 15:51
test/framework/options.py Outdated Show resolved Hide resolved
@boegel boegel merged commit e6e8f23 into easybuilders:develop Aug 18, 2020
@Flamefire Flamefire deleted the fix_git_patch_permissions branch August 19, 2020 08:14
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.

--from-pr does not (correctly) set the permissions
2 participants