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

Refactor sparse checkout template: idempotency and no yaml loops #1627

Merged
2 commits merged into from
May 25, 2021
Merged

Refactor sparse checkout template: idempotency and no yaml loops #1627

2 commits merged into from
May 25, 2021

Conversation

benbp
Copy link
Member

@benbp benbp commented May 24, 2021

This updates the sparse checkout template to be able to be called multiple times with new paths/repositories, and handle already cloned/checked out repositories.

Running git sparse-checkout add multiple times, as opposed to a single time with multiple arguments, can take a significantly longer amount of time. Similarly, re-running git sparse-checkout set may or may not lose context from earlier pipeline steps which may have iteratively built up all required paths for a given build/test run.

The change to this script handles all above conditions, and also gets rid of all the template looping constructs. By only using powershell logic (aside from convertToJson), the script is easier to test locally, and also no longer adds many steps to the job output page when there are a lot of repositories to be checked out.

Finally, this code can't actually be stored as a separate script file, because then there is a chicken/egg problem with checkout out the script in order to run it in order to check out the repo.

@benbp benbp requested a review from a team as a code owner May 24, 2021 20:28
@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@ghost
Copy link

ghost commented May 25, 2021

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 38f3bc3 into Azure:master May 25, 2021
@benbp benbp deleted the benbp/sparse-checkout-script branch May 25, 2021 20:56
This pull request was closed.
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.

3 participants