tyk icon indicating copy to clipboard operation
tyk copied to clipboard

[TT-10446]: added a custom multiplexer to be used for internal requests

Open kofoworola opened this issue 1 year ago • 14 comments

Description

This fix adds a custom multiplexer in the reverse proxy to be used to handle internal routing. Why? Because currently, the request context propagation uses the first parent request's context, instead of subsequent requests. TT-10446

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • [ ] 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

  • [ ] I ensured that the documentation is up to date
  • [ ] I explained why this PR updates go.mod in detail with reasoning why it's required
  • [ ] I would like a code coverage CI quality gate exception and have explained why

kofoworola avatar Nov 23 '23 08:11 kofoworola

API Changes

--- prev.txt	2023-11-28 08:34:50.114478235 +0000
+++ current.txt	2023-11-28 08:34:46.722497298 +0000
@@ -6064,6 +6064,7 @@
 	// CacheOptions holds cache options required for cache writer middleware.
 	CacheOptions
 	OASDefinition
+	APIID
 )
 # Package: ./dlpython
 

github-actions[bot] avatar Nov 23 '23 08:11 github-actions[bot]

Apply Sweep Rules to your PR?

  • [ ] Apply: All new business logic should have corresponding unit tests.
  • [ ] Apply: Refactor large functions to be more modular.
  • [ ] Apply: Add docstrings to all functions and file headers.

sweep-ai[bot] avatar Nov 23 '23 08:11 sweep-ai[bot]

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.4% 82.4% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

sonarqubecloud[bot] avatar Nov 23 '23 09:11 sonarqubecloud[bot]

:boom: CI tests failed :see_no_evil:

git-state

all ok

Please look at the run or in the Checks tab.

github-actions[bot] avatar Nov 23 '23 13:11 github-actions[bot]

API tests result: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: d3791a0b6427b2e933cf5a353e25d8e43f3e8dc9 Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 23 '23 14:11 buger

:boom: CI tests failed :see_no_evil:

git-state

diff --git a/internal/graphql/otel_graphql_engine_detailed.go b/internal/graphql/otel_graphql_engine_detailed.go
index f2793d6..7460350 100644
--- a/internal/graphql/otel_graphql_engine_detailed.go
+++ b/internal/graphql/otel_graphql_engine_detailed.go
@@ -2,9 +2,10 @@ package graphql
 
 import (
 	"context"
-	tykctx "github.com/TykTechnologies/tyk/ctx"
 	"sync"
 
+	tykctx "github.com/TykTechnologies/tyk/ctx"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/ast"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"

Please look at the run or in the Checks tab.

github-actions[bot] avatar Nov 27 '23 18:11 github-actions[bot]

API tests result: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: da8c7dddd1785cf14fdbeff5f0d4f67e35529977 Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 27 '23 18:11 buger

API tests result - postgres15-murmur64 env: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: a0f309d876188fedbd55efb1b940edcaa5bb181b Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 27 '23 18:11 buger

API tests result - postgres15-sha256 env: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: a0f309d876188fedbd55efb1b940edcaa5bb181b Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 27 '23 18:11 buger

API tests result - mongo44-sha256 env: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: a0f309d876188fedbd55efb1b940edcaa5bb181b Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 27 '23 18:11 buger

API tests result - mongo44-murmur64 env: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: a0f309d876188fedbd55efb1b940edcaa5bb181b Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 27 '23 18:11 buger

:boom: CI tests failed :see_no_evil:

git-state

diff --git a/internal/graphql/otel_graphql_engine_detailed.go b/internal/graphql/otel_graphql_engine_detailed.go
index f2793d6..7460350 100644
--- a/internal/graphql/otel_graphql_engine_detailed.go
+++ b/internal/graphql/otel_graphql_engine_detailed.go
@@ -2,9 +2,10 @@ package graphql
 
 import (
 	"context"
-	tykctx "github.com/TykTechnologies/tyk/ctx"
 	"sync"
 
+	tykctx "github.com/TykTechnologies/tyk/ctx"
+
 	"github.com/TykTechnologies/graphql-go-tools/pkg/ast"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/plan"
 	"github.com/TykTechnologies/graphql-go-tools/pkg/engine/resolve"

Please look at the run or in the Checks tab.

github-actions[bot] avatar Nov 28 '23 08:11 github-actions[bot]

API tests result: success :white_check_mark: Branch used: refs/pull/5799/merge Commit: a0f309d876188fedbd55efb1b940edcaa5bb181b Triggered by: pull_request (@kofoworola) Execution page

buger avatar Nov 28 '23 08:11 buger

Removed us as we have no input.

alephnull avatar Dec 08 '23 05:12 alephnull