Skip to content

THRIFT-6003: Add Haxe codegen test script and GitHub Actions CI job#3482

Merged
Jens-G merged 3 commits into
apache:masterfrom
Jens-G:THRIFT-6003
May 14, 2026
Merged

THRIFT-6003: Add Haxe codegen test script and GitHub Actions CI job#3482
Jens-G merged 3 commits into
apache:masterfrom
Jens-G:THRIFT-6003

Conversation

@Jens-G
Copy link
Copy Markdown
Member

@Jens-G Jens-G commented May 14, 2026

Summary

  • Adds lib/haxe/codegen/run-Haxe-Codegen-Tests.ps1: a PowerShell script that tests the Haxe code generator by compiling every .thrift file in the repository against the Thrift library for the html5/JS target
  • Adds companion project files html5.hxml and CodegenTest.hxproj used during test compilation
  • Extends the script with optional parameters -TargetFolder and -ExtraThriftFiles (backward-compatible; default behaviour unchanged when called without arguments)
  • Adds lib-haxe-codegen job to .github/workflows/build.yml using the pre-built thrift-compiler artifact

How the test works

For each .thrift file:

  1. Run thrift --gen haxe to produce Haxe code
  2. Generate a Main.hx that imports all generated namespaces
  3. Compile to JavaScript via haxe html5.hxml (html5 target)
  4. Any Haxe compilation error is a codegen regression

Known-failure lists in the script handle files that are intentionally expected to fail.

Key design detail: local library via haxelib dev

The html5.hxml uses -lib thrift. Without intervention this would resolve from the haxelib.org registry. The CI job runs:

haxelib dev thrift ${{ github.workspace }}/lib/haxe

This registers the local lib/haxe tree as the active version, ensuring the code generator and library under test are always from the same commit. haxelib path thrift is then printed to the log for verification.

Test plan

  • CI job lib-haxe-codegen appears in GitHub Actions and passes
  • haxelib path thrift log line shows local workspace path, not a registry cache path
  • No existing jobs in build.yml are affected

Notes

  • krdlab/setup-haxe pinned to SHA 23a78f711bc4a623db38eac90d351ff0027f0116 (v2.0.2)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@Jens-G Jens-G requested review from fishy and jimexist as code owners May 14, 2026 21:59
@mergeable mergeable Bot added haxe github_actions Pull requests that update GitHub Actions code labels May 14, 2026
@Jens-G Jens-G self-assigned this May 14, 2026
Jens-G and others added 3 commits May 15, 2026 00:50
Client: haxe

Tests the Haxe code generator by compiling every .thrift file in the
repository against the local Thrift library (via haxelib dev) for the
html5/JS target. The PowerShell script supports optional parameters for
output folder and extra IDL search path, keeping local dev behaviour
unchanged when called without arguments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Client: haxe

Fix: install Haxe via apt (krdlab/setup-haxe not on ASF allowlist);
     add compiler/cpp to PATH so FindThriftExe can locate downloaded binary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Client: haxe

Fix: run haxelib setup before haxelib install (apt install does not initialise the repo)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Jens-G Jens-G merged commit 4e6a3b1 into apache:master May 14, 2026
95 of 96 checks passed
@Jens-G Jens-G deleted the THRIFT-6003 branch May 14, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code haxe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant