Skip to content

Commit

Permalink
Bringing back fixes that were done in main (#4705)
Browse files Browse the repository at this point in the history
  • Loading branch information
joperezr authored Nov 10, 2023
1 parent 9a48509 commit 32b81eb
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 39 deletions.
13 changes: 1 addition & 12 deletions .github/fabricbot.json
Original file line number Diff line number Diff line change
Expand Up @@ -565,17 +565,6 @@
},
"disabled": false
},
{
"taskType": "trigger",
"capabilityId": "ReleaseAnnouncement",
"subCapability": "ReleaseAnnouncement",
"version": "1.0",
"config": {
"taskName": "Release announcement",
"prReply": "The fix is included in ${pkgName} ${version}.",
"issueReply": "Fixed in ${pkgName} ${version}."
}
},
{
"taskType": "trigger",
"capabilityId": "InPrLabel",
Expand Down Expand Up @@ -637,7 +626,7 @@
{
"name": "addMilestone",
"parameters": {
"milestoneName": "8.0 RC1"
"milestoneName": "8.1"
}
}
],
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Backport PR to branch
on:
issue_comment:
types: [created]
schedule:
# once a day at 13:00 UTC to cleanup old runs
- cron: '0 13 * * *'

permissions:
contents: write
issues: write
pull-requests: write
actions: write

jobs:
backport:
if: ${{ contains(github.event.comment.body, '/backport to') || github.event_name == 'schedule' }}
uses: dotnet/arcade/.github/workflows/backport-base.yml@main
with:
pr_description_template: |
Backport of #%source_pr_number% to %target_branch%
/cc %cc_users%
## Customer Impact
## Testing
## Risk
**IMPORTANT**: If this backport is for a servicing release, please verify that:
- The PR target branch is `release/X.0-staging`, not `release/X.0`.
- If the change touches code that ships in a NuGet package, you have added the necessary [package authoring](https://github.com/dotnet/runtime/blob/main/docs/project/library-servicing.md) and gotten it explicitly reviewed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bld/
.vs/
.build/
.vscode
!.vscode/settings.json

# MSTest test Results
[Tt]est[Rr]esult*/
Expand Down
30 changes: 19 additions & 11 deletions docs/building.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Build instructions

- [Introduction](#introduction)
- [Ubuntu](#ubuntu)
* [Building from command line](#building-from-command-line)
* [Building from Visual Studio Code](#building-from-visual-studio-code)
- [Windows](#windows)
* [Building from command line](#building-from-command-line-1)
* [Building from Visual Studio](#building-from-visual-studio)
* [Building from Visual Studio Code](#building-from-visual-studio-code-1)
- [Build outputs](#build-outputs)
- [Troubleshooting build errors](#troubleshooting-build-errors)
- [Build instructions](#build-instructions)
- [Introduction](#introduction)
- [Ubuntu](#ubuntu)
- [Building from command line](#building-from-command-line)
- [TL;DR](#tldr)
- [Various scripts to build and test the solution](#various-scripts-to-build-and-test-the-solution)
- [Building from Visual Studio Code](#building-from-visual-studio-code)
- [Windows](#windows)
- [Building from command line](#building-from-command-line-1)
- [TL;DR](#tldr-1)
- [Various scripts to build and test the solution](#various-scripts-to-build-and-test-the-solution-1)
- [Building from Visual Studio](#building-from-visual-studio)
- [TL;DR](#tldr-2)
- [Various scripts to build and test the solution](#various-scripts-to-build-and-test-the-solution-2)
- [Building from Visual Studio Code](#building-from-visual-studio-code-1)
- [Build outputs](#build-outputs)
- [Troubleshooting build errors](#troubleshooting-build-errors)
- [\`\`\`](#)

## Introduction

Expand Down Expand Up @@ -45,7 +53,7 @@ Here are few commands that you will likely use the most:
- `build.sh --restore`: to install the required .NET SDK, .NET tools and the toolset. This is equivalent to running `./restore.sh`.
- `build.sh --build`: to build the solution<sup>1</sup>.
- `build.sh --test`: to run all unit tests in the solution<sup>1</sup>.
- `build.sh --vs <keywords>`: to generate a "filtered" solution and save it as `SDK.sln`. It also performs the "restore" operation. For example: `./build.sh --vs Http,Fakes`.<br />
- `build.sh --vs <keywords>`: to generate a "filtered" solution and save it as `SDK.sln`. It also performs the "restore" operation. Keywords can be any part of the name or path of project files you want to include. For example: `./build.sh --vs Http,Fakes,AspNetCore`.<br />
If for some reason you wish to generate a solution with all projects you can pass `*` for the keyword, e.g.: `./build.sh --vs '*'` (Note: you have to escape the asterisk or use `set -f` to turn off expansion).<br />
> Under the hood, this invokes `scripts/Slngen.ps1` script, which in turn executes [slngen tool][slngen-tool]. If you want to customize how the "filtered" solution is generated, you will need to invoke `scripts/Slngen.ps1` script directly.<br />
Run `./scripts/Slngen.ps1 -help` for more details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public ExceptionSummarizer(IEnumerable<IExceptionSummaryProvider> providers)
public ExceptionSummary Summarize(Exception exception)
{
_ = Throw.IfNull(exception);

var exceptionType = exception.GetType();
var exceptionTypeName = exception.GetType().Name;
var exceptionTypeName = exceptionType.Name;

// find a match for the exception type or a base type thereof
var type = exceptionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Microsoft.Extensions.Diagnostics.Enrichment;

/// <summary>
/// Augments log records with additional properties.
/// Represents a component that augments log records with additional properties.
/// </summary>
public interface ILogEnricher
{
Expand Down
3 changes: 1 addition & 2 deletions src/Shared/Pools/PooledListPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using Microsoft.Extensions.ObjectPool;

#pragma warning disable CA1716
namespace Microsoft.Shared.Pools;

/// <summary>
Expand All @@ -19,7 +18,7 @@ private PooledListPolicy()
{
}

public override List<T> Create() => new();
public override List<T> Create() => [];

public override bool Return(List<T> obj)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void Triggers()
Assembly.GetAssembly(typeof(ImmutableDictionary<,>))!,
Assembly.GetAssembly(typeof(FrozenDictionary<,>))!,
},
new[] { Source }).ConfigureAwait(false);
new[] { Source });

Assert.Equal(54, d.Count);
for (int i = 0; i < d.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void Foo()
Assembly.GetAssembly(typeof(System.Collections.Queue))!,
Assembly.GetAssembly(typeof(System.Collections.Specialized.HybridDictionary))!
},
new[] { Source }).ConfigureAwait(false);
new[] { Source });

Assert.Equal(8, d.Count);
for (int i = 0; i < d.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static partial class Log
new CallAnalyzer(),
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OriginalSource, OriginalTarget }).ConfigureAwait(false);
new[] { OriginalSource, OriginalTarget });

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -170,7 +170,7 @@ static partial class Log
new CallAnalyzer(),
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))! },
new[] { OriginalSource, OriginalTarget }).ConfigureAwait(false);
new[] { OriginalSource, OriginalTarget });
actualSource = l[0];
actualTarget = l[1];
Expand Down Expand Up @@ -234,7 +234,7 @@ static partial class Log
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OriginalSource },
extraFile: "Log.cs").ConfigureAwait(false);
extraFile: "Log.cs");

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -297,7 +297,7 @@ static partial class Log
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OriginalSource },
extraFile: "Log.cs").ConfigureAwait(false);
extraFile: "Log.cs");

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -358,7 +358,7 @@ static partial class Log
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OriginalSource },
extraFile: "Log.cs").ConfigureAwait(false);
extraFile: "Log.cs");

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -434,7 +434,7 @@ static partial class Log
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OriginalSource },
extraFile: "Log.cs").ConfigureAwait(false);
extraFile: "Log.cs");

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -684,7 +684,7 @@ static partial class Log
new CallAnalyzer(),
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OrriginalSource, OrriginalTarget }).ConfigureAwait(false);
new[] { OrriginalSource, OrriginalTarget });

var actualSource = l[0];
var actualTarget = l[1];
Expand Down Expand Up @@ -746,7 +746,7 @@ static partial class Log
new CallAnalyzer(),
new LegacyLoggingFixer(),
new[] { Assembly.GetAssembly(typeof(ILogger))!, Assembly.GetAssembly(typeof(LoggerMessageAttribute))! },
new[] { OrriginalSource, OrriginalTarget }).ConfigureAwait(false);
new[] { OrriginalSource, OrriginalTarget });

var actualSource = l[0];
var actualTarget = l[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDes
}
catch (ArgumentOutOfRangeException)
{
Assert.True(false, $"Unexpected warning {actual}");
Assert.Fail($"Unexpected warning {actual}");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,6 @@ public static void Snapshot()

snap = collector.GetMeasurementSnapshot(true);
Assert.Equal(3, snap.Count);
Assert.Equal(0, collector.GetMeasurementSnapshot().Count);
Assert.Empty(collector.GetMeasurementSnapshot());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public static void CollectorContract()
[Fact]
public static void ReadOnlyListContract()
{
#pragma warning disable xUnit2013 // Do not use equality check to check for collection size.
const string PropName = "Property Name";
const string Value = "Value";

Expand Down Expand Up @@ -170,5 +171,6 @@ public static void ReadOnlyListContract()
}

Assert.Equal(1, count);
#pragma warning restore xUnit2013 // Do not use equality check to check for collection size.
}
}

0 comments on commit 32b81eb

Please sign in to comment.