Skip to content

Commit

Permalink
Fixed target version, exclude builds older than 90 days.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximumADHD committed Feb 5, 2021
1 parent 471e161 commit a420074
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
13 changes: 12 additions & 1 deletion ProjectSrc/Bootstrapper/History/StudioDeployLogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ private static void MakeDistinct(HashSet<DeployLog> targetSet)

private void UpdateLogs(string deployHistory, int maxVersion)
{
MatchCollection matches = Regex.Matches(deployHistory, LogPattern);
var now = DateTime.Now;
var matches = Regex.Matches(deployHistory, LogPattern);

CurrentLogs_x86.Clear();
CurrentLogs_x64.Clear();

Expand Down Expand Up @@ -86,6 +88,15 @@ private void UpdateLogs(string deployHistory, int maxVersion)
if (deployLog.Changelist < EarliestChangelist || deployLog.Version > maxVersion)
continue;

// olive71 (Ganesh) said we should expect builds older than ~3 months to be deleted.
// Although in practice this isn't consistently done, it's better to be safe than sorry.
// https://devforum.roblox.com/t/previous-roblox-builds-missing-from-deployment-server/469698/3

var timespan = now - deployLog.TimeStamp;

if (timespan.TotalDays > 90)
continue;

HashSet<DeployLog> targetList;

if (deployLog.Is64Bit)
Expand Down
16 changes: 13 additions & 3 deletions ProjectSrc/Bootstrapper/StudioBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ private async Task<bool> shutdownStudioProcesses()
return !cancelled;
}

public async Task Bootstrap()
public async Task Bootstrap(string targetVersion = "")
{
setStatus("Checking for updates");
echo("Checking build installation...");
Expand All @@ -825,12 +825,21 @@ public async Task Bootstrap()
var getFastVersion = GetFastVersionGuid(currentBranch);
string fastVersion = await getFastVersion.ConfigureAwait(true);

if (shouldInstall || fastVersion != currentVersion)
if (!shouldInstall)
shouldInstall = (fastVersion != currentVersion);

if (!shouldInstall && !string.IsNullOrEmpty(targetVersion))
{
string versionOverload = versionRegistry.GetString("VersionOverload");
shouldInstall = (targetVersion != versionOverload);
}

if (shouldInstall)
{
if (currentBranch != "roblox")
echo("Possible update detected, verifying...");

var getVersionInfo = GetCurrentVersionInfo(Branch, versionRegistry, fastVersion);
var getVersionInfo = GetCurrentVersionInfo(Branch, versionRegistry, fastVersion, targetVersion);
versionInfo = await getVersionInfo.ConfigureAwait(true);

buildVersion = versionInfo.Guid;
Expand Down Expand Up @@ -921,6 +930,7 @@ await Task

versionRegistry.SetValue("Version", versionId);
versionRegistry.SetValue("VersionGuid", buildVersion);
versionRegistry.SetValue("VersionOverload", targetVersion);
}
else
{
Expand Down
12 changes: 9 additions & 3 deletions ProjectSrc/Forms/BootstrapperForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public BootstrapperForm(StudioBootstrapper bootstrapper, bool exitWhenClosed = f

public async Task Bootstrap()
{
var bootstrap = Bootstrapper.Bootstrap();
string targetVersion = Program.GetString("TargetVersion");
var bootstrap = Bootstrapper.Bootstrap(targetVersion);

await bootstrap.ConfigureAwait(true);
}

Expand Down Expand Up @@ -159,7 +161,8 @@ private void BootstrapperForm_FormClosing(object sender, FormClosingEventArgs e)
this,

"The installation has not finished yet!\n" +
"Are you sure you want to close this window?",
"Closing this window will exit the mod manager.\n" +
"Are you sure you want to continue?",

"Warning",

Expand All @@ -168,8 +171,11 @@ private void BootstrapperForm_FormClosing(object sender, FormClosingEventArgs e)
);

if (result != DialogResult.No)
{
Environment.Exit(0);
return;

}

e.Cancel = true;
}
}
Expand Down
6 changes: 6 additions & 0 deletions ProjectSrc/RobloxStudioModManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ echo Copying release build.
copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\$(TargetFileName)"
echo Done!
:end</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>if not $(ConfigurationName) == Release goto :end
echo Clearing instances of $(TargetFileName)
taskkill /f /im $(TargetFileName) /fi "memusage gt 2"
:end</PreBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
Binary file modified RobloxStudioModManager.exe
Binary file not shown.

0 comments on commit a420074

Please sign in to comment.