Skip to content

Use treeless partial clone in initial checkout.#135

Merged
asutosh merged 1 commit into
mainfrom
fix/dep-guard-optimisation
Jun 5, 2026
Merged

Use treeless partial clone in initial checkout.#135
asutosh merged 1 commit into
mainfrom
fix/dep-guard-optimisation

Conversation

@asutosh

@asutosh asutosh commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

A treeless clone should be enough for the git
operations we use. It should speed up the initial clone,
and since we don't need to fetch a lot of tree objects
on the further operations in dependency guard, it should
be faster in those subsequent operations too.

How was this tested

A treeless clone should be enough for the git
operations we use. It should speed up the initial clone,
and since we don't need to fetch a lot of tree objects on
the further operations in dependency guard, it should be
faster in those subsequent operations too.

Signed-off-by: Asutosh <asutosh@tyk.io>
@asutosh
asutosh requested a review from a team June 5, 2026 06:15
@probelabs

probelabs Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a performance optimization to the dependency-guard GitHub Actions workflow by enabling a treeless partial clone during the initial checkout step.

By adding filter: tree:0 to the actions/checkout configuration, the workflow will now clone the repository without downloading Git tree objects. This is expected to reduce the initial clone time and speed up subsequent Git operations within the job, as less data is transferred from the repository.

Files Changed Analysis

  • .github/workflows/dependency-guard.yml: A single line was added to this workflow file to enable the treeless clone feature in the checkout action.

Architecture & Impact Assessment

  • Accomplishment: The PR aims to decrease the execution time and resource consumption of the dependency-guard CI workflow.
  • Technical Change: It leverages Git's partial clone capability by setting filter: tree:0. This is a targeted optimization for CI environments where the full directory history (tree objects) is not required for the job's tasks.
  • Affected Components: The change is confined to the dependency-guard CI workflow. There is no impact on production code or other systems. The primary effect is on CI performance.

Scope Discovery & Context Expansion

  • The immediate impact is limited to the dependency-guard workflow. However, this change sets a precedent for a performance optimization pattern that could be applied to other workflows in this repository.
  • The subsequent step in the workflow, Check for dependency changes, relies on git diff to compare the current branch with the base branch. A treeless clone is compatible with this operation, as it only requires commit data and the file contents (blobs) of the relevant commits, not the historical tree objects.
Metadata
  • Review Effort: 1 / 5
  • Primary Label: chore

Powered by Visor from Probelabs

Last updated: 2026-06-05T06:17:37.403Z | Triggered by: pr_opened | Commit: 056fc8b

💡 TIP: You can chat with Visor using /visor ask <your question>

@probelabs

probelabs Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

✅ Security Check Passed

No security issues found – changes LGTM.

✅ Security Check Passed

No security issues found – changes LGTM.

\n\n

✅ Architecture Check Passed

No architecture issues found – changes LGTM.

Quality Issues (1)

Severity Location Issue
🟡 Warning .github/workflows/dependency-guard.yml:24
The use of `filter: tree:0` enables a treeless partial clone, which can affect the behavior of subsequent git commands. It is important to verify that the `tyk-actions/dependency-guard` action is fully compatible with this checkout strategy. Without verification, this optimization could potentially cause the dependency check to fail or produce incorrect results.
💡 SuggestionConfirm that this workflow change has been tested in a fork where the `dependency-guard` job was triggered and completed successfully. Provide a link to the successful test run in the pull request description to ensure this optimization is safe to merge.

Powered by Visor from Probelabs

Last updated: 2026-06-05T06:17:24.451Z | Triggered by: pr_opened | Commit: 056fc8b

💡 TIP: You can chat with Visor using /visor ask <your question>

@asutosh
asutosh requested a review from konrad-sol June 5, 2026 06:32
@asutosh

asutosh commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

/visor the quality issue mentioned has been tested and verified, close the alerts.

@probelabs

probelabs Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Powered by Visor from Probelabs

Last updated: 2026-06-05T12:13:57.577Z | Triggered by: asutosh | Commit: 6ac3245

💡 TIP: You can chat with Visor using /visor ask <your question>

@asutosh
asutosh merged commit 771831a into main Jun 5, 2026
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants