Skip to content

Commit e29d277

Browse files
Mpdreamzcotti
andauthored
Split ChangelogService and reorganize into new Elastic.Changelog project (#2512)
* Split ChangelogService and reorganize into new Elastic.Changelog project * update namespace usings in tests * Fix linting * order namespaces --------- Co-authored-by: Felipe Cotti <[email protected]>
1 parent 601ed4a commit e29d277

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3958
-3865
lines changed

docs-builder.slnx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<Project Path="src/infra/docs-lambda-index-publisher/docs-lambda-index-publisher.csproj" />
6868
</Folder>
6969
<Folder Name="/src/services/">
70+
<Project Path="src/services/Elastic.Changelog/Elastic.Changelog.csproj" />
7071
<Project Path="src/services/Elastic.Documentation.Assembler/Elastic.Documentation.Assembler.csproj" />
7172
<Project Path="src/services/Elastic.Documentation.Isolated/Elastic.Documentation.Isolated.csproj" />
7273
<Project Path="src/services/Elastic.Documentation.Services/Elastic.Documentation.Services.csproj" />
@@ -90,7 +91,7 @@
9091
<Project Path="tests/Elastic.Documentation.LegacyDocs.Tests/Elastic.Documentation.LegacyDocs.Tests.csproj" />
9192
<Project Path="tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj" />
9293
<Project Path="tests/Navigation.Tests/Navigation.Tests.csproj" />
93-
<Project Path="tests/Elastic.Documentation.Services.Tests/Elastic.Documentation.Services.Tests.csproj" />
94+
<Project Path="tests/Elastic.Changelog.Tests/Elastic.Changelog.Tests.csproj" />
9495
</Folder>
9596
<Project Path=".github/.github.csproj">
9697
<Build Project="false" />

src/services/Elastic.Documentation.Services/Changelog/BundleInput.cs renamed to src/services/Elastic.Changelog/Bundling/BundleInput.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
namespace Elastic.Documentation.Services.Changelog;
5+
namespace Elastic.Changelog.Bundling;
66

77
/// <summary>
88
/// Input for a single bundle file with optional directory, repo, and link visibility
@@ -19,4 +19,3 @@ public class BundleInput
1919
/// </summary>
2020
public bool HideLinks { get; set; }
2121
}
22-

src/services/Elastic.Documentation.Services/Changelog/BundledChangelogData.cs renamed to src/services/Elastic.Changelog/Bundling/BundledChangelogData.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,45 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
namespace Elastic.Documentation.Services.Changelog;
5+
namespace Elastic.Changelog.Bundling;
66

77
/// <summary>
88
/// Data structure for bundled changelog YAML file
99
/// </summary>
10-
public class BundledChangelogData
10+
public record BundledChangelogData
1111
{
12-
public List<BundledProduct> Products { get; set; } = [];
13-
public List<BundledEntry> Entries { get; set; } = [];
12+
public IReadOnlyList<BundledProduct> Products { get; set; } = [];
13+
public IReadOnlyList<BundledEntry> Entries { get; set; } = [];
1414
}
1515

16-
public class BundledProduct
16+
public record BundledProduct
1717
{
18-
public string Product { get; set; } = string.Empty;
18+
public string Product { get; set; } = "";
1919
public string? Target { get; set; }
2020
public string? Lifecycle { get; set; }
2121
}
2222

23-
public class BundledEntry
23+
public record BundledEntry
2424
{
25-
public BundledFile File { get; set; } = new();
25+
public BundledFile? File { get; set; }
2626

2727
// Resolved changelog fields (only populated when --resolve is used)
2828
public string? Type { get; set; }
2929
public string? Title { get; set; }
30-
public List<ProductInfo>? Products { get; set; }
30+
public IReadOnlyList<ProductInfo>? Products { get; set; }
3131
public string? Description { get; set; }
3232
public string? Impact { get; set; }
3333
public string? Action { get; set; }
3434
public string? FeatureId { get; set; }
3535
public bool? Highlight { get; set; }
3636
public string? Subtype { get; set; }
37-
public List<string>? Areas { get; set; }
37+
public IReadOnlyList<string>? Areas { get; set; }
3838
public string? Pr { get; set; }
39-
public List<string>? Issues { get; set; }
39+
public IReadOnlyList<string>? Issues { get; set; }
4040
}
4141

42-
public class BundledFile
42+
public record BundledFile
4343
{
44-
public string Name { get; set; } = string.Empty;
45-
public string Checksum { get; set; } = string.Empty;
44+
public string Name { get; set; } = "";
45+
public string Checksum { get; set; } = "";
4646
}
47-

src/services/Elastic.Documentation.Services/Changelog/ChangelogBundleInput.cs renamed to src/services/Elastic.Changelog/Bundling/ChangelogBundleInput.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
namespace Elastic.Documentation.Services.Changelog;
5+
namespace Elastic.Changelog.Bundling;
66

77
/// <summary>
88
/// Input data for bundling changelog files
@@ -19,4 +19,3 @@ public class ChangelogBundleInput
1919
public string? Owner { get; set; }
2020
public string? Repo { get; set; }
2121
}
22-

0 commit comments

Comments
 (0)