Why are my Spacelift builds not triggering on PR for large repositories?

Last updated: September 9, 2025

Context

When working with large repositories in Spacelift, you might encounter situations where builds are not being triggered on Pull Requests (PRs). This typically happens when the repository size exceeds certain limits, causing timeout issues during the build initialization process.

Answer

If Spacelift builds are not triggering on PRs for a specific repository, this may be due to repository size limitations. When Spacelift triggers a build, your Version Control System (VCS) must package the entire repository as a compressed archive. If the repository is too large (containing LFS files, numerous modules, or many tags), this process may exceed the VCS-Agent's 30-second HTTP timeout limit.

To diagnose if repository size is the issue:

  1. Test downloading the repository archive using curl to check the download time:

    curl -I -L 'https://your-bitbucket.example.com/rest/api/1.0/projects/YOUR-PROJECT/repos/YOUR-REPO/archive?at=main&format=zip'
  2. If the download time exceeds 30 seconds, your repository is likely too large for the current timeout limits.

To resolve this issue:

  1. Review and clean up your repository:

    • Remove unnecessary large files

    • Consider using Git LFS more selectively

    • Clean up old tags and branches

    • Consider splitting the repository into smaller, more manageable modules

Note: Smaller repositories in the same VCS instance should continue to work normally, as they can be packaged within the timeout limit.