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

release 4.3 #4449

Closed
wants to merge 340 commits into from
Closed

release 4.3 #4449

wants to merge 340 commits into from

Conversation

buger
Copy link
Member

@buger buger commented Nov 29, 2022

furkansenharputlu and others added 30 commits March 8, 2022 12:09
PR for [TT-4655](https://tyktech.atlassian.net/browse/TT-4655)

Basically, Tyk gateway creates a `memconn.Provider` to handle subgraphs for every request. it also creates a new HTTP client with a fresh `http.Transport`. 

It repeats this flow for every request and the dialer implementation in the Go HTTP library allocates new buffers to dial the upstream server. This creates a massive memory leak in the runtime.  I implemented a simple caching approach to overcome that problem. Now it uses a global `http.Client` instance and the dialer function gets a `memconn.Provider` for the subgraph. Before the fix, Tyk gateway had almost 12GB of memory on my local setup. With the fix, it’s stable at around 140 MB.

Users can rename the subgraph or delete it completely. If a subgraph is renamed, a new `memconn.Provider` will be created and cached.

From memory profiler:

![Screen Shot 2022-02-25 at 12 20 51](https://user-images.githubusercontent.com/33702537/155992064-dde90b72-77bf-45f4-9b75-86f40d0a4cd6.png)

(cherry picked from commit b8496b3)
(cherry picked from commit cc952fe)
* internal: unused moved files cleanup

* internal: fix smoke-test readme

* internal: change smoke-tests path
…ion (#3928)

* Iterate auth configs map in alphabetical order in auth source validation

* Preallocate sorting slice

(cherry picked from commit 1bdd59c)
(cherry picked from commit b405a7d)
* Refactor basic auth OAS conversion

* Implement OAS oauth2 scheme conversion

(cherry picked from commit 92655ed)
* Implement base of paths and operations

* Add request changes

* Add requested change

(cherry picked from commit ceccf70)
(cherry picked from commit 29c3f7d)
* internal: relocate and fix legacy scripts

(cherry picked from commit e6dbfa2)
<!-- Provide a general summary of your changes in the Title above -->

## Description
In order to be fully backward compatible, then updated the signature of `ctx.SetSession` function, now it will infer from where to get the configuration if keys should be hashed or not. When a gw starts then it will override the function `Global func() Config` that resides inside the config package, in this way it will take automatically the configurtion of the current gateway. 

## Related Issue
[ticket](https://tyktech.atlassian.net/browse/TT-4934)

## Motivation and Context
Unblock release

## How This Has Been Tested
- Ran GW
- Created a key and consume api

## Screenshots (if appropriate)

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality)

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes that apply -->
<!-- If you're unsure about any of these, don't hesitate to ask; we're here to help! -->
- [x] Make sure you are requesting to **pull a topic/feature/bugfix branch** (right side). If pulling from your own
      fork, don't request your `master`!
- [x] Make sure you are making a pull request against the **`master` branch** (left side). Also, you should start
      *your branch* off *our latest `master`*.
- [ ] My change requires a change to the documentation.
  - [ ] If you've changed APIs, describe what needs to be updated in the documentation.
  - [ ] If new config option added, ensure that it can be set via ENV variable
- [ ] I have updated the documentation accordingly.
- [ ] Modules and vendor dependencies have been updated; run `go mod tidy && go mod vendor`
- [ ] When updating library version must provide reason/explanation for this update.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [x] Check your code additions will not fail linting checks:
  - [x] `go fmt -s`
  - [ ] `go vet`

(cherry picked from commit 61ca289)
* Add ValidateOASObject method

[changelog]
added: Add ValidateOASObject method to validate OAS definition against mulitple OAS versions

(cherry picked from commit 67a3af6)
This reverts commit 67a3af6.

(cherry picked from commit 4637fac)
(cherry picked from commit 2c62163)
* added ValidateOASObject to validate OAS object based on parameter OAS version

[changelog]

added: validate OAS object against different OAS versions
* Add schema endpoint to return quried OAS schema, return the latest patch version if requested version is not found

[changlog]
added: endpoint `/tyk/schema` to return quried OAS schema

(cherry picked from commit 16ad4f6)
furkansenharputlu and others added 29 commits October 17, 2022 15:39
#3751)

* TT-1799 - in case of error in signing method show proper error message

* TT-1799 - signature test

* TT-1799 - moved static text to constants

* TT-1799 - fixed linting issue

* TT-1799 - moved const to be inside test since it's test dependent
[changelog]
fixed: chaining external native API def to internal OAS API def.

(cherry picked from commit 425d9e1)
[changelog]
internal: Updated graphql-go-tools commit hash.

(cherry picked from commit 3b8bc89)
…ronments, rewriting nopCloser (#4299)

* Add flusher from #4021 PR
* Reuse bytes.Buffer for our ReaderWriterSeeker
* Only close/clear the reader when we copy it into the buffer without error
* Remove superflous readBody code from mw_redis_cache

(cherry picked from commit 9202894)
* Implement introspection cache OAS conversion

* Make caching omittable

(cherry picked from commit 2dd015b)
…4367)

* add subscription type cfg for proxy-only and fix federation cfg gen

* remove unused code

(cherry picked from commit 0d4a960)
* setting up the base middleware

* dynamically injecting variables

* added tests for default version and tests for context variables

* added test for version

* added path variable test, fixed bug with variable replace

* modified tests

* moved location of middleware

* handled unhandled errors.

Co-authored-by: asoorm <ahmet@mangomm.co.uk>
(cherry picked from commit eac6e1a)
…te (#4314)

* Add make lint command, update PR template, update ci-tests to use make lint

* Add -count 1 lines to prevent caching

* Fix goimports for analytics_test.go, broken on master

* Move go mod tidy before running linters

* Print full git diff for git-state

* Fix goimports issues on master
* Updated apidef/oas to follow godoc, added docs for OAS doc generator, generator improvements
* Updated generated x-tyk-gateway schema markdown docs to latest
* Updated releated tests to doc generator

(cherry picked from commit c19518b)
* Use goimports with -local to group tyk imports together
* Import changes made by goimports -local
* modify OAS servers methods.

[changelog]
added: OAS ReplaceServers.
changed: OAS AddServers.

* retain user added servers in replace OAS servers

(cherry picked from commit 4f04f5f)
[changelog]
changed: OAS AddServers.

(cherry picked from commit 501e860)
* Check the expiration of cached introspection response

* Added a comment to explain the trick in the test cases

(cherry picked from commit 3914295)
(cherry picked from commit f86b66b)
)

This reverts commit 501e860.
Allow empty servers in OAS AddServers.

(cherry picked from commit 550850b)
[changelog]
internal: Changed swagger version to 4.3.0.
…) (#4427)


* ensure that version used my plugin loader has the correct syntax

* allow goplugin loader to load plugin without the v prefix in version

Co-authored-by: maciej <39672152+maciejwojciechowski@users.noreply.github.com>
Co-authored-by: Furkan Senharputlu <furkan_senharputlu@hotmail.com>
…trol from jsvm (#4397) (#4431)

Co-authored-by: Tit Petric <tit@tyk.io>

Co-authored-by: Tit Petric <tit@tyk.io>
@buger buger closed this Nov 29, 2022
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.

None yet