Skip to content

Add CI and npm packaging for the request converter#8931

Merged
flobernd merged 6 commits into
mainfrom
request-converter-npm-ci
Jul 24, 2026
Merged

Add CI and npm packaging for the request converter#8931
flobernd merged 6 commits into
mainfrom
request-converter-npm-ci

Conversation

@flobernd

@flobernd flobernd commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Makes the RequestConverter solution CI-gated and publishable: a path-filtered workflow builds and tests RequestConverter.sln on converter-relevant changes, new packaging scripts assemble the WASM AppBundle into the @elastic/request-converter-dotnet npm package, and a publish workflow ships that package with npm trusted publishing.

Intention

The .NET request converter is being integrated into @elastic/request-converter as a first-class C# exporter (elastic/request-converter#107), which generates the C# language examples in elasticsearch-specification (elastic/elasticsearch-specification#6509). Both consume the WASM bundle as an npm package. Because the bundle compiles the entire client in, each minor branch needs its own package version to produce valid examples for that stack version: the package version tracks the branch major.minor with a freely incrementing patch, and the exact embedded client version and commit are recorded in package.json metadata.

Changes

  • Allow missing prune package data in the test project so dotnet test RequestConverter.sln works without extra properties.
  • Add a conversion-only corpus gate for the descriptor + strongly-typed-document flavor used for published examples (all 3640 convertible corpus examples pass).
  • Add npm packaging under src/RequestConverter.Wasm/npm/: package template, assembly script, Node smoke test, package README.
  • Add .github/workflows/request-converter.yml: build and test on pull requests and pushes, path-filtered to converter-relevant inputs (including the client sources the converter compiles in).
  • Add .github/workflows/request-converter-npm-publish.yml: publishes the npm package on client releases and via manual dispatch, with provenance.

Notes

  • Before the publish workflow can succeed, the @elastic npm org must configure trusted publishing for @elastic/request-converter-dotnet targeting request-converter-npm-publish.yml in this repo. The workflow upgrades npm at runtime because OIDC publishing requires npm 11.5.1 or newer.
  • On release events the workflow builds the release branch HEAD; package.json records the exact built commit, so any drift from the tag is discoverable.
  • Releases from branches that are not major.minor (for example serverless-*) fail the publish workflow's branch guard by design.

flobernd added 6 commits July 22, 2026 14:24
…est-converter workflows

The npm publish workflow's Assemble package step recorded $GITHUB_SHA
instead of the commit actually checked out from the operator-chosen
branch, and its git describe fallback for CLIENT_VERSION always
failed because actions/checkout@v4 doesn't fetch tags by default. Add
a Resolve commit step reading git rev-parse HEAD after checkout, and
fetch-depth: 0 / fetch-tags: true so the fallback works for dispatch
runs.

Also add global-json-file to every setup-dotnet step in both
workflows to match the SDK pin used elsewhere in the repo, and route
the untrusted branch/tag event values through step env vars instead
of interpolating them directly into run: script bodies.
@github-actions

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.4
9.5

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

flobernd added a commit that referenced this pull request Jul 24, 2026
flobernd added a commit that referenced this pull request Jul 24, 2026
flobernd added a commit that referenced this pull request Jul 24, 2026
)

Co-authored-by: Florian Bernd <git@flobernd.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant