Skip to content

Conversation

@zwoop
Copy link
Contributor

@zwoop zwoop commented Jan 23, 2026

This essentially converted the existing Python parser / visitor / emitters to C++ and natively calling the various factory functions to create the object structure. In addition, it adds a new testing tool, hrw_confcmp, which compares an old vs a hrw4u configuration, and make sure they both create the same set of objects. As such, the header_rewrite core also added some support to identify the various Operators and Conditions. Usage:

leif@hel ~/BUILDS/ats-dbg » ./tools/hrw_confcmp/run_tests.sh  ~/apache/trafficserver/tools/hrw4u/tests/data/{hooks,conds,ops,vars,examples}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Testing directory: hooks
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✓ hooks/read_response:             44 ms
  ✓ hooks/remap:                     39 ms
.
.
.
  ✓ examples/uuid:                   41 ms
  ✓ examples/x-debug:                41 ms

  Directory Summary: 18 passed, 0 failed (total: 18)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Overall Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Total tests:  66
  Passed:       66
  Failed:       0

  Total time:   2721 ms
  Avg per test: 41 ms

✓ All tests passed!

@zwoop zwoop added this to the 11.0.0 milestone Jan 23, 2026
@zwoop zwoop self-assigned this Jan 23, 2026
@zwoop zwoop added header_rewrite header_rewrite plugin hrw4u labels Jan 23, 2026
@zwoop zwoop marked this pull request as draft January 23, 2026 17:02
@zwoop
Copy link
Contributor Author

zwoop commented Jan 23, 2026

I'm making this a draft for now, I think it needs to go into ATS v11, since we're getting close to 10.2 branching and release.

zwoop added 3 commits January 23, 2026 10:25
This also adds a new tool, and infrastructure, to allow us to compare
and verify that an old and new (hrw4u) configuration generates the same
structure of Statements and Operators (functional equivalence).

That tool could also be used in an automation process migrating
existing configurations to hrw4u.

u4wrh: adds an option to disable optimizations
Fixes parser problems in u4wrh with implicit hooks.
This also fixes a few issues in the tool chains
@zwoop zwoop changed the title Hrw4u cpp hrw4u: native C++ parser and visitor for header_rewrite Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

header_rewrite header_rewrite plugin hrw4u

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant