DEV3-5281: Make checkout clone depth configurable across CI providers#34
Conversation
The built-in review uses the gh/GitLab/Bitbucket REST APIs and does not need local git history, so full-history clones were unnecessary overhead on large repos. Expose the clone depth per platform using each platform's idiomatic mechanism, with shallow defaults matching platform natives, and align the documentation wording across all three providers. - GitHub: fetch-depth reads TABNINE_FETCH_DEPTH repo variable (default 1) - GitLab: GIT_DEPTH default "20", overridable via CI/CD variable - Bitbucket: clone.depth: 50 (literal; no variable substitution supported) - README: aligned two-sentence description pattern across all providers; added Optional Variables table to the GitHub section for parity
Tabnine PR Bot[Low Risk] What This PR Does Assessment Key Findings What Looks Good
Review metadata
|
| # for the built-in review (it uses the 'gh' API, not local git history). | ||
| # Set the repository variable TABNINE_FETCH_DEPTH to "0" for full history, or another value, if your | ||
| # custom prompt_override inspects local git history (e.g. git log, git blame, git diff base..head). | ||
| fetch-depth: ${{ vars.TABNINE_FETCH_DEPTH || 1 }} |
There was a problem hiding this comment.
After thinking about it some more, maybe we don't need to checkout at all.
If the workflow using the action has already checked out the repo, as most do, this is redundant.
I'm thinking not checking out at all and documenting it in the README. WDYT?
There was a problem hiding this comment.
this is a standalone workflow that needs to pull the code. the composite action ( action.yml) doesn't include this
What
Make clone depth configurable and consistently documented across all three CI providers (GitHub Actions, GitLab CI, Bitbucket Pipelines).
Why
The built-in review uses the
gh/ GitLab / Bitbucket REST APIs and does not need local git history —base_shaandhead_shaare passed as explicit inputs. The previousfetch-depth: 0recommendation was unnecessary overhead, especially on large monorepos. Users who legitimately need full history (customprompt_overridethat inspects local git) now have a clean, documented opt-in.Changes
GitHub/tabnine-review.yml):fetch-depth: ${{ vars.TABNINE_FETCH_DEPTH || 1 }}— override via repo variableTABNINE_FETCH_DEPTH.GitLab/.gitlab-ci.yml):GIT_DEPTH: "20"default — override via CI/CD variableGIT_DEPTH.Bitbucket/bitbucket-pipelines.yml): explicitclone.depth: 50— platform does not support variable substitution, so override means editing the file.action.yml: intentionally unchanged.actions/checkoutruns in the caller workflow before the composite action, so the composite cannot control clone depth.Defaults
All three defaults match each platform's native default, so existing users see no behavior change.
Jira
DEV3-5281