Skip to content

Fix VCS template build flow (empty source)#10966

Merged
Meldiron merged 1 commit into1.8.xfrom
fix-empty-template
Dec 16, 2025
Merged

Fix VCS template build flow (empty source)#10966
Meldiron merged 1 commit into1.8.xfrom
fix-empty-template

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

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

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

The 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

  • Verify that the new condition logic correctly validates all four required parameters (repositoryName, ownerName, referenceType, referenceValue)
  • Confirm that the clone command signature and expected parameters align with the new templateReferenceType and templateReferenceValue values
  • Check that all calling code and callers of this function have been updated to provide the new parameter names
  • Assess the impact of removing templateVersion and GitHub::CLONE_TYPE_TAG references on downstream template cloning behavior

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix CSV template build flow (empty source)' directly relates to the changeset's main purpose: fixing the build flow when templates are used with VCS repositories to prevent empty source code issues.
Description check ✅ Passed The description explains the bug fix (template with VCS repository causing build failures and empty repositories), includes testing methodology (manual QA), and references the original implementation—all relevant to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-empty-template

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfccbd0 and 850a834.

📒 Files selected for processing (1)
  • src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (1 hunks)
⏰ 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)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan
🔇 Additional comments (3)
src/Appwrite/Platform/Modules/Functions/Workers/Builds.php (3)

438-439: LGTM! Proper retrieval of template reference attributes.

These lines correctly retrieve the template reference type and value, matching the pattern used in the non-VCS template path (lines 317-318). This ensures consistency across both code paths.


446-446: LGTM! Condition now consistent with non-VCS path.

The updated condition correctly validates all required template fields before cloning. This matches the non-VCS template logic (line 325) and prevents template cloning attempts with incomplete configuration.


450-450: LGTM! Template cloning now uses reference-based approach.

The generateCloneCommand call at line 450 correctly uses templateReferenceValue and templateReferenceType, aligning with the non-VCS template path at line 332. Both template cloning paths now consistently use the reference-based approach.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Meldiron Meldiron requested a review from stnguyen90 December 16, 2025 10:25
@github-actions
Copy link
Copy Markdown

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libpng 1.6.51-r0 CVE-2025-66293 HIGH
libpng-dev 1.6.51-r0 CVE-2025-66293 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@github-actions
Copy link
Copy Markdown

✨ Benchmark results

  • Requests per second: 1,130
  • Requests with 200 status code: 203,421
  • P99 latency: 0.174038579

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,130 1,176
200 203,421 211,730
P99 0.174038579 0.175654908

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 version to referenceType and referenceValue in the VCS+Template build path
  • Modified the validation condition to check for the new attributes
  • Corrected the generateCloneCommand parameters to use the new attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Meldiron Meldiron merged commit 546cd65 into 1.8.x Dec 16, 2025
49 checks passed
@stnguyen90 stnguyen90 changed the title Fix CSV template build flow (empty source) Fix VCS template build flow (empty source) Dec 16, 2025
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.

3 participants