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

Sparse checkout based on commit and not based source branch #8

Open
Khayoann2 opened this issue Aug 8, 2024 · 0 comments
Open

Sparse checkout based on commit and not based source branch #8

Khayoann2 opened this issue Aug 8, 2024 · 0 comments

Comments

@Khayoann2
Copy link

Khayoann2 commented Aug 8, 2024

Hello,

We facing an issue with this ado extension.
Let me summarize it.
Imagine that your CI CD pipeline is triggered for the commit xxx and between the moment you triggered the pipeline and the moment you checkout for building your stuffs, you pass a PR, it can be really inconsistent.

Imagine this change is spread all over the solution and you build muiltiple artifacts. Depending on the timing, you will have some artifacts that will take commit xxx because last during the run, and some will take commit yyy because last at this moment.

I think it can be really complicated to manage depending of your way of working but it could be good to have the possibility to give Build.SourceVersion and filter

git clone --filter=tree:0 --no-checkout --depth $fetchDepth --sparse --no-tags --progress --no-recurse-submodules https://$accessToken@$repositoryUri .

git sparse-checkout set --sparse-index $pathsToCheckout

git fetch origin ${sourceCommit}

git checkout FETCH_HEAD

This is working!
So like this, you are sure that the contract between the pipeline execution and the checkout process is consistent.

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

No branches or pull requests

1 participant