Skip to content

Fix cross-PR contamination by cleaning after checkout - #2832

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
StephanTLavavej:decontamination
Jul 1, 2022
Merged

Fix cross-PR contamination by cleaning after checkout#2832
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
StephanTLavavej:decontamination

Conversation

@StephanTLavavej

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) commented Jun 29, 2022

Copy link
Copy Markdown
Member

This should fix #396 - see my analysis there.

I initially wanted to annihilate the entire workspace with workspace: clean: all. While I believe that would be effective and simpler to reason about (making reused machines perform completely fresh clones), it would be slower when machines are reused. Even though the actual time savings are rather small (~15 seconds), the total machine time across many VMs is more significant.

This uses git clean --quiet -x -d -f -f with two force options because we want to clean up any leftover submodules; git will refuse to do that if there's only one force option. (--quiet suppresses potentially voluminous log output which we aren't interested in.)

This also makes a vaguely related change to the submodule checkout scripts. They now use two force options for consistency (even though we aren't worried about nested submodules), and this changes boost-math to follow llvm-project's commands more closely. It replaces git checkout -f FETCH_HEAD with git reset --quiet --hard FETCH_HEAD; they have the same effect, but the latter avoids emitting the "detached HEAD" warning. It also adds a clean command.

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the infrastructure Related to repository automation label Jun 29, 2022
Comment thread azure-devops/checkout-sources.yml Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member Author

Casey Carter (@CaseyCarter) I added the double-force options and updated the PR description.

@StephanTLavavej

Copy link
Copy Markdown
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

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

Labels

infrastructure Related to repository automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub: File validation interacts badly with PRs adding submodules

2 participants