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

Backmerge main 30 may 2022 #1280

Merged
merged 234 commits into from
Jun 2, 2022
Merged

Conversation

amitksingh1490
Copy link
Collaborator

No description provided.

girdharshubham and others added 30 commits January 12, 2022 20:43
* doc: add categories

* refactor: doc structure refactored

* fix: package-lock.json removed

* refactor: create outline sub-directories

* refactor: rename test to testing
* Disable benchmarks on fork PR

* run benchmarks on fork PR but disbable PR comment
* feat(Headers):added new api to update headers

* renamed api
* feat(cookie): added secret in cookie

* feat(cookie): added signcookie middleware

* feat(cookie): scalafmt

* fix(cookie): sign cookie while encoding

* scalafmt

* fix(Cookie): added unsign method for cookie

* fix(cookie): minor changes

* fix(signCookieMiddleware: simplified signCookies

* fix(cookie): removed try catch from signContent

* cookie: throw error in verify

* cookie: throw error in verify

* verify method changes

* fixed test cases

* fix: removed decodeResponseSignedCookie

* fix: middlewareSpec

* added modifyheaders in middleware

* removed unwanted changes

* scalafmt

* refactoring

* refactoring

* build fix

* build fix

* fix: decodeResponseCookie

* added modify
* Failing test

* Fix echo streaming

* Pr Comments
* doc(Getting started): updated examples

* docs: updated basic examples
* #834 - fix and test for the bug.

* applied suggested change
* Update sbt-bloop to 1.4.12

* Update sbt-bloop to 1.4.12
* Update scala-library to 2.13.8

* Regenerate workflow with sbt-github-actions
* Add configuration builder methods to zhttp.service.Server

* Update zio-http/src/main/scala/zhttp/service/Server.scala

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>

* Update zio-http/src/main/scala/zhttp/service/Server.scala

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>

* Update zio-http/src/main/scala/zhttp/service/Server.scala

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>

* Change some server with* builder methods (enable parameter)

* Server withAcceptContinue(enabled)

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
* wip: try server codec without validation

* wip: remove flush consolidator

* wip: use wrapped buffer

* wip: add flush consolidator

* perf: make response encoding checks faster

* use encoder and decoder (#733)

* wip: remove Request creation

* use encoder and decoder

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>

* disable object aggregator

* disable object aggregator

* revert disable object aggregator

* doc: update scala doc

* perf: freeze the HttpResponse

Co-authored-by: Amit Kumar Singh <amit.singh@dream11.com>
Co-authored-by: amitsingh <amitksingh1490@gmail.com>
* refactor: remove type-params from Response

* chore: self review

* refactor: rename Middleware to HttpMiddleware

* refactor: add `@@@` to Http as an alternative to `@@`.

* feature: add new Middleware API

* feature: add `flatten` and `ifThenElse`

* feature: add `ifThenElseZIO`

* refactor: fix type params for `identity`

* feature: add `when`

* feature: add `make` constructor

* refactor: make middleware methods final

* refactor: git remains

* refactor: implement HttpMiddleware as Middleware

* scala3 fix

* Refactor CORS middleware (#788)

* Refactor/merge middleware and http middleware (#790)

* Refactor move cors and timeout

* move some httpMiddlewares to Middleware

* move some AuthMiddleware to Middleware

* move remaining AuthMiddleware to Middleware

* move Middlewares to middleware package

* scaladoc

* codec example

* move Middleware to http package

* named alias for `@@`

* rename Auth to AuthMiddlewares

* rename CORSMiddleware to CorsMiddlewares

* rename CSRF to CsrfMiddlewares

* make primitives private

* rename MiddlewareExtensions to HttpMiddlewares

* rename operators in HttpMiddlewares

* scalaDoc

* arg rename

* doc update and general refactor

* simplify cors middleware

* rename CorsConfig

* renames

* Make middlewares package private MiddlewareRequest

* Introduce MiddlewareRequest (#798)

* Introduce MiddlewareRequest

* PR review comments

* Refactor move runAfter to Middleware

* refactor: add `UMiddleware`

* feature: add `contramapZIO`

* refactor: move cors config to Cors file

* refactor: rename files

* refactor: remove AuthSpec from WebSpec

* refactor: fix naming for Http operators

* refactor: add partial type suport for contraMapZIO

* Refactor: Codec (#841)

* Add Run Before (#840)

* Add Run Before

* Add Run Before and After

* use renamed operator

* refactor: add partial type suport for contraMap

* Implement missing operators in Middleware (#807)

* Implement missing operators in Middleware

* fix as operator

* headers Middleware changes

* sign cookie

* extend with HeaderExtensions

* rename suite

* PR comments

* refactor: use `Request` instead of `MiddlewareRequest`

* refactor: rename methods

* refactor: resolve fix me issue

Co-authored-by: amitsingh <amitksingh1490@gmail.com>
Co-authored-by: Amit Kumar Singh <amit.singh@dream11.com>
* feat(Client): Add host in client from absolute URL

* feat(Client): Refactor and add spec for host value

* feat(Client): fmt formatting

* feat(Client): fmt formatting

* feat(Client): use setHeaders from netty

* feat(Client): Add spec for host

* feat(Client): Add spec for host

* feat(Client): Rename clientParams to clientRequest
* Update scala3-library to 3.1.1

* Regenerate workflow with sbt-github-actions
* doc: add categories

* refactor: doc structure refactored

* fix: package-lock.json removed

* refactor: create outline sub-directories

* initial draft on Headers documentaiton

* refactor: rename test to testing

* migrated Headers doc in the right structure

* re-organized the section. added more examples on the service, client and middleware side.

* updated documentation

* updated based on review

* more updates

* more updates

* minor changes

* minor changes

* Update docs/website/docs/v1.x/dsl/headers/index.md

* Update docs/website/docs/v1.x/dsl/headers/index.md

Co-authored-by: Shubham Girdhar <girdharshubham@hotmail.com>
Co-authored-by: amitsingh <amitksingh1490@gmail.com>
Co-authored-by: Amit Kumar Singh <amit.singh@dream11.com>
* feat: added validation app for HExit without zio

* feat: removed type from validationAppSpec

* test: Iterating using HttpGen.Method

* test: rearranged status method params

* test: name fixes
d11-amitsingh and others added 22 commits May 20, 2022 13:54
* Update scalafmt-core to 3.5.4

* Reformat with scalafmt 3.5.4
* feature: add `IsMono` type-constraint

* refactor: add `MonoMiddleware`

* fix: type params in middleware.identity and middleware.allow, middleware.when
* Update scalafmt-core to 3.5.5

* Reformat with scalafmt 3.5.5
* implemented logging configuration to be able to invesigate netty layer issues

* the low level logger should be off by default. logback config should be set to info to not log during tests.

* wip

* using internal logging

* implemented simple console logging that is not allocated any memory for the log content when it is disabled or the log level is not matching the log level of the content.

* improved the logging api

* udated workflow and added more logging

* removed unused file

* removed unused code.

* extended loggig settings in configuration to provide ability to set different logging levels.

* added more logging and set benchmark in DEBBUG mode.

* fixed merge

* fixed formatting

* changed logging level to INFO

* change logging level for confing details

* disabled logging from benchmark

* doc: add scala dzio-http/src/test/scala/zhttp/internal/HttpGen.scalaoc

* remove: support logging of throwable

* refactor: rename params

* refactor: reorder methods

* refactor: Move ConsoleLogger into LogFrontend

* refactor: Simplify LoggerFactory

* refactor: use `Logger.make` for generating a Logger

* refactor: simplify LoggerMacro for 2.13

* refactor: simplify LogFrontend

* refactor: move LogLine inside of LogFormat

* refactor: add apply method on LogFormat

* refactor: add LogTransport

* refactor: add Glogger

* working version after refactoring

* more refactoring

* added location information, from where the log has been invoked

* fixed after merge

* fixed scala 2.12 compilation

* migrating scala 3 macro wip

* re-implemented based on new design. Single LoggerTransport for now is implemented.

* refactor: removed InternalLogger and the macro sbt package

* wip adding another transport

* updated ci workflow

* fixed scala 3 macro

* formatted

* fixed scala 3 macro

* removed compiler warning for scala 3

* more simplifications

* added file transport implementation

* added integration tests

* updated usage of logger in zio-http

* updated tests to use api for java 8 only, added tags support in LogFormat

* updated test to work also with scala 2.12

* more simplifications

* fixed imports

* updated server API to allow users of the API to provide a custom logger

* more simplifications - the name of the logger was redundant as we have tags and location as part of the log line

* updated example and added more log to server implementation

* undo the exmple changes

* refactor: rename logLevels

* refactor: make LoggerFactory.Live private

* refactor: clean up the logger a bit

* refactor: make LogTransport private to Logger

* doc: add scala doc in netty logger

* doc: update scala doc

* chore: remove unnecessary build changes

* refactor: LogFrontend and LoggerTransport

* style: fmt

* feature: add `autodetectLevel` and `startsWith` operators on Logger

* feat: add `detectFromEnv` method to LogLevel

* refactor: update Scala doc from Logger.scala

* refactor: disable logging by default while reading loglevel from env

* refactor: rename file

* refactor: simplify LogTransport

* feature: add `dispatch` and operators to modify tags

* perf: optimize Logger's macro implementation

* scala 3 macro fixes and other cosmetic changes

* logger transport will discard the log line based on log transport log level.

* used SourcePos instead of passing 2 values around, only trace will provide source location information

* fixed flaky test

* style: reorder methods in Server

* feature: add More LogDetection logic

* refactor: drop `tags` from LogStatement

* feature: add splat operator for withTags

* refactor: add `detechLevelFromProps`

* chore: update default app to HelloWorld

* refactor: cleanup LogFormat

* refactor: remove redundant `withTag` operator

* refactor: cleanup log statements in Server

* performance: optimize scala 3 output

* removed logging from API. the Log instance is created with LogLevel read from env. If the ZHTTP_LOG_LEVEL env variable is not defined then the Log instance has LogLevel set to Disable.

* formatting

* formatting

* more tests for logger using an in memory transport

* fixed for scala 2.12

* fix for scala 3

* removed logger api documentation

* added empty line

* update log tests

* macro updated to check if the level is enabled for a certain log level

* trading maintenability for performance: extended LoggerMacroExtension to provide enable checks for each level.

* added isEnabled flag in logger

* chore: set default LogLevel to INFO

* style: remove unnecessary bracket

* refactor: add Logging.scala

* refactor: update ChannelInitializer LogStatement

* refactor: Update log statement inside of runtime

* refactor: Change default LogLevel to `Error`

* refactor: use `SimpleName` for class names

* formatting

* removed debug log statements.

* rolled back last change

* minor correction in test name

* short circuit the logl level cheks when logger is disabled

* refactor: add more operators to compare LogLevel

* chore: update scala-settings to ignore unused parameters

* refactor: add detectedLogLevel

* refactor: change dispatch signature

* refactor: add tests for LogLevel

* refactor: rename formats

* refactor: clean-up logLevel

* refactor: drop `Disable` level for Logging

* refactor: LoggerTransport to become an abstract class

* refactor: simplify LoggerSpec

* chore: update build

* chore: update ScalaSettings

* if the env value is not matching any defined log levels, than the log level will be set to Error.

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
Co-authored-by: amitsingh <amitksingh1490@gmail.com>
* replaced  with  in tests where the generator was non-deterministic, fixed URL spec.

* updated on Cookie

* updated cookie implementation to fix failing tests. There is one breaking change on the Cookie API -  Cookie.decodeRequestCookie is returning LIst[String]

* removed debug code

* in case of empty AsciiString the ByteBuf should be empty

* rolled back previous change. According to http spec  header SHOULD be present in case the conntent is empty.
* outline for middleware documentation

* addded transforming output middleware

* added more

* minor changes

* minor changes

* revert

* changes

* removed folder

* added links

* review changes

* doc: updated

* Added some background about need for Middlewares and handling aspects

* arranging some lines

* added example of cleaner code using middlewares

* correcting statement

* rectifying grammatical mistakes

* some more grammar clean up

* restructuring the doc; explain concepts without using lots of code

* presenting middlewares

* inserted a new line

* A more elaborate introduction to middleware in zio-http

* trim example code

* added more step by step examples

* detailed example of the operator ++

* corrected a sentence

* improve description of ++ operator

* improve description of ++ operator

* simple examples for operators

* mention combinators

* correcting HTTP definition

* incorporate feedback

* difference b/w ++ and >>> operators

* cover only selective composition operators in detail

* concise description of operators

* clarifying middleware creation

* more cleaner and easy to understand definition of an aspect

* more cleaner and easy to understand definition of an aspect

* more cleaner and easy to understand definition of an aspect

* clarifying identity function

* clarifying aspects a little more

* clarifying aspects a little more

* clarifying aspects a little more

* elaborate benefits of using middlewares

* elaborate benefits of using middlewares

* elaborate benefits of using middlewares

* explain @@ operator

* more explanation for identity middleware

* more explanation for middleware type parameters

* more explanation for middleware type parameters

* more explanation for middleware type parameters

* more explanation for middleware type parameters

* more explanation for middleware type parameters

* Re-structuring the document based on non-scala programmer's feedback

* Correcting code snippets

* Correcting code snippets

* grammar correction

* grammar correction

* Added advanced example to show middleware transformations

* incorporating review comments

* grammarly corrections

* improve explanation of codec middleware

Co-authored-by: Sumant Awasthi <sumant.awasthi@D11-Sumant.Awasthi>
Co-authored-by: shrutiverma97 <shruti@dream11.com>
* scheme: added unsafeDecode

* removed extra code

* refactor

* added decode back

* added scala doc

* unsafe inside decode

* removed unwanted changes

* workflow update

* unsafe method private

* added private zhttp in method
* --wip-- [skip ci]

* implementation for apply

* trailing slash fix

* refactor: split path file

* test: restructure tests

* test: add failing test for Path

* refactor: re-write path using Vector

* refactor: remove LeadingSlash

* fix: encoding error in Http

* feat: implement `toString` using `Encode`

* fix: update cookie spec

Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
* Fix type in ZIO.scoped call for deployWS

* Apply formatting
@amitksingh1490 amitksingh1490 marked this pull request as ready for review June 2, 2022 10:10
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2022

Codecov Report

Merging #1280 (7399f67) into zio-series/2.x (fde3050) will increase coverage by 0.92%.
The diff coverage is 72.69%.

@@                Coverage Diff                 @@
##           zio-series/2.x    #1280      +/-   ##
==================================================
+ Coverage           58.11%   59.03%   +0.92%     
==================================================
  Files                  74       70       -4     
  Lines                2466     2468       +2     
  Branches               73       68       -5     
==================================================
+ Hits                 1433     1457      +24     
+ Misses               1033     1011      -22     
Impacted Files Coverage Δ
...tp/src/main/scala/zhttp/http/middleware/Csrf.scala 80.00% <ø> (ø)
...ala/zhttp/service/logging/NettyLoggerFactory.scala 0.00% <0.00%> (ø)
...scala/zhttp/service/server/LogLevelTransform.scala 0.00% <0.00%> (ø)
...o-http/src/main/scala/zhttp/socket/SocketApp.scala 37.14% <ø> (ø)
...p/src/main/scala/zhttp/socket/WebSocketFrame.scala 25.80% <0.00%> (-9.68%) ⬇️
zio-http/src/main/scala/zhttp/http/Http.scala 64.25% <22.22%> (-1.96%) ⬇️
zio-http/src/main/scala/zhttp/http/Request.scala 33.33% <25.00%> (-16.67%) ⬇️
zio-http/src/main/scala/zhttp/http/package.scala 41.66% <36.36%> (-58.34%) ⬇️
...http/service/server/ServerChannelInitializer.scala 82.60% <40.00%> (-12.13%) ⬇️
...main/scala/zhttp/service/WebSocketAppHandler.scala 41.66% <50.00%> (-14.34%) ⬇️
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fde3050...7399f67. Read the comment docs.

@amitksingh1490 amitksingh1490 merged commit 085ea0d into zio-series/2.x Jun 2, 2022
@amitksingh1490 amitksingh1490 deleted the backmerge-main-30-may-2022 branch June 2, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.