Fix VCS template build flow (empty source)#10966
Conversation
📝 WalkthroughWalkthroughThe pull request modifies the template cloning logic in the Builds worker module. The change replaces the templateVersion-based approach with templateReferenceType and templateReferenceValue-based approach. The condition for template cloning now requires repositoryName, ownerName, templateReferenceType, and templateReferenceValue to be non-empty. The clone command invocation parameters have been updated to use the new reference type and value instead of the previous templateVersion and CLONE_TYPE_TAG constant. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
✨ Benchmark results
⚡ Benchmark Comparison
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the template build flow when using VCS repositories with templates. The issue was that the VCS+Template code path was still using the deprecated version attribute instead of the current referenceType and referenceValue attributes, causing builds to fail with empty source code.
Key Changes
- Updated template attribute access from
versiontoreferenceTypeandreferenceValuein the VCS+Template build path - Modified the validation condition to check for the new attributes
- Corrected the
generateCloneCommandparameters to use the new attributes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this PR do?
Fixes flow when tempalte is used with VCS repository, causing build to fail with no source code, and repository being created empty.
Test Plan
Manual QA (first bug reproduced, them fix implemented, then works as expected)
CleanShot.2025-12-16.at.11.22.21.mp4
Related PRs and Issues
Original implementation that missed a spot in the build worker: https://github.com//appwrite/appwrite/commit/2b1e3bd9477941431f3f5055ea118b1fe62e9067
Checklist