Repository navigation
fix(java): isolate special-header exclusions per code-model build - #12515
Open
Weidong Xu (weidongxu-microsoft) wants to merge 2 commits into
Open
Weidong Xu (weidongxu-microsoft) wants to merge 2 commits into
Weidong Xu (weidongxu-microsoft) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 526da12f-9fd4-4446-ab7f-46e72cc328cf
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change isolating special-header exclusions per builder.
No open issues 🎉
What changed in this PR
Fixes state leakage in the Java emitter by keeping configured special-header exclusions local to each code-model builder. Subsequent compilations restore header parameters when the option is removed, while built-in exclusions remain intact.
Changes:
- Copies built-in special headers into a per-builder set.
- Adds regression coverage for consecutive builds with configured, omitted, and empty exclusions.
- Adds a fix changelog entry.
| File | Description |
|---|---|
packages/http-client-java/emitter/test/fixtures/special-headers.tsp |
Defines custom and built-in special headers for regression testing. |
packages/http-client-java/emitter/test/code-model.test.ts |
Verifies exclusions remain isolated across consecutive builds. |
packages/http-client-java/emitter/src/code-model-builder.ts |
Replaces shared-set mutation with per-builder header exclusions. |
.chronus/changes/http-client-java-special-header-isolation.md |
Documents the header-exclusion isolation fix. |
Review effort: Balanced
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 526da12f-9fd4-4446-ab7f-46e72cc328cf
Weidong Xu (weidongxu-microsoft)
marked this pull request as ready for review
November 7, 2026 08:00
Weidong Xu (weidongxu-microsoft)
enabled auto-merge
November 7, 2026 08:00
This branch has not been deployed
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.

Keep
skip-special-headersexclusions local to each code-model builder. Removing the option now restores header parameters on subsequent compilations in the same process, while built-in special headers remain excluded.Addresses the builder-state leak reported in Azure/typespec-azure#5988.