Back

Function deploys from wrong git branch

  • 0
  • Web
Wintermutation
8 Oct, 2023, 03:37

Hi there,

I've changed my function via settings to point to the main-appwrite branch of my repo. However no matter what I do, it only will deploy from the main branch (which I originally set it to). Is this a bug?

TL;DR
User is experiencing an issue where function deployments are not deploying from the correct git branch. They tried deleting and pushing new code, but that didn't work. There is a suggestion to create a new branch and push changes, which successfully deployed from the correct branch but increased build time. The user wonders if the branch name matters and requests a GitHub issue to be created. Another user confirms the issue and provides steps to reproduce it. The suggestion is made to push a commit to the new branch to trigger a deployment. The original user explains that they created a function pointing to the main branch, pushed changes causing a failed deployment, created a new branch
Drake
11 Oct, 2023, 02:17

how are the deployments triggered?

Wintermutation
11 Oct, 2023, 07:04

Manually

Drake
13 Oct, 2023, 18:17

How exactly?

Wintermutation
13 Oct, 2023, 21:48

So when I created the function, it was pointing at the main branch. Pushing a change to this branch caused it to deploy. The deploy failed due to an error. I then created a new branch, main-appwrite and fixed the error. I changed the Github function settings to point to the new branch and clicked "update." Then when I clicked re-deploy, it redeployed from the main branch as if the configs were not updated. I triple-checked and fiddled with the settings a bunch but nothing worked and I ran out of ideas

Drake
13 Oct, 2023, 22:23

So that redeploys the last build...you can try pushing a commit to the main-appwrite branch to get appwrite to fetch the latest code

Wintermutation
13 Oct, 2023, 23:58

Okay, I just tried that. Appwrite detected the push to the main-appwrite branch and this triggered a redeploy. However it again deployed the main branch. The change to the target branch in the settings pane just isn't getting picked up

Wintermutation
14 Oct, 2023, 00:02

I was able to reproduce it:

  • Create a new function from a Github repository
  • Change the branch
  • Push new code / redeploy
  • The original branch gets deployed
Drake
14 Oct, 2023, 00:44

hmm would you please create a github issue for this?

Drake
14 Oct, 2023, 00:46

im pretty sure redeploying just creates a new build with the previous code. what's strange is that you said pushing to the new branch doesn't trigger a deployment for that branch...

Drake
14 Oct, 2023, 00:47

it seems like it might not be consistent...but i was able to update the new branch and get a deployment triggered with the new brnach

Drake
14 Oct, 2023, 00:47
Wintermutation
14 Oct, 2023, 00:58

I created another branch called test and pushed a change and it actually deployed from the correct branch this time, but build time has gone through the roof πŸ€” Unsure if that is a separate issue. The only difference between the branches is the addition of a test.txt file.

I'm wondering now if the name of the branch matters

Drake
14 Oct, 2023, 01:01

ya i got that sometimes too...it's inconsistent =/ it'd be good to make 1 issue for these problems

Wintermutation
14 Oct, 2023, 01:56

Yikes this is still going and "redeploy" causes a weird API error

Drake
14 Oct, 2023, 01:57

Ya I saw that too πŸ˜•

Wintermutation
14 Oct, 2023, 01:58

okay deleting and pushing new code worked

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more