allthingssecurity commented on PR #26910:
URL: https://github.com/apache/camel/pull/26910#issuecomment-5855287066

   Thanks. Pushed 6f044bd03 on top of the branch (no rebase):
   
   - `RouteVariableRepository` and `GroupVariableRepository` have a new 
`removeVariablesWithPrefix(String prefix)` (`id:prefix` syntax, `@since 4.23`). 
It does `removeIf` on the key set of that one route or group map, without 
building the combined map. `ExchangeHelper` calls it for these two 
repositories. Global, custom browsable repositories and the exchange keep the 
previous code. No change to camel-api.
   - One detail, which comes from the naming issue: the header variables of a 
route variable are stored under the route id `header` (`header:rs:resp.x`), so 
the map that is scanned is the one that holds the header variables of all route 
variables, not the map of route `rs`. Once the naming is fixed, the same call 
scans only the variable's own route.
   - The variables that are removed are the same as before. Tests: 
`RouteVariableRepositoryTest` (new) and `GroupVariableRepositoryTest` cover the 
prefix removal (`id:foo.a` and `id:foo.b` are removed; `id:foo`, `id:foobar` 
and `other:foo.a` are kept). In `ToVariableReceiveHeadersTest` the route and 
group cases now also check that the header variables of another variable in the 
same route or group, and of the same variable in another route or group, are 
kept.
   - Negative controls: with the two new calls in `ExchangeHelper` removed (no 
removal for route/group), `testReceiveTwiceRoute` and `testReceiveTwiceGroup` 
fail (`but was: <Bye second|200|E42>`). With the prefix ignored in the 
repositories (removes the whole map), the two repository tests and the 
route/group tests fail (`expected: <E42> but was: <null>`). Both pass with the 
commit.
   - `*Variable*,*ToV*,*ExchangeHelper*` in camel-core: 166 tests, 0 failures. 
The formatter and import-sort plugins made no changes. `git merge-tree` against 
current main: no conflicts.
   
   JIRA for the `header` route-id naming: the draft is written and the issue 
will follow, I'll link it here. While checking it I also found that removing a 
route leaves the header variables of its route variables in the repository, 
because they are not stored under the route's id. That goes into the same JIRA.
   
   _Claude Code on behalf of allthingssecurity_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to