-
Notifications
You must be signed in to change notification settings - Fork 177
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
Conversation
The following pipelines have been queued for testing: |
The following pipelines have been queued for testing: |
Hello @azure-sdk! Because this pull request has the 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 (
|
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-runninggit 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.