Commit Graph

101 Commits

Author SHA1 Message Date
John Luo 43350b57b9
Revert "Revert "Improve components infrastructure (#12145)" (#12679)" (#12744)
* Revert "Revert "Improve components infrastructure (#12145)" (#12679)"

This reverts commit e2d57e2806. The improvement to components infrastructure is now reinstated with the following changes:

* Check in release JS artifacts and use them as a fallback when it's not possible to build npmproj.
* Dont' build nodejs in source build.
2019-08-05 15:17:55 -07:00
Ryan Nowak 3cc6e8373b Fail faster in Blazor E2E tests
This change adds a fail-fast mechanism to our E2E tests based on
the browser console. This will fail super hard if an unhandled exception
is thrown.

I think it would be interesting to also see if we could do the same
thing for 404s.

The goal of this change is to make it so that the E2E tests can fail
faster (3-4s) than the 30s timeout in the case that something
catastrophic happens. As a nice side benefit you get to see the
exception message.
2019-08-02 17:23:46 -07:00
Javier Calvarro Nelson 7a0a286ce6
[Blazor][Fixes #12197] Dispose the circuit on graceful disconnections (#12449)
* Immediately releases the circuit when the client disconnects gracefully.
* This functionality is limited to websockets.
* We are able to release the circuit in the following situations:
  * The user closes the browser.
  * The user navigates away.
  * The user reloads the page.
2019-07-31 13:17:00 +02:00
John Luo e2d57e2806
Revert "Improve components infrastructure (#12145)" (#12679)
* Revert "Improve components infrastructure (#12145)"

This reverts commit e149f9c0aa.

* Update JS file
2019-07-29 09:03:57 -07:00
John Luo e149f9c0aa
Improve components infrastructure (#12145)
* Remove generated Web.JS javascript files files

* Build NodeJS project referenced by managed projects by default

* Build Web.JS before other CI jobs

- We can't build Web.JS on Linux Musl for example

* Make BuildAll not override explicit BuildJava/NodeJS/Native/Managed settings

* Capture CodeCheck logs for debugging

* Skip NodeJS projects when generation ref assemblies

* Do not build dependent projects if NodeJS is not built

* Make build fail immediately if BuildNodeJS is true but NodeJS is not installed

* Do not build nodejs in installer builds
2019-07-26 13:31:01 -07:00
Brennan 331ff2404d
Send HttpOnly (if applicable) when deleting cookies (#12593) 2019-07-25 17:42:23 -07:00
Chris Ross 080660967b
Unified response body features (#12328) 2019-07-25 16:27:08 -07:00
Andrew Stanton-Nurse cac51846e9
fix #12516 by cleaning up Hosting error page (#12545)
* fix #12516 by cleaning up error page

* add a Diagnostics.slnf because I was there

* missed the IIS update

* update WebHost's error page

* Fix slnf path
2019-07-25 13:01:00 -07:00
Carlos J. Aliaga 7d050e803f Fixed RequestHeader to allow working with KeyValuePair. #12114 (#12157) 2019-07-14 06:11:50 -07:00
Chris R 8be8e65fcc React to merge conflicts 2019-07-10 16:00:15 -07:00
Doug Bunting 85cd3877a6
Merge branch 'release/2.2' -> 'master'
- remove .NET Framework TFM from src\Shared\test\Shared.Tests\Microsoft.AspNetCore.Shared.Tests.csproj
2019-07-10 10:43:59 -07:00
John Luo 146a483852 Revert unnecessary change from merge 2019-07-09 15:11:04 -07:00
Doug Bunting ae5b18d459
Merge branch 'release/2.1' into release/2.2 2019-07-09 11:28:17 -07:00
Javier Calvarro Nelson 635da5b73a
[Templating] Enforce selenium tests runs on the expected platforms (#11602)
* Will cause the CI environment to fail if the E2E tests stop running by accident.
2019-07-01 14:42:11 +02:00
Nate McMaster 7c809f6c22 Set ReferenceAssemblyAttribute in reference assemblies (#11207)
* Set ReferenceAssemblyAttribute in reference assemblies

* Update ReferenceAssemblyInfo.cs

* Use src project for MVC analyzer tests
2019-06-28 16:08:01 -07:00
Javier Calvarro Nelson 1480b99866
Enforce E2E test prerequisites when building individual solutions only (#11642)
* Fixes multiple issues that happened due to the E2E tests not running on the CI
* Enforces prerequisites for E2E tests on the CI and when building projects with E2E tests.
* Re-enables the E2E tests for templates.
2019-06-29 01:04:36 +02:00
Dylan Dmitri Gray 3cb414afdc
Dylan/event source (#11516)
* Queuing Middleware now supports EventSources. Visibility for: items in queue, duration spent in queue, number of rejected requests.
2019-06-28 15:20:50 -07:00
Hao Kung f35564ba06
Move DataProtection and Extensions.Identity to netstandard2.0/2.1 (#11008) 2019-06-21 14:40:42 -07:00
Nate McMaster 4fde84a7ad Replace KoreBuild with Arcade (#11122)
* Replace usages of $(CI) with $(ContinuousIntegrationBuild)

* Move RepoTasks to eng/tools/

* Remove dead code

* Update build.sh/ps1 to invoke Arcade instead of KoreBuild

* build/repo.props => eng/Build.props

* build/CodeSign.{props,targets} => eng/Signing.props

* build/repo.targets => eng/Build.props, eng/CodeGen.proj, and eng/AfterSolutionBuild.targets

* Remove AddAllProjectRefsToSolution.ps1

* Put selenium process tracking into artifacts/tmp/

* build/docker => eng/docker

* Move content from korebuild.json to global.json

* Remove cibuild.{sh,cmd} and update ci.yml

* Ensure vswhere detects BuildTools installations

* Remove sign check exclusions (Arcade does not support)

* list VS required components in global.json

* Update CodeCheck.ps1

* Update arcade (#11143)

* Fixups to broken build

* capture test results in xunit form
* attempt to fix code check
* restore before linux build
* remove duplicate signinfos

* More build fixes

* exclude node_modules from unique project check
* fixup signing props

* More build fixes

* Remove unused NoWarns
* Skip building site extension
* Suppress xunit color in console output
* Install x86 runtime

* Run KillProcesses.ps1 at end of build on CI

* activate env vars in codecheck.ps1

* Fix signing and generate build manifests

* Fixup code check and linux installers build

* Remove custom restore targets

* Import flaky test props

* Restore original manifest generation code and set warnAsErrors=false

* Alwasy restore the toolset

* More attempts at build fixes

* run restore before building deb/rpm packages
* pre-install Yarn.MSBuild
* Remove WIX workaround

* Attempt to fix RPM installers and x86 build

* Fix helix tests, java auto-detection, and code gen steps

* Globally disable MSBuild node resuse and capture MSbuild crash logs

* Cleanup build invocation for installers

* Set max time on xunit tests to 15 min

* Update helix-test.yml

* Fix Hosting tests

* Fix TestHost

* Fix Negotiate.Test

* Fix Mvc tests

* Capture results

* Fix Hosting tests

* Fix Kestrel tests

* Fix ServerComparison tests

* Fix DefaultBuilder functional tests

* Skip template tests

Need to run pack before running tests on mac/linux now

* Fix Identity test

* Fix ServerComparison tests

* Verify nginx installation on ubuntu

* Verify nginx installation?

* Try adding to path

* Try symlink

* Sudo?

* Woot it works

* Disable timeout

Template tests require more than 15 mins

* list env vars

* Use correct dotnet_home

* Prepent path instead

* Fix npmproj tests

* Fix CORS tests

* Debug signalr tests

* Debug signalr

* Capture bin

* Try building templates sequentially

* Debug signalr

* Cleanup

* Disable signalr npm tests

* Debug template test

* Try to fix templates again and make steps more reliable

* Cleanup

* Feedback
2019-06-19 10:03:38 -07:00
Stephen Halter e727101957
Work around potential race in PipeWriter Redux (#11065)
- Make sure we always await the last flush task before calling FlushAsync
  again instead of preemptively calling FlushAsync and checking to see
  if the ValueTask is incomplete before bothering to acquire the _flushLock
- This now acquires the _flushLock fore every call to Response.Body.Write
  whereas this only happened for truly async writes before.
- I don't think this is a big concern since this should normally be uncontested,
  and DefaultPipeWriter.FlushAsync/GetResult already acquire a lock.
2019-06-13 20:03:29 -07:00
Brennan 902369610a Convert SignalR EventSource usage to new pattern (#11130) 2019-06-13 18:40:00 -07:00
Günther Foidl 90ab2cb965 Spanified Webencoders.Base64UrlEncode (#11047) 2019-06-10 18:18:31 -07:00
John Luo f76be64e5d
Only run selenium tests when build java is specified (#11018) 2019-06-10 14:35:27 -07:00
Chris Ross (ASP.NET) b9c8f34919 Merged PR 1508: [2.2] HttpSys & IIS path normalization
This takes PathNormalizer from Kestrel to normalize the request path and prevent traversals. (e.g. "/./" and "/../").

In 2.1 only HttpSys was affected (https://dev.azure.com/dnceng/internal/_git/aspnet-AspNetCore/pullrequest/1480). In 2.2 HttpSys and IIS-in-proc share this code (with additional tests). In 3.0 we'll refactor it to use more shared source across all three servers.
2019-06-08 06:37:36 +00:00
Chris Ross (ASP.NET) c2bb354675 Merged PR 1480: [2.1] HttpSys path normalization
This takes PathNormalizer from Kestrel to normalize the request path and prevent traversals. (e.g. "/./" and "/../").

In 2.1 only HttpSys was affected. In 2.2 HttpSys and IIS-in-proc will share this code (with additional tests). In 3.0 we'll refactor it to use more shared source across all three servers.
2019-06-07 21:20:28 +00:00
YPTopMan c18fc3d7ca Use throws expressions and expression bodied members (#10764) 2019-06-06 09:56:12 -07:00
Justin Kotalik fdba8a91f9
Add versioning to dotnet-dev-certs (#10908) 2019-06-05 22:04:27 -07:00
Michal Strehovský 9cd2ad15ff Remove use of GetRuntimeInterfaceMap in IsTypeAwaitable (#10572)
`GetRuntimeInterfaceMap` is a rather expensive API and it doesn't look like the use here is warranted.

The replacement should have equivalent behavior.
2019-06-05 10:58:54 -07:00
Hao Kung b75b892eac
Add CertificateAuthentication (#9756) 2019-05-31 22:49:40 -07:00
David Fowler 04bf1bf32e
Implement new bedrock listener abstraction and re-plat Kestrel on top (#10321)
This is a massive set of changes to Kestrel to remove the existing pubternal transport layer and implement a public facing API for listeners and clients, see the details here #10308.

This change only has the server side pieces of the story as I don't want to add the client APIs without having ported SignalR to use them. Here are the highlights:

- Transport.Abstractions is empty (will be removed in a separate PR as it requires removing it from a ton of places)
- TransportConnection has been moved to Connection.Abstractions (we can decide if we need to consolidate with DefaultConnectionContext in a later PR)
- Added FileHandleEndPoint which allows binding to a file handle (could be a pipe or tcp handle)
ListenOptions has been gutted for most pubternal API and returns various types of binding information . The source of truth is the EndPoint instance.
- Cleaned up a bunch of libuv tests decoupling them from Kestrel.Core

## Breaking changes

- Removing pubternal API is itself a breaking change but one that we already planned to do.
- We've removed the ability to set the scheduling mode on Kestrel
- DisposeAsync was added to ConnectionContext 
- NoDelay was removed from ListenOptions. This has been moved to each of the transports. One major difference though is that it's no longer localized per endpoint but is global. We'd need a derived EndPoint type (or maybe extend IPEndPoint) to store both the socket options and the binding information.
2019-05-30 20:34:26 -07:00
Dylan Dmitri Gray 9969e99ef4
Dylan/request throttle (#10413)
* request throttling -- initial implementation

* prevented semaphore leak; added xml docs

* small doc fixes

* reference document

* Added internals folder, added structured logging,

* removed typo'd dependency

* no default MaxConcurrentRequests; other polishing

* renamed SemaphoreWrapper->RequestQueue; cleanup

* moved SyncPoint; prevented possible semaphore leak

* adjusting feedback

* regen refs

* Final changes!
2019-05-27 14:46:14 -07:00
Justin Kotalik a20ddd8374
Make Native components a non-required part for build.cmd, fix IIS native code check (#10435) 2019-05-25 15:20:26 -07:00
Nate McMaster 01a8798936
Update links and disable warnings related to tests that don't work in Helix (#10427) 2019-05-21 16:39:06 -07:00
Nate McMaster 77e08c26d5
Replace all usages of RepositoryRoot with RepoRoot (#10267)
Preparing to adopt the Arcade SDK, which uses the shorter variable name instead
2019-05-15 12:00:19 -07:00
Justin Kotalik 47575a08a5
Handle a few other potentially null properties (#10053) 2019-05-14 18:08:05 -07:00
Justin Kotalik aaaaf572fd
Implement MaxRequestBodySize feature for IIS inprocess (#9475) 2019-05-05 19:30:12 -07:00
Nate McMaster 8863ebfda1
Add --mutex option to yarn commands (#9919)
Attempt to improve reliability of running yarn commands. Our project structure might cause yarn to be launched multiple times. According to yarn docs, this option should avoid conflicts between multiple instances of yarn

https://yarnpkg.com/en/docs/cli/#toc-concurrency-and-mutex
2019-05-02 17:45:55 -07:00
Ben Adams 86728ecc17 Seal some internal derived classes (#9880) 2019-05-01 10:29:05 -07:00
Justin Kotalik 801198c7a9
Fix bad assert (#9835) 2019-04-29 15:40:22 -07:00
Javier Calvarro Nelson 6fa9398781
[MVC][Fixes #8426]TempData does not clear when using __Host- as cookiename prefix (#9741) 2019-04-25 17:32:12 +02:00
Justin Kotalik 87229e315e
Lock during finalizer to not race with dispose in MemoryPoolBlock (#9555) 2019-04-22 15:55:53 -07:00
David Fowler 5f3bdba584
Spanify path -> string logic (#9628)
- Use spans instead of byte[] and array segments when turning the URL into a string
2019-04-22 15:53:56 -07:00
Pavel Krymets 56c064bd53 Display startup errors in ANCM (#8518) 2019-04-18 13:48:48 -07:00
Javier Calvarro Nelson 5889aea06c
Enable custom restore of NPM dependencies for csproj files
Enables custom restore of NPM dependencies for csproj files that require it.
2019-04-14 15:02:37 +02:00
Javier Calvarro Nelson f934bfaa7e
[Https][Tooling] Add digital signature to the KeyUsage of the HTTPS dev-cert (#9293)
* [Https][Tooling] Add digital signature to the KeyUsage of the HTTPS dev-cert
2019-04-12 09:27:54 +02:00
Javier Calvarro Nelson 6f13e7b77a
E2E infrastructure cleanup (#9163) 2019-04-10 17:19:52 +02:00
Javier Calvarro Nelson 4abf766c3c
Update Identity server dependency for preview4 (#9104)
* Updates Identity server dependency for preview4
* Infrastructure improvements.
* Updates react versions.
* Updates migrations.
* Makes templates show up in Visual Studio
2019-04-08 17:06:58 +02:00
Javier Calvarro Nelson 437134f1da
[Infrastructure] Standarize E2E test asserts and increase wait time (#9080)
* Standarize E2E test asserts and increase wait time
2019-04-05 09:00:11 +02:00
Javier Calvarro Nelson 98d8b9ab4a
[Infrastructure] Retry yarn install on failure (#9068)
* [Infrastructure] Retry yarn install on failure
2019-04-04 20:39:52 +02:00
Javier Calvarro Nelson 9f1a978230
[Infrastructure improvements] (#8275)
* Improved selenium start and tear down
  * Selenium is set up and torn down in an assembly fixture.
  * Selenium is initialized lazily and in a non-blocking way.
  * Selenium processes are tracked as part of the build and their pids
    written to a file on disk for cleanup in the event of unexpected
    termination of the test process.
  * Browser fixture retries with linear backoff to create a remote
    driver. Under heavy load (like when we are doing a simultaneous NPM
    restore) the selenium server can become unresponsive so we retry
    three times, with a longer comand timeout allowance each time up to
    a max of 3 minutes.
* Moved test project setup to build time instead of runtime.
  * Added target PrepareForTest to create the required files for testing
    * The template creation folder.
    * The template props file to use our built packages.
    * The folder for the custom hive.
  * Added assembly metadata attributes to find all the data we need to
    run the tests.
    * Path to the artifacts shipping packages folder.
    * Path to the artifacts non-shipping packages folder.
    * Path to the test templates creation folder.
    * Path to use for the custom templating hive used in tests.
  * Proper cleanup as part of the build
    * Remove the test templates creation folder.
    * Remove the test packages restore path.
    * Recreate the test templates creation folder.
    * Recreate the test packages restore path.
  * Generated Directory.Build.Props and Directory.Build.Targets in the
    test templates creation folder.
  * Cleaned up potentially stale templatetestsprops.
* Improved test flows
  * Initialization is done lazily and asynchronously.
    * Selenium
    * Browser fixture
    * Template initialization.
  * Flattened test flows to avoid assertions inside deep callstacks.
    * All assertions happen at the test level with improved error messages.
      * With the exception of the migrations assertions.
    * Assertions contain information about which step failed, for what
      project and what failure details.
  * Broke down tests to perform individual steps instead of mixing build
    and publish.
    * Publish project.
    * Build project. (Debug)
    * Run built project.
    * Run published project.
  * Concentrated build logic into the Project class.
    * Context between the different steps of a test is maintained in
      this class.
    * All operations that require coordination are performed within this
      class.
      * There is a lock for dotnet and a lock for nodejs. When building
        SPAs we acquire the nodejs lock to correctly prevent multiple
        runs of nodejs in parallel.

[ApiAuthorization template cleanups]
  * Fix preview3 issues with breaking changes on Entity framework by
    manually configuring the model in ApiAuthorizationDbContext.
  * Add app.db to the project file when using local db.
  * Fix linting errors on angular template.
  * Fix react tests
  * Add tests to cover new auth options in the SPA templates.
2019-03-20 08:44:20 +01:00