diff --git a/BuildFeed.Model/Build.cs b/BuildFeed.Model/Build.cs
index 2529a68..d7f3f05 100644
--- a/BuildFeed.Model/Build.cs
+++ b/BuildFeed.Model/Build.cs
@@ -31,7 +31,9 @@ namespace BuildFeed.Model
public string LabUrl { get; private set; }
- public bool IsLeaked => SourceType == TypeOfSource.PublicRelease || SourceType == TypeOfSource.InternalLeak || SourceType == TypeOfSource.UpdateGDR;
+ public bool IsLeaked => SourceType == TypeOfSource.PublicRelease ||
+ SourceType == TypeOfSource.InternalLeak ||
+ SourceType == TypeOfSource.UpdateGDR;
public string FullBuildString { get; private set; }
@@ -46,7 +48,7 @@ namespace BuildFeed.Model
{
get
{
- HtmlDocument hDoc = new HtmlDocument();
+ var hDoc = new HtmlDocument();
hDoc.LoadHtml($"
{SourceDetails}
");
if (string.IsNullOrWhiteSpace(hDoc.DocumentNode.InnerText))
@@ -56,8 +58,9 @@ namespace BuildFeed.Model
if (Uri.IsWellFormedUriString(hDoc.DocumentNode.InnerText, UriKind.Absolute))
{
- Uri uri = new Uri(hDoc.DocumentNode.InnerText, UriKind.Absolute);
- return $"{VariantTerms.Model_ExternalLink} ";
+ var uri = new Uri(hDoc.DocumentNode.InnerText, UriKind.Absolute);
+ return
+ $"{VariantTerms.Model_ExternalLink} ";
}
return SourceDetails;
@@ -74,7 +77,7 @@ namespace BuildFeed.Model
private void GenerateFullBuildString()
{
- StringBuilder sb = new StringBuilder();
+ var sb = new StringBuilder();
sb.Append($"{MajorVersion}.{MinorVersion}.{Number}");
if (Revision.HasValue)
@@ -97,7 +100,7 @@ namespace BuildFeed.Model
private void GenerateAlternateBuildString()
{
- StringBuilder sb = new StringBuilder();
+ var sb = new StringBuilder();
sb.Append($"{MajorVersion}.{MinorVersion}.{Number}");
if (Revision.HasValue)
@@ -111,7 +114,8 @@ namespace BuildFeed.Model
if (BuildTime.HasValue)
{
- sb.Append($".{BuildTime.Value.ToString("yyMMdd-HHmm", CultureInfo.InvariantCulture.DateTimeFormat)}");
+ sb.Append(
+ $".{BuildTime.Value.ToString("yyMMdd-HHmm", CultureInfo.InvariantCulture.DateTimeFormat)}");
}
sb.Append(")");
diff --git a/BuildFeed.Model/BuildDetails.cs b/BuildFeed.Model/BuildDetails.cs
index 7595bbe..0fdf537 100644
--- a/BuildFeed.Model/BuildDetails.cs
+++ b/BuildFeed.Model/BuildDetails.cs
@@ -10,6 +10,7 @@ namespace BuildFeed.Model
public class BuildDetails
{
[Required]
+ [Range(1, int.MaxValue)]
[Display(ResourceType = typeof(VariantTerms), Name = nameof(VariantTerms.Model_MajorVersion))]
public uint MajorVersion { get; set; }
@@ -18,6 +19,7 @@ namespace BuildFeed.Model
public uint MinorVersion { get; set; }
[Required]
+ [Range(1, int.MaxValue)]
[Display(ResourceType = typeof(VariantTerms), Name = nameof(VariantTerms.Model_BuildNumber))]
public uint Number { get; set; }
diff --git a/BuildFeed.Model/BuildFeed.Model.csproj b/BuildFeed.Model/BuildFeed.Model.csproj
index 5367311..b071749 100644
--- a/BuildFeed.Model/BuildFeed.Model.csproj
+++ b/BuildFeed.Model/BuildFeed.Model.csproj
@@ -34,8 +34,8 @@
..\packages\AutoMapper.6.1.1\lib\net45\AutoMapper.dll
-
- ..\packages\HtmlAgilityPack.1.5.5\lib\Net45\HtmlAgilityPack.dll
+
+ ..\packages\HtmlAgilityPack.1.6.3\lib\Net45\HtmlAgilityPack.dll
..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
diff --git a/BuildFeed.Model/BuildRepository.cs b/BuildFeed.Model/BuildRepository.cs
index 718ecab..654aec4 100644
--- a/BuildFeed.Model/BuildRepository.cs
+++ b/BuildFeed.Model/BuildRepository.cs
@@ -29,7 +29,7 @@ namespace BuildFeed.Model
public BuildRepository()
{
- MongoClientSettings settings = new MongoClientSettings
+ var settings = new MongoClientSettings
{
Server = new MongoServerAddress(MongoConfig.Host, MongoConfig.Port)
};
@@ -42,7 +42,7 @@ namespace BuildFeed.Model
};
}
- MongoClient dbClient = new MongoClient(settings);
+ var dbClient = new MongoClient(settings);
IMongoDatabase buildDatabase = dbClient.GetDatabase(MongoConfig.Database);
_buildCollection = buildDatabase.GetCollection(BUILD_COLLECTION_NAME);
@@ -50,7 +50,7 @@ namespace BuildFeed.Model
public async Task SetupIndexes()
{
- List indexes = await (await _buildCollection.Indexes.ListAsync()).ToListAsync();
+ var indexes = await (await _buildCollection.Indexes.ListAsync()).ToListAsync();
if (indexes.All(i => i["name"] != "_idx_group"))
{
@@ -95,7 +95,8 @@ namespace BuildFeed.Model
if (indexes.All(i => i["name"] != "_idx_bstr"))
{
- await _buildCollection.Indexes.CreateOneAsync(Builders.IndexKeys.Ascending(b => b.FullBuildString),
+ await _buildCollection.Indexes.CreateOneAsync(
+ Builders.IndexKeys.Ascending(b => b.FullBuildString),
new CreateIndexOptions
{
Name = "_idx_bstr"
@@ -104,7 +105,8 @@ namespace BuildFeed.Model
if (indexes.All(i => i["name"] != "_idx_alt_bstr"))
{
- await _buildCollection.Indexes.CreateOneAsync(Builders.IndexKeys.Ascending(b => b.AlternateBuildString),
+ await _buildCollection.Indexes.CreateOneAsync(
+ Builders.IndexKeys.Ascending(b => b.AlternateBuildString),
new CreateIndexOptions
{
Name = "_idx_alt_bstr"
@@ -134,15 +136,18 @@ namespace BuildFeed.Model
public async Task> Select() => await _buildCollection.Find(new BsonDocument()).ToListAsync();
[DataObjectMethod(DataObjectMethodType.Select, false)]
- public async Task SelectById(Guid id) => await _buildCollection.Find(Builders.Filter.Eq(b => b.Id, id)).SingleOrDefaultAsync();
+ public async Task SelectById(Guid id)
+ => await _buildCollection.Find(Builders.Filter.Eq(b => b.Id, id)).SingleOrDefaultAsync();
[DataObjectMethod(DataObjectMethodType.Select, false)]
- public async Task SelectByLegacyId(long id) => await _buildCollection.Find(Builders.Filter.Eq(b => b.LegacyId, id)).SingleOrDefaultAsync();
+ public async Task SelectByLegacyId(long id) => await _buildCollection
+ .Find(Builders.Filter.Eq(b => b.LegacyId, id))
+ .SingleOrDefaultAsync();
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectBuildsByOrder(int limit = -1, int skip = 0)
{
- IFindFluent query = _buildCollection.Find(new BsonDocument()).Sort(sortByOrder).Skip(skip);
+ var query = _buildCollection.Find(new BsonDocument()).Sort(sortByOrder).Skip(skip);
if (limit > 0)
{
@@ -155,18 +160,33 @@ namespace BuildFeed.Model
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectFrontPage()
{
- const int currentFamily = (int)ProjectFamily.Redstone;
- const int currentXbox = (int)ProjectFamily.Redstone2;
+ const int currentLongTerm = (int)ProjectFamily.Redstone;
+ const int currentFamily = (int)ProjectFamily.Redstone3;
+ const int currentXbox = (int)ProjectFamily.Redstone3;
var families = new Dictionary();
- IAggregateFluent query = _buildCollection.Aggregate()
+ var query = _buildCollection.Aggregate()
.Match(new BsonDocument
{
{
- nameof(Build.Family), new BsonDocument
+ "$or", new BsonArray
{
- {"$gte", currentFamily}
+ new BsonDocument
+ {
+ {
+ nameof(Build.Family), new BsonDocument
+ {
+ {"$gte", currentFamily}
+ }
+ }
+ },
+ new BsonDocument
+ {
+ {
+ nameof(Build.Family), currentLongTerm
+ }
+ }
}
}
})
@@ -199,44 +219,67 @@ namespace BuildFeed.Model
}
});
- List dbResults = await query.ToListAsync();
+ var dbResults = await query.ToListAsync();
var results = (from g in dbResults
- select new
- {
- Key = new
- {
- Family = (ProjectFamily)g["_id"].AsBsonDocument[nameof(Build.Family)].AsInt32,
- LabUrl = g["_id"].AsBsonDocument[nameof(Build.LabUrl)].AsString,
- SourceType = (TypeOfSource)g["_id"].AsBsonDocument[nameof(Build.SourceType)].AsInt32
- },
+ select new
+ {
+ Key = new
+ {
+ Family = (ProjectFamily)g["_id"].AsBsonDocument[nameof(Build.Family)].AsInt32,
+ LabUrl = g["_id"].AsBsonDocument[nameof(Build.LabUrl)].AsString,
+ SourceType = (TypeOfSource)g["_id"].AsBsonDocument[nameof(Build.SourceType)].AsInt32
+ },
- Items = from i in g["items"].AsBsonArray
- select new FrontPageBuild
- {
- Id = i[nameof(Build.Id)].AsGuid,
- MajorVersion = (uint)i[nameof(Build.MajorVersion)].AsInt32,
- MinorVersion = (uint)i[nameof(Build.MinorVersion)].AsInt32,
- Number = (uint)i[nameof(Build.Number)].AsInt32,
- Revision = (uint?)i[nameof(Build.Revision)].AsNullableInt32,
- Lab = i[nameof(Build.Lab)].AsString,
- BuildTime = i[nameof(Build.BuildTime)].ToNullableUniversalTime()
- }
- }).ToArray();
+ Items = from i in g["items"].AsBsonArray
+ select new FrontPageBuild
+ {
+ Id = i[nameof(Build.Id)].AsGuid,
+ MajorVersion = (uint)i[nameof(Build.MajorVersion)].AsInt32,
+ MinorVersion = (uint)i[nameof(Build.MinorVersion)].AsInt32,
+ Number = (uint)i[nameof(Build.Number)].AsInt32,
+ Revision = (uint?)i[nameof(Build.Revision)].AsNullableInt32,
+ Lab = i[nameof(Build.Lab)].AsString,
+ BuildTime = i[nameof(Build.BuildTime)].ToNullableUniversalTime()
+ }
+ }).ToArray();
- IEnumerable listOfFamilies = results.GroupBy(g => g.Key.Family).Select(g => g.Key).OrderByDescending(k => k);
+ IEnumerable listOfFamilies =
+ results.GroupBy(g => g.Key.Family).Select(g => g.Key).OrderByDescending(k => k);
foreach (ProjectFamily family in listOfFamilies)
{
- FrontPage fp = new FrontPage
+ var fp = new FrontPage
{
- CurrentCanary = results.Where(g => g.Key.Family == family && !g.Key.LabUrl.Contains("xbox")).SelectMany(g => g.Items).OrderByDescending(b => b.BuildTime).FirstOrDefault(),
- CurrentInsider = results.Where(g => g.Key.Family == family && !g.Key.LabUrl.Contains("xbox") && (g.Key.SourceType == TypeOfSource.PublicRelease || g.Key.SourceType == TypeOfSource.UpdateGDR)).SelectMany(g => g.Items)
- .OrderByDescending(b => b.BuildTime).FirstOrDefault(),
+ CurrentCanary = results.Where(g => g.Key.Family == family && !g.Key.LabUrl.Contains("xbox"))
+ .SelectMany(g => g.Items)
+ .OrderByDescending(b => b.BuildTime)
+ .FirstOrDefault(),
+ CurrentInsider = results
+ .Where(g => g.Key.Family == family &&
+ !g.Key.LabUrl.Contains("xbox") &&
+ (g.Key.SourceType == TypeOfSource.PublicRelease ||
+ g.Key.SourceType == TypeOfSource.UpdateGDR))
+ .SelectMany(g => g.Items)
+ .OrderByDescending(b => b.BuildTime)
+ .FirstOrDefault(),
CurrentRelease = results
- .Where(g => g.Key.Family == family && g.Key.LabUrl.Contains("_release") && !g.Key.LabUrl.Contains("xbox") && (g.Key.SourceType == TypeOfSource.PublicRelease || g.Key.SourceType == TypeOfSource.UpdateGDR))
- .SelectMany(g => g.Items).OrderByDescending(b => b.BuildTime).FirstOrDefault(),
- CurrentXbox = results.Where(g => (int)g.Key.Family >= currentXbox && g.Key.Family == family && g.Key.LabUrl.Contains("xbox")).SelectMany(g => g.Items).OrderByDescending(b => b.BuildTime).FirstOrDefault()
+ .Where(g => g.Key.Family == family &&
+ g.Key.LabUrl.Contains("_release") &&
+ !g.Key.LabUrl.Contains("xbox") &&
+ (g.Key.SourceType == TypeOfSource.PublicRelease ||
+ g.Key.SourceType == TypeOfSource.UpdateGDR))
+ .SelectMany(g => g.Items)
+ .OrderByDescending(b => b.BuildTime)
+ .FirstOrDefault(),
+ CurrentXbox =
+ results.Where(g
+ => (int)g.Key.Family >= currentXbox &&
+ g.Key.Family == family &&
+ g.Key.LabUrl.Contains("xbox"))
+ .SelectMany(g => g.Items)
+ .OrderByDescending(b => b.BuildTime)
+ .FirstOrDefault()
};
families.Add(family, fp);
@@ -248,7 +291,10 @@ namespace BuildFeed.Model
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectBuildsByStringSearch(string term, int limit = -1)
{
- IAggregateFluent query = _buildCollection.Aggregate().Match(b => b.FullBuildString != null).Match(b => b.FullBuildString != "").Match(b => b.FullBuildString.ToLower().Contains(term.ToLower()));
+ var query = _buildCollection.Aggregate()
+ .Match(b => b.FullBuildString != null)
+ .Match(b => b.FullBuildString != "")
+ .Match(b => b.FullBuildString.ToLower().Contains(term.ToLower()));
if (limit > 0)
{
@@ -261,13 +307,14 @@ namespace BuildFeed.Model
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task SelectBuildByFullBuildString(string build)
{
- return await _buildCollection.Find(Builders.Filter.Eq(b => b.FullBuildString, build)).SingleOrDefaultAsync();
+ return await _buildCollection.Find(Builders.Filter.Eq(b => b.FullBuildString, build))
+ .SingleOrDefaultAsync();
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectBuildsByCompileDate(int limit = -1, int skip = 0)
{
- IFindFluent query = _buildCollection.Find(new BsonDocument()).Sort(sortByCompileDate).Skip(skip);
+ var query = _buildCollection.Find(new BsonDocument()).Sort(sortByCompileDate).Skip(skip);
if (limit > 0)
{
@@ -280,7 +327,7 @@ namespace BuildFeed.Model
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectBuildsByAddedDate(int limit = -1, int skip = 0)
{
- IFindFluent query = _buildCollection.Find(new BsonDocument()).Sort(sortByAddedDate).Skip(skip);
+ var query = _buildCollection.Find(new BsonDocument()).Sort(sortByAddedDate).Skip(skip);
if (limit > 0)
{
@@ -293,7 +340,7 @@ namespace BuildFeed.Model
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task> SelectBuildsByLeakedDate(int limit = -1, int skip = 0)
{
- IFindFluent query = _buildCollection.Find(new BsonDocument()).Sort(sortByLeakedDate).Skip(skip);
+ var query = _buildCollection.Find(new BsonDocument()).Sort(sortByLeakedDate).Skip(skip);
if (limit > 0)
{
@@ -340,7 +387,7 @@ namespace BuildFeed.Model
public async Task RegenerateCachedProperties()
{
- List builds = await Select();
+ var builds = await Select();
foreach (Build bd in builds)
{
bd.RegenerateCachedProperties();
diff --git a/BuildFeed.Model/packages.config b/BuildFeed.Model/packages.config
index 9529c89..a778f22 100644
--- a/BuildFeed.Model/packages.config
+++ b/BuildFeed.Model/packages.config
@@ -1,7 +1,7 @@
-
+
diff --git a/BuildFeed/BuildFeed.csproj b/BuildFeed/BuildFeed.csproj
index 44fc857..5727174 100644
--- a/BuildFeed/BuildFeed.csproj
+++ b/BuildFeed/BuildFeed.csproj
@@ -1,7 +1,7 @@
-
-
+
+
@@ -29,7 +29,7 @@
true
- 2.5
+ 2.6
@@ -67,14 +67,14 @@
..\packages\AutoMapper.6.1.1\lib\net45\AutoMapper.dll
-
- ..\packages\HtmlAgilityPack.1.5.5\lib\Net45\HtmlAgilityPack.dll
+
+ ..\packages\HtmlAgilityPack.1.6.3\lib\Net45\HtmlAgilityPack.dll
..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll
-
- ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.7\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
+
+ ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
@@ -266,7 +266,14 @@
-
+
+
+ winter.scss
+
+
+ winter.css
+
+
@@ -280,18 +287,15 @@
-
-
-
-
-
-
+
+
+
+
-
@@ -327,6 +331,12 @@
bfs.js
+
+ christmas.ts
+
+
+ christmas.js
+
@@ -339,8 +349,9 @@
-
-
+
+
+
@@ -355,6 +366,7 @@
+
@@ -372,12 +384,14 @@
+
+
@@ -389,34 +403,21 @@
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
@@ -462,8 +463,6 @@
Always
-
-
@@ -471,6 +470,7 @@
+
@@ -540,11 +540,11 @@
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
+
+
+
-
+