-
Notifications
You must be signed in to change notification settings - Fork 186
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
Set multiple sparse checkout paths in one command/job #1577
Conversation
The following pipelines have been queued for testing: |
@@ -24,15 +24,13 @@ steps: | |||
- pwsh: | | |||
git clone --no-checkout --filter=tree:0 git://github.com/${{ repo.Name }} . | |||
git sparse-checkout init | |||
git sparse-checkout set eng | |||
$paths = ('${{ convertToJson(parameters.Paths) }}' | ConvertFrom-Json) -Join ' ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting pattern. We might be able to use this to move other things into inline loop in the script block instead of having many devops steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's very useful. I could see some of our release configs being made much simpler this way (instead of iterating over artifacts).
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 (
|
For pipelines with many paths (e.g. core ci), it can be annoying to have so many separate jobs show up in the UI, one for each path. Additionally, sometimes git tries to do garbage collection and it can take a lot longer to run many
git sparse-checkout add
commands as opposed to a single set command. This PR changes the behavior to parse the yaml paths parameter object into the script, and run a single command to set the sparse checkout paths. I useinvoke-expression
here because otherwise powershell treats the space-separated string as a single parameter and it all ends up on the same line in the sparse checkout config file.