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

some improvements per feedback #7018

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
- Removed property method 'Set' for 'String PropertyToChangeToGet' in type Azure.ResourceManager.AppService.TestProperty
- Removed type 'Azure.ResourceManager.AppService.TypeToBeDeleted'

### Other Changes
### Features Added

- spec upgraded

### Other Changes

- Azure Core upgraded
- Azure RM upgraded
- Obsoleted method 'Void StaticMethodToBeObsoleted()' in type Azure.ResourceManager.AppService.StaticTypeToBeObsoleted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ public Release GenerateReleaseNote(string version, string date, List<ChangeCatog
Logger.Error("Breaking change detected which is not expected\n" + breakingGroup.ToString());
}

ReleaseNoteGroup othersGroup = new ReleaseNoteGroup("Other Changes");
ReleaseNoteGroup featureAddedGroup = new ReleaseNoteGroup("Features Added");
if (SpecVersionChange != null)
othersGroup.Notes.Add(new ReleaseNote(SpecVersionChange.Description, PREFIX));
featureAddedGroup.Notes.Add(new ReleaseNote(SpecVersionChange.Description, PREFIX));
if (featureAddedGroup.Notes.Count > 0)
report.Groups.Add(featureAddedGroup);

ReleaseNoteGroup othersGroup = new ReleaseNoteGroup("Other Changes");
if (AzureCoreVersionChange != null)
othersGroup.Notes.Add(new ReleaseNote(AzureCoreVersionChange.Description, PREFIX));
if (AzureResourceManagerVersionChange != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Context
public string AzureCoreChangeLogGithubKey => "sdk/core/Azure.Core/CHANGELOG.md";
public string AzureCoreChangeLogMdFile => Path.Combine(RepoRoot, AzureCoreChangeLogGithubKey);

public string AzureResourceManagerChangeLogGithubKey => "sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.MD";
public string AzureResourceManagerChangeLogGithubKey => "sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md";
public string AzureResourceManagerChangeLogMdFile => Path.Combine(RepoRoot, AzureResourceManagerChangeLogGithubKey);

public bool IsPreview => Helper.IsPreviewRelease(this.ReleaseVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void MergeByOverwrite(Release to)

private void MergeByGrup(Release to)
{
foreach(var fromGroup in this.Groups)
foreach (var fromGroup in this.Groups)
{
var found = to.Groups.FirstOrDefault(g => g.Name == fromGroup.Name);
if (found != null)
Expand All @@ -81,21 +81,24 @@ private void MergeByGrup(Release to)

private void MergeByLine(Release to)
{
foreach(var fromGroup in this.Groups)
foreach (var fromGroup in this.Groups)
{
var toGroup = to.Groups.FirstOrDefault(g => string.Equals(g.Name, fromGroup.Name, StringComparison.OrdinalIgnoreCase));
if(toGroup == null)
if (toGroup == null)
{
to.Groups.Add(fromGroup);
}
else
{
foreach(var fromItem in fromGroup.Notes)
int indexToInsert = toGroup.Notes.FindLastIndex(n => !string.IsNullOrEmpty(n.Note)) + 1;
int lastNonEmptyIndex = fromGroup.Notes.FindLastIndex(n => !string.IsNullOrEmpty(n.Note));
for (int i = lastNonEmptyIndex; i >= 0; i--)
{
var fromItem = fromGroup.Notes[i];
var toItem = toGroup.Notes.FirstOrDefault(t => string.Equals(fromItem.ToString(), t.ToString(), StringComparison.OrdinalIgnoreCase));
if(toItem == null)
if (toItem == null)
{
toGroup.Notes.Add(fromItem);
toGroup.Notes.Insert(indexToInsert, fromItem);
}
else
{
Expand Down Expand Up @@ -133,7 +136,7 @@ public static List<Release> FromChangelog(string changelog)
Release curRelease = firstRelease!;

ReleaseNoteGroup curGroup = new ReleaseNoteGroup("");
for(i = i+1; i < lines.Length; i++)
for (i = i + 1; i < lines.Length; i++)
{
if (ReleaseNoteGroup.TryParseGroupTitle(lines[i], out ReleaseNoteGroup? newGroup))
{
Expand Down