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

Support sparse checkout #5015

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Support sparse checkout #5015

merged 2 commits into from
Oct 16, 2024

Conversation

jnilau
Copy link
Contributor

@jnilau jnilau commented Oct 14, 2024

Support for new YAML checkout task properties sparseCheckoutDirectories and sparseCheckoutPatterns to trigger a git sparse-checkout

If agent knob AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK is not set, then agent will not initialize sparse-checkout regardless of whether the properties have values or not.

If agent knob AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK is set to true and one of the properties are set, then agent will initialize the sparse-checkout process. sparseCheckoutDirectories will trigger cone mode where the checkout process will use directory-matching while sparseCheckoutPatterns will trigger non-cone mode and allow for more complicated pattern-matching. Agent will initialize cone mode and directory matching if both properties are set.

If agent knob AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK is set to true and both properties are empty, then agent will disable the sparse-checkout process.

Issues while running the command will also fail the checkout task so that users can investigate the error.

YAML example for cone mode:

- checkout: repo
  sparseCheckoutDirectories: src

YAML example for non-code mode:

- checkout: repo
  sparseCheckoutPatterns: /* !img

@jnilau jnilau requested review from a team as code owners October 14, 2024 23:06
Copy link
Contributor

@merlynomsft merlynomsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comments (see above)

@jnilau jnilau merged commit a54d86b into master Oct 16, 2024
20 checks passed
@jnilau jnilau deleted the users/jnilau/support-sparse-checkout branch October 16, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants