tgstation / tgstation-server-webpanel

React application for interacting with tgstation-server
GNU Affero General Public License v3.0
10 stars 11 forks source link

Cloning should short circuit if the branch doesn't exist #131

Closed ike709 closed 1 year ago

ike709 commented 1 year ago

Imagine the pain of cloning a repo only for it to fail after 30 minutes because it tried to checkout main instead of master

Cyberboss commented 1 year ago

Do you have logs of this? Sounds like it may be a server issue actually.

Crossedfall commented 1 year ago
2022-10-10T18:22:09.0080394+00:00 (Instance:1|Job:7|Request:PUT /Repository|User:1|Monitor:|Bridge:|Chat:): [DBG] Tgstation.Server.Host.Jobs.JobManager: Job 7 exited with error! ()
LibGit2Sharp.NotFoundException: reference 'refs/remotes/origin/main' not found
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
   at Tgstation.Server.Host.Components.Repository.LibGit2RepositoryFactory.<>c__DisplayClass4_0.<Clone>b__0() in /repo/src/Tgstation.Server.Host/Components/Repository/LibGit2RepositoryFactory.cs:line 67
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Tgstation.Server.Host.Components.Repository.RepositoryManager.CloneRepository(Uri url, String initialBranch, String username, String password, JobProgressReporter progressReporter, Boolean recurseSubmodules, CancellationToken cancellationToken) in /repo/src/Tgstation.Server.Host/Components/Repository/RepositoryManager.cs:line 157
   at Tgstation.Server.Host.Components.Repository.RepositoryManager.CloneRepository(Uri url, String initialBranch, String username, String password, JobProgressReporter progressReporter, Boolean recurseSubmodules, CancellationToken cancellationToken) in /repo/src/Tgstation.Server.Host/Components/Repository/RepositoryManager.cs:line 178
   at Tgstation.Server.Host.Controllers.RepositoryController.<>c__DisplayClass3_1.<<Create>b__2>d.MoveNext() in /repo/src/Tgstation.Server.Host/Controllers/RepositoryController.cs:line 161
--- End of stack trace from previous location ---
   at Tgstation.Server.Host.Jobs.JobManager.RunJob(Job job, JobEntrypoint operation, CancellationToken cancellationToken) in /repo/src/Tgstation.Server.Host/Jobs/JobManager.cs:line 328
Crossedfall commented 1 year ago

Pretty sure this is a backend TGS issue, not a web-panel one.

alexkar598 commented 1 year ago

Doubt this is webpanel, open on tgs

Cyberboss commented 1 year ago

We have issue transferrrrr

Cyberboss commented 1 year ago

Wait, this is a webpanel issue. We shouldn't be specifying main as a default branch

alexkar598 commented 1 year ago

Wait, this is a webpanel issue. We shouldn't be specifying main as a default branch

You got a better option?

alexkar598 commented 1 year ago

Also doesn't excuse not failing fast if the branch doesn't exist instead of cloning the entire thing only to realize that the branch doesn't exist

Cyberboss commented 1 year ago

libgit2 issue, not much I can do

Cyberboss commented 1 year ago

Wait, this is a webpanel issue. We shouldn't be specifying main as a default branch

You got a better option?

Specifying null in the request will make it clone the default branch