Skip to content

Add git config protocol.file.allow=always to tests#1895

Merged
triarius merged 5 commits intomainfrom
triarius/fix-local-git-submodule-test
Jan 2, 2023
Merged

Add git config protocol.file.allow=always to tests#1895
triarius merged 5 commits intomainfrom
triarius/fix-local-git-submodule-test

Conversation

@triarius
Copy link
Contributor

@triarius triarius commented Dec 31, 2022

This was disabled upstream due to a security vulnerability in git. That caused the test TestCheckingOutLocalGitProjectWithSubmodules to fail. It has only been passing in CI because we run a version of git in CI that did not receive the patch.

One solution would have been to set protocol.file.allow=always globally. However, that would mean that anyone who ran the tests would expose their environment to that vulnerability, and permanently if the global config were not unset afterwards.

Thus, in this PR, the config is only applied for the commands that need it. As one such command was in the default checkout hook, a configuration option was added so that the config would only be enabled in the test that needed it.

There is also some very minor clone cleanup in a separate commit.

This was disabled due to a [security vulnerability in git](https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253).
The test TestCheckingOutLocalGitProjectWithSubmodules was only passing in CI because we run version of git in CI that did not receive the patch.

One solution would have been to set protocol.file.allow=always globally. However, that would mean that anyone who ran the tests would expose their
enviroment to that vulnerability, and permanently if the global config was not unset afterwards.
@triarius triarius requested a review from a team January 2, 2023 23:04
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

Looking good!

@triarius triarius enabled auto-merge January 2, 2023 23:31
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@triarius triarius merged commit 2de8868 into main Jan 2, 2023
@triarius triarius deleted the triarius/fix-local-git-submodule-test branch January 2, 2023 23:54
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