diff --git a/_repository_update_service_8cs_source.html b/_repository_update_service_8cs_source.html index 4404c69377..a566b34c4d 100644 --- a/_repository_update_service_8cs_source.html +++ b/_repository_update_service_8cs_source.html @@ -676,51 +676,37 @@ $(document).ready(function() { init_codefold(0); });
642 await deleteTask;
643 }
644
-
645 IRepository newRepo;
-
646 try
-
647 {
-
648 using var cloneReporter = progressReporter.CreateSection("Cloning New Repository", 0.8);
-
649 newRepo = await instance.RepositoryManager.CloneRepository(
-
650 origin,
-
651 oldReference,
-
652 currentModel.AccessUser,
-
653 currentModel.AccessToken,
-
654 cloneReporter,
-
655 true, // TODO: Make configurable maybe...
-
656 cancellationToken)
-
657 ?? throw new JobException("A race condition occurred while recloning the repository. Somehow, it was fully cloned instantly after being deleted!"); // I'll take lines of code that should never be hit for $10k
-
658 }
-
659 catch (Exception ex) when (ex is not JobException)
-
660 {
-
661 logger.LogWarning("Reclone failed, clearing credentials!");
-
662
-
663 // need to clear credentials here
-
664 await databaseContextFactory.UseContextTaskReturn(context =>
-
665 {
-
666 context.RepositorySettings.Attach(currentModel);
-
667 currentModel.AccessUser = null;
-
668 currentModel.AccessToken = null;
-
669 return context.Save(CancellationToken.None); // DCT: Must always run
-
670 });
-
671
-
672 throw;
-
673 }
-
674
-
675 using (newRepo)
-
676 using (var checkoutReporter = progressReporter.CreateSection("Checking out previous Detached Commit", 0.1))
-
677 {
-
678 await newRepo.CheckoutObject(
-
679 oldSha,
-
680 currentModel.AccessUser,
-
681 currentModel.AccessToken,
-
682 false,
-
683 oldReference != null,
-
684 checkoutReporter,
-
685 cancellationToken);
-
686 }
-
687 }
-
688 }
-
689}
+
645 try
+
646 {
+
647 using var cloneReporter = progressReporter.CreateSection("Cloning New Repository", 0.9);
+
648 using var newRepo = await instance.RepositoryManager.CloneRepository(
+
649 origin,
+
650 oldReference,
+
651 currentModel.AccessUser,
+
652 currentModel.AccessToken,
+
653 cloneReporter,
+
654 true, // TODO: Make configurable maybe...
+
655 cancellationToken)
+
656 ?? throw new JobException("A race condition occurred while recloning the repository. Somehow, it was fully cloned instantly after being deleted!"); // I'll take lines of code that should never be hit for $10k
+
657 }
+
658 catch (Exception ex) when (ex is not JobException)
+
659 {
+
660 logger.LogWarning("Reclone failed, clearing credentials!");
+
661
+
662 // need to clear credentials here
+
663 await databaseContextFactory.UseContextTaskReturn(context =>
+
664 {
+
665 context.RepositorySettings.Attach(currentModel);
+
666 currentModel.AccessUser = null;
+
667 currentModel.AccessToken = null;
+
668 return context.Save(CancellationToken.None); // DCT: Must always run
+
669 });
+
670
+
671 throw;
+
672 }
+
673 }
+
674 }
+
675}
Exception
IQueryable
Tgstation.Server.Api.Models.EntityId.Id
virtual ? long Id
The ID of the entity.
Definition EntityId.cs:13
diff --git a/changelog.yml b/changelog.yml index d8ccd4dbcc..5b18d007c4 100644 --- a/changelog.yml +++ b/changelog.yml @@ -191,6 +191,10 @@ Components: - Fixed being able to attempt a server update to major version 3. Author: Cyberboss PullRequest: 1986 + - Descriptions: + - Re-cloning a repository no longer attempts to checkout the exact SHA that it was previously on, rather using the reference instead. This was problematic with SHAs that were generated by test merges. If no reference is available, the default branch on the origin will be cloned. + Author: Cyberboss + PullRequest: 1991 - Descriptions: - OAuth providers can now forward user tokens to clients. Author: Cyberboss @@ -213,6 +217,7 @@ Components: - The `EngineInstallFail` event will no longer run if the `EngineInstallComplete` script errored. - Fixed an issue where aborting a zip file upload for a TGS update would prevent the server from updating without a restart. - Added support for global `EventScripts` directories. + - Released artifacts are now attested. Author: Cyberboss PullRequest: 2000 Unreleased: true