Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release notes #438

Merged
merged 5 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/BaGet.Azure/Table/PackageEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public PackageEntity()
public DateTime Published { get; set; }
public bool RequireLicenseAcceptance { get; set; }
public int SemVerLevel { get; set; }
public string ReleaseNotes { get; set; }
public string Summary { get; set; }
public string Title { get; set; }

Expand Down
1 change: 1 addition & 0 deletions src/BaGet.Azure/Table/TableOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public TableOperation AddPackage(Package package)
Title = package.Title,
IconUrl = package.IconUrlString,
LicenseUrl = package.LicenseUrlString,
ReleaseNotes = package.ReleaseNotes,
ProjectUrl = package.ProjectUrlString,
RepositoryUrl = package.RepositoryUrlString,
RepositoryType = package.RepositoryType,
Expand Down
1 change: 1 addition & 0 deletions src/BaGet.Azure/Table/TablePackageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ private Package AsPackage(PackageEntity entity)
SemVerLevel = (SemVerLevel)entity.SemVerLevel,
Summary = entity.Summary,
Title = entity.Title,
ReleaseNotes = entity.ReleaseNotes,
IconUrl = ParseUri(entity.IconUrl),
LicenseUrl = ParseUri(entity.LicenseUrl),
ProjectUrl = ParseUri(entity.ProjectUrl),
Expand Down
4 changes: 4 additions & 0 deletions src/BaGet.Core/Entities/AbstractContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ private void BuildPackageEntity(EntityTypeBuilder<Package> package)
.HasColumnName("OriginalVersion")
.HasMaxLength(MaxPackageVersionLength);

package.Property(p => p.ReleaseNotes)
.HasColumnName("ReleaseNotes")
.HasMaxLength(DefaultMaxStringLength);

package.Property(p => p.Authors)
.HasConversion(StringArrayToJsonConverter.Instance)
.HasMaxLength(DefaultMaxStringLength);
Expand Down
1 change: 1 addition & 0 deletions src/BaGet.Core/Entities/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public NuGetVersion Version
public long Downloads { get; set; }
public bool HasReadme { get; set; }
public bool IsPrerelease { get; set; }
public string ReleaseNotes { get; set; }
public string Language { get; set; }
public bool Listed { get; set; }
public string MinClientVersion { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static Package GetPackageMetadata(this PackageArchiveReader packageReader
HasReadme = packageReader.HasReadme(),
IsPrerelease = nuspec.GetVersion().IsPrerelease,
Language = nuspec.GetLanguage() ?? string.Empty,
ReleaseNotes = nuspec.GetReleaseNotes() ?? string.Empty,
Listed = true,
MinClientVersion = nuspec.GetMinClientVersion()?.ToNormalizedString() ?? string.Empty,
Published = DateTime.UtcNow,
Expand Down
6 changes: 6 additions & 0 deletions src/BaGet.Core/Metadata/BaGetPackageMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@ public class BaGetPackageMetadata : PackageMetadata

[JsonProperty("repositoryType")]
public string RepositoryType { get; set; }

/// <summary>
/// The package's release notes.
/// </summary>
[JsonProperty("releaseNotes")]
public string ReleaseNotes { get; set; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this to after PackageTypes but before RepositoryUrl to keep these properties alphabetically sorted?

}
}
1 change: 1 addition & 0 deletions src/BaGet.Core/Metadata/RegistrationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private RegistrationIndexPageItem ToRegistrationIndexPageItem(Package package) =
LicenseUrl = package.LicenseUrlString,
Listed = package.Listed,
MinClientVersion = package.MinClientVersion,
ReleaseNotes = package.ReleaseNotes,
PackageContentUrl = _url.GetPackageDownloadUrl(package.Id, package.Version),
PackageTypes = package.PackageTypes.Select(t => t.Name).ToList(),
ProjectUrl = package.ProjectUrlString,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace BaGet.Database.MySql.Migrations
{
public partial class AddReleaseNotesStringColumn : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
rowVersion: true,
nullable: true,
oldClrType: typeof(DateTime),
oldNullable: true);

migrationBuilder.AddColumn<string>(
name: "ReleaseNotes",
table: "Packages",
maxLength: 4000,
nullable: true);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ReleaseNotes",
table: "Packages");

migrationBuilder.AlterColumn<DateTime>(
name: "RowVersion",
table: "Packages",
nullable: true,
oldClrType: typeof(DateTime),
oldRowVersion: true,
oldNullable: true);
}
}
}
24 changes: 14 additions & 10 deletions src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
.HasAnnotation("Relational:MaxIdentifierLength", 64);

modelBuilder.Entity("BaGet.Core.Entities.Package", b =>
modelBuilder.Entity("BaGet.Core.Package", b =>
{
b.Property<int>("Key")
.ValueGeneratedOnAdd();
Expand Down Expand Up @@ -66,6 +66,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.Property<DateTime>("Published");

b.Property<string>("ReleaseNotes")
.HasColumnName("ReleaseNotes")
.HasMaxLength(4000);

b.Property<string>("RepositoryType")
.HasMaxLength(100);

Expand Down Expand Up @@ -99,7 +103,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Packages");
});

modelBuilder.Entity("BaGet.Core.Entities.PackageDependency", b =>
modelBuilder.Entity("BaGet.Core.PackageDependency", b =>
{
b.Property<int>("Key")
.ValueGeneratedOnAdd();
Expand All @@ -124,7 +128,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("PackageDependencies");
});

modelBuilder.Entity("BaGet.Core.Entities.PackageType", b =>
modelBuilder.Entity("BaGet.Core.PackageType", b =>
{
b.Property<int>("Key")
.ValueGeneratedOnAdd();
Expand All @@ -146,7 +150,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("PackageTypes");
});

modelBuilder.Entity("BaGet.Core.Entities.TargetFramework", b =>
modelBuilder.Entity("BaGet.Core.TargetFramework", b =>
{
b.Property<int>("Key")
.ValueGeneratedOnAdd();
Expand All @@ -165,24 +169,24 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("TargetFrameworks");
});

modelBuilder.Entity("BaGet.Core.Entities.PackageDependency", b =>
modelBuilder.Entity("BaGet.Core.PackageDependency", b =>
{
b.HasOne("BaGet.Core.Entities.Package", "Package")
b.HasOne("BaGet.Core.Package", "Package")
.WithMany("Dependencies")
.HasForeignKey("PackageKey");
});

modelBuilder.Entity("BaGet.Core.Entities.PackageType", b =>
modelBuilder.Entity("BaGet.Core.PackageType", b =>
{
b.HasOne("BaGet.Core.Entities.Package", "Package")
b.HasOne("BaGet.Core.Package", "Package")
.WithMany("PackageTypes")
.HasForeignKey("PackageKey")
.OnDelete(DeleteBehavior.Cascade);
});

modelBuilder.Entity("BaGet.Core.Entities.TargetFramework", b =>
modelBuilder.Entity("BaGet.Core.TargetFramework", b =>
{
b.HasOne("BaGet.Core.Entities.Package", "Package")
b.HasOne("BaGet.Core.Package", "Package")
.WithMany("TargetFrameworks")
.HasForeignKey("PackageKey")
.OnDelete(DeleteBehavior.Cascade);
Expand Down
Loading