Skip to content

Reuse the cloned branch when pushing a template into a repository #14550

Closed

Description

@ChiragAgg5k

Tracks PR #14549.

Plan

Goal: Stop template deployments into a connected repository from failing with fatal: a branch named 'main' already exists when the Builds worker tries to git checkout -b a branch that the clone already has checked out.

What changes:

  • PR #14549 — src/Appwrite/Platform/Modules/Functions/Workers/Builds.php: change the post-merge push prep from git checkout -b <providerBranch> to git checkout -B <providerBranch> so a branch clone is a no-op and a commit clone (detached HEAD) still creates the branch at that commit.
  • tests/e2e/Services/VCSGitea/VCSGiteaConsoleClientTest.php — new testCreateTemplateDeploymentIntoRepository (data provider covers tag → branch clone and branch → commit clone) asserting ready build, template commit on main, matching providerCommitHash, and template files present.
  • .github/ci/e2e.json — VCSGitea lane also claims Functions/Workers/Builds.php so the suite runs on Builds worker changes.

Remaining steps: None. The linked PR is the full change. Follow-on from #14137 (wildcard tag clone fix, already in cloud 1.50.182) which surfaced this push-path bug.

Done when:

Activity

  1. self-assigned this
    on Oct 15, 2026
  2. added
    product / functions
    product / messaging
    product / storage
    product / vcs
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

product / functionsproduct / messagingproduct / storageproduct / vcs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions