Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Use sparse checkout for generate matrix job #1452
Use sparse checkout for generate matrix job #1452
Changes from 1 commit
6f53ea8
8a6da6c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a reason to parameterize this?
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.
The reason I have it this way is I want the
/eng/common/scripts/job-matrix/samples/matrix-test.yml
to be a working sample (partly because non-working samples are bad, and because I use it for testing changes like these). Since I test this sample pipeline in the playground project, it doesn't have access to the 1es pool, hence why I need to override the pool/image.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.
I'm not sure if it is better to check against the pipeline or repo name? I have a slight preference for the repo name so we aren't as dependent on someone failing to name their pipeline correctly.
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.
Repo name isn't available at template build time :(
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.
#1452 (comment)
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.
booo... I guess we will have to see how this works out. I don't like how loosely coupled this is.
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.
I suspect this is going to come back to bite us once we start using it in more places in the private repos, but for now I guess we can start here and then reconsider other options if we hit an issue.
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.
Yeah, I'm not a fan of this approach but can't find an alternative. My thinking is also that the
pr
repos are right now our only standardized name private repos, and people that need to do temporary feature/pre-release testing can just keepSparseCheckout: false
in their branch until they need to go live.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.
It would be nice if they didn't have to have a code commit that would need to be undone once the merge to public. We could consider a pipeline variable that someone could set to opt-in/out of this but lets see if any when this becomes an issue.
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.
The variable would make the template harder to define since we'd have to use a condition. I was using a
SparseCheckout
top-level parameter myself for testing, but if I had to check-enable it every time for private repo testing I think I would end up making a commit anyway as part of my workflow.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.
It is probably worth adding the repository as a template parameter as I believe this template will be interesting for pipelines we clone multiple pipelines.
I also suggest adding a template parameter for the working directory for these steps so folks can control where this clone happens.
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.
I added a repositories object, since with multiple repos we need to pair the working directory with the repo name and commit-ish. Also, I set the default the way it is so that when no repo is specified, we just checkout into the default location, this way any calling template doesn't need to manually specify
WorkingDirectory
when there's only one repo.