Skip to content

Commit

Permalink
Restructure shared http code (#32141)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher authored Feb 12, 2020
1 parent ed9fed1 commit 8d70cae
Show file tree
Hide file tree
Showing 47 changed files with 147 additions and 246 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
# See https://help.github.com/articles/about-code-owners/

/src/libraries/Common/src/System/Net/Http/Http2/ @dotnet/http2
/src/libraries/Common/tests/Tests/System/Net/Http2/ @dotnet/http2
/src/libraries/Common/src/System/Net/Http/aspnetcore/ @dotnet/http2
/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ @dotnet/http2
/src/libraries/System.Text.Json/ @ahsonkhan @steveharter @layomia @Jozkee
/src/libraries/System.Buffers/ @ahsonkhan
/src/libraries/System.Memory/ @ahsonkhan
19 changes: 0 additions & 19 deletions src/libraries/Common/src/System/Net/Http/Http2/CopyToAspNetCore.sh

This file was deleted.

14 changes: 0 additions & 14 deletions src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.cmd

This file was deleted.

19 changes: 0 additions & 19 deletions src/libraries/Common/src/System/Net/Http/Http2/CopyToRuntime.sh

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ IF [%remote_repo%] == [] (

echo ASPNETCORE_REPO: %remote_repo%

robocopy . %remote_repo%\src\Shared\Http2 /MIR
robocopy .\..\..\..\..\..\tests\Tests\System\Net\Http2\ %remote_repo%\src\Shared\test\Shared.Tests\Http2 /MIR
robocopy . %remote_repo%\src\Shared\runtime /MIR
robocopy .\..\..\..\..\..\tests\Tests\System\Net\aspnetcore\ %remote_repo%\src\Shared\test\Shared.Tests\runtime /MIR
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ cd "$(dirname "$0")" || exit 1

echo "ASPNETCORE_REPO: $remote_repo"

rsync -av --delete ./ "$remote_repo"/src/Shared/Http3
rsync -av --delete ./../../../../../tests/Tests/System/Net/Http3/ "$remote_repo"/src/Shared/test/Shared.Tests/Http3
rsync -av --delete ./ "$remote_repo"/src/Shared/runtime
rsync -av --delete ./../../../../../tests/Tests/System/Net/aspnetcore/ "$remote_repo"/src/Shared/test/Shared.Tests/runtime
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ IF [%remote_repo%] == [] (

echo RUNTIME_REPO: %remote_repo%

robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\Http3 /MIR
robocopy .\..\test\Shared.Tests\Http3 %remote_repo%\src\libraries\Common\tests\Tests\System\Net\Http3 /MIR
robocopy . %remote_repo%\src\libraries\Common\src\System\Net\Http\aspnetcore /MIR
robocopy .\..\test\Shared.Tests\runtime %remote_repo%\src\libraries\Common\tests\Tests\System\Net\aspnetcore /MIR
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ cd "$(dirname "$0")" || exit 1

echo "RUNTIME_REPO: $remote_repo"

rsync -av --delete ./ "$remote_repo"/src/libraries/Common/src/System/Net/Http/Http3
rsync -av --delete ./../test/Shared.Tests/Http3/ "$remote_repo"/src/libraries/Common/tests/Tests/System/Net/Http3
rsync -av --delete ./ "$remote_repo"/src/libraries/Common/src/System/Net/Http/aspnetcore
rsync -av --delete ./../test/Shared.Tests/runtime/ "$remote_repo"/src/libraries/Common/tests/Tests/System/Net/aspnetcore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
The code in this directory is shared between dotnet/runtime and aspnet/AspNetCore. This contains HTTP/2 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories.
The code in this directory is shared between dotnet/runtime and dotnet/AspNetCore. This contains HTTP/2 and HTTP/3 protocol infrastructure such as an HPACK implementation. Any changes to this dir need to be checked into both repositories.

dotnet/runtime code paths:
- runtime\src\libraries\Common\src\System\Net\Http\Http2
- runtime\src\libraries\Common\tests\Tests\System\Net\Http2
- runtime\src\libraries\Common\src\System\Net\Http\aspnetcore
- runtime\src\libraries\Common\tests\Tests\System\Net\aspnetcore

aspnet/AspNetCore code paths:
- AspNetCore\src\Shared\Http2
- AspNetCore\src\Shared\test\Shared.Tests\Http2
dotnet/AspNetCore code paths:
- AspNetCore\src\Shared\runtime
- AspNetCore\src\Shared\test\Shared.Tests\runtime

## Copying code
- To copy code from dotnet/runtime to aspnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd.
- To copy code from aspnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd.
- To copy code from dotnet/runtime to dotnet/AspNetCore, set ASPNETCORE_REPO to the AspNetCore repo root and then run CopyToAspNetCore.cmd.
- To copy code from dotnet/AspNetCore to dotnet/runtime, set RUNTIME_REPO to the runtime repo root and then run CopyToRuntime.cmd.

## Building dotnet/runtime code:
- https://github.com/dotnet/runtime/tree/master/docs/workflow
Expand All @@ -23,14 +23,14 @@ aspnet/AspNetCore code paths:
- `PS D:\github\runtime\src\libraries\Common\tests> dotnet msbuild /t:rebuildandtest`
- `PS D:\github\runtime\src\libraries\System.Net.Http\tests\UnitTests> dotnet msbuild /t:rebuildandtest`

## Building aspnet/AspNetCore code:
- https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md
## Building dotnet/AspNetCore code:
- https://github.com/dotnet/AspNetCore/blob/master/docs/BuildFromSource.md
- Run restore in the root once: `PS D:\github\AspNetCore> .\restore.cmd`
- Activate to use the repo local runtime: `PS D:\github\AspNetCore> . .\activate.ps1`
- Build the individual projects:
- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet msbuild`
- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\src> dotnet msbuild`

### Running aspnet/AspNetCore tests:
### Running dotnet/AspNetCore tests:
- `(AspNetCore) PS D:\github\AspNetCore\src\Shared\test\Shared.Tests> dotnet test`
- `(AspNetCore) PS D:\github\AspNetCore\src\servers\Kestrel\core\test> dotnet test`
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
<data name="net_http_invalid_header_name" xml:space="preserve">
<value>Received an invalid header name: '{0}'.</value>
</data>
<data name="net_http_qpack_no_dynamic_table" xml:space="preserve">
<value>No dynamic table support</value>
</data>
<data name="net_http_request_invalid_char_encoding" xml:space="preserve">
<value>Request headers must contain only ASCII characters.</value>
</data>
Expand Down
60 changes: 30 additions & 30 deletions src/libraries/Common/tests/Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,44 +54,44 @@
<Compile Include="$(CommonPath)System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs">
<Link>Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\IHttpHeadersHandler.cs">
<Link>Common\System\Net\Http\Http2\IHttpHeadersHandler.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\IHttpHeadersHandler.cs">
<Link>Common\System\Net\Http\aspnetcore\IHttpHeadersHandler.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\DynamicTable.cs">
<Link>Common\System\Net\Http\Http2\Hpack\DynamicTable.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HeaderField.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HeaderField.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HPackDecoder.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HPackDecoder.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HPackDecodingException.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HPackDecodingException.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HPackEncoder.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HPackEncoder.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HPackEncodingException.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HPackEncodingException.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\Huffman.cs">
<Link>Common\System\Net\Http\Http2\Hpack\Huffman.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\HuffmanDecodingException.cs">
<Link>Common\System\Net\Http\Http2\Hpack\HuffmanDecodingException.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\IntegerDecoder.cs">
<Link>Common\System\Net\Http\Http2\Hpack\IntegerDecoder.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\IntegerEncoder.cs">
<Link>Common\System\Net\Http\Http2\Hpack\IntegerEncoder.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\H2StaticTable.cs">
<Link>Common\System\Net\Http\Http2\Hpack\H2StaticTable.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\Http2\Hpack\StatusCodes.cs">
<Link>Common\System\Net\Http\Http2\Hpack\StatusCodes.cs</Link>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Text\ReusableTextReader.cs">
<Link>Common\System\Text\ReusableTextReader.cs</Link>
Expand Down Expand Up @@ -124,10 +124,10 @@
<Compile Include="Tests\System\Collections\Generic\LargeArrayBuilderTests.cs" />
<Compile Include="Tests\System\IO\RowConfigReaderTests.cs" />
<Compile Include="Tests\System\Net\HttpKnownHeaderNamesTests.cs" />
<Compile Include="Tests\System\Net\Http2\DynamicTableTest.cs" />
<Compile Include="Tests\System\Net\Http2\HPackDecoderTest.cs" />
<Compile Include="Tests\System\Net\Http2\HPackIntegerTest.cs" />
<Compile Include="Tests\System\Net\Http2\HuffmanDecodingTests.cs" />
<Compile Include="Tests\System\Net\aspnetcore\Http2\DynamicTableTest.cs" />
<Compile Include="Tests\System\Net\aspnetcore\Http2\HPackDecoderTest.cs" />
<Compile Include="Tests\System\Net\aspnetcore\Http2\HPackIntegerTest.cs" />
<Compile Include="Tests\System\Net\aspnetcore\Http2\HuffmanDecodingTests.cs" />
<Compile Include="System\Net\Sockets\Fletcher32.cs">
<Link>System\Net\Sockets\Fletcher32.cs</Link>
</Compile>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The code in this directory is shared between the runtime libraries and AspNetCore. This contains tests for HTTP/2 and HTTP/3 protocol infrastructure such as HPACK. Any changes to this dir need to be checked into both repositories.

For additional details see:
- runtime/src/libraries/Common/src/System/Net/Http/aspnetcore/ReadMe.SharedCode.md
- AspNetCore/src/Shared/runtime/ReadMe.SharedCode.md
Loading

0 comments on commit 8d70cae

Please sign in to comment.