danielflower / app-runner

Self-hosted platform as a service for Java, Node, Clojure, Scala, DotNet, Python and golang apps. Push to a git repo to deploy apps.
MIT License
70 stars 44 forks source link

github clone during app creation is not reliable #40

Open jpsheffield opened 2 months ago

jpsheffield commented 2 months ago

When using the API to create an app, if the GitHub repository is very new (eg. Created by the same process that calls the API) it seems there is a timing issue which causes the HEAD branch not to be found.

The creation fails with the API returning: Response code 400

{
 "message": "Could not clone git repository: Remote branch 'HEAD' not found in upstream origin",
"gitUrl": "(SSH URL of new repo)"
}

The failure would appear to occur in AppManager.java in the create(..) method at the point of the Git.cloneRepository()

It would be useful to have the option to wait/retry the clone.

Unfortunately it is unlikely a reliable test case could be created for recreation of the issue.