Add to API to get a strategy during TSRemapNewInstance#12593
Open
traeak wants to merge 4 commits into
Open
Conversation
fd6730e to
7e032e6
Compare
ada93a4 to
00c8021
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the next-hop strategy API to separate transaction-level and remap-level strategy operations, introducing new TSRemap* functions for use during TSRemapNewInstance. The API functions have been renamed for consistency and clarity.
- Renamed
TSHttpNextHopStrategyNameGettoTSNextHopStrategyNameGet - Renamed
TSHttpTxnNextHopNamedStrategyGettoTSHttpTxnNextHopStrategyFind - Added new TSRemap* API functions for strategy operations during remap rule loading
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/proxy/http/remap/RemapConfig.cc | Sets up url_mapping::instance for TSRemap* API access and assigns strategyFactory to new mappings |
| src/api/InkAPI.cc | Implements new TSRemap* functions and renames existing API functions |
| plugins/regex_remap/regex_remap.cc | Updates to use new TSRemapNextHopStrategyFind API during initialization |
| plugins/lua/ts_lua_http.cc | Updates function calls to use renamed API functions |
| plugins/header_rewrite/operators.h | Changes internal storage from Value to explicit strategy pointer |
| plugins/header_rewrite/operators.cc | Refactors to use TSRemapNextHopStrategyFind during initialization and removes runtime hook |
| plugins/header_rewrite/conditions.cc | Updates to use renamed TSNextHopStrategyNameGet function |
| include/ts/ts.h | Updates API documentation and function declarations |
| include/proxy/http/remap/UrlMapping.h | Adds strategyFactory pointer and static instance pointer to url_mapping |
| doc/developer-guide/api/functions/*.en.rst | Adds/updates documentation for new and renamed API functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6663eb1 to
0650be2
Compare
zwoop
requested changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gives the API access to the RemapConfig
url_mappingduring TSRemapNewInstance calls. This contains both the assigned stragies pointer and a pointer to the loaded strategy factory.This modifies the strategies ts API from the previous PR.
API is:
valid during TSRemapNewInstance:
valid during transaction (the Find call is changed):
with utility function to get the null terminated strategy name (returns "null" if nullptr strategy):
The header_rewrite and regex_remap plugins are modified to look up named strategies during TSRemapNewInstance instead of performing strategy factory lookups during each transaction remap hook.