Skip to content

fix(generation): let httpx choose the multipart boundary (backport #542 to stable/9) - #544

Merged
jwulf merged 2 commits into
stable/9from
backport-542-to-stable/9
Dec 1, 2026
Merged

jwulf merged 2 commits into
stable/9from
backport-542-to-stable/9

Conversation

@camunda-sdk-automation

Copy link
Copy Markdown
Contributor

Backport of #542 to stable/9.

Generated code is restored from stable/9 and regenerated by the Backport workflow in a separate chore(gen) commit.

relates to #541 openapi-generators/openapi-python-client#1511 #390

* test(generation): reproduce truncated multipart uploads from the fixed boundary

Refs #541

* fix(generation): let httpx choose the multipart boundary

openapi-python-client 0.29 makes every multipart endpoint send
Content-Type: multipart/form-data; boundary=+++. httpx encodes the body
with that boundary, so an uploaded file containing "\r\n--+++" ended its
part early and the rest was parsed as a malformed extra part. This hit
create_deployment (and deploy_resources_from_files), create_document and
create_documents.

Post-gen hook 0420 removes that header line, so httpx sets Content-Type
with a random boundary for each request. Upstream made the same change
in 0.30 (openapi-generators/openapi-python-client#1511). We can't take
0.30 yet because it moves generated clients to httpx2.

Closes #541

* chore(generation): regenerate SDK for the multipart boundary fix

(cherry picked from commit 0bea8e3)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The acceptance tests hard-code generated/ instead of locating the imported SDK, so runs using --out-dir can scan stale code or fail despite correct alternate output.

1 open issue
What changed in this PR

Backports #542 to stable/9, fixing multipart upload truncation when file contents contain the generator’s fixed boundary.

Changes:

  • Adds a post-generation hook that removes fixed multipart boundary headers, allowing httpx to choose the boundary.
  • Adds endpoint-wide boundary checks, payload round-trip tests, and hook transformation tests.
  • Regenerates the three affected upload endpoints.
File Description
tests/​acceptance/​test_multipart_boundary.py Adds multipart boundary regression coverage and hook tests.
hooks/​post_gen/​0420_drop_fixed_multipart_boundary.py Removes fixed multipart boundary headers during generation.
generated/​camunda_orchestration_sdk/​api/​resource/​create_deployment.py Delegates deployment upload boundary selection to httpx.
generated/​camunda_orchestration_sdk/​api/​document/​create_documents.py Delegates batch document upload boundary selection to httpx.
generated/​camunda_orchestration_sdk/​api/​document/​create_document.py Delegates single document upload boundary selection to httpx.

Review effort: Balanced

Signed-off-by: Josh Wulf <josh.wulf@camunda.com>
@jwulf

jwulf commented Dec 1, 2026

Copy link
Copy Markdown
Member

🤖 The changes in this PR were produced by nano-agent, an autonomous agent. Commits are authored under the operator's own git identity when one is resolvable (the human running the fleet), so they can satisfy CLA/DCO requirements; this note records that the work was generated by the agent.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the multipart-boundary backport.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@jwulf

jwulf commented Dec 1, 2026

Copy link
Copy Markdown
Member

nano-ack: issuecomment-7317021059 Noted. This is the attribution notice for the agent's work, so no code change is needed. Commits stay signed off under the operator's identity.

@jwulf
jwulf merged commit bdb8be8 into stable/9 Dec 1, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants