Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: RocketPy-Team/RocketSerializer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: RocketPy-Team/RocketSerializer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev/ork-convert-service
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 7 files changed
  • 1 contributor

Commits on Aug 6, 2026

  1. feat(service): add HTTP wrapper around ork2json

    Packages the existing CLI behind a single POST /convert endpoint so callers
    can import .ork files without carrying a JDK, a JVM or a 70 MB OpenRocket jar
    in their own image.
    
    Additive only: nothing under rocketserializer/ changes.
    
    - One subprocess per request. OpenRocketSession.__exit__ never calls
      shutdownJVM() (jpype1<1.5 cannot restart one), and __enter__ silently reuses
      an existing classpath when a JVM is already live, so a warm worker would
      eventually parse against the wrong OpenRocket version. A fresh process also
      contains JVM segfaults and isolates cli.py's import-time serializer.log
      write.
    - Inlines thrust_source.csv and drag_curve.csv into the response. Raw
      parameters.json references them by host-relative path (backslash-separated
      on Windows), so it is not self-contained; callers get one object instead of
      a file lifecycle.
    - Reports serializer_version (package version + pinned jar) so a bad parse can
      be traced to the parser that produced it.
    - Maps the known user-fixable failures (no simulation data, non-English file)
      to 422 with stable codes rather than leaking tracebacks.
    - Concurrency capped: every job boots a JVM and loads OpenRocket's full preset
      database.
    
    Dockerfile pins OpenRocket-23.09 on Temurin 17 and forces java.awt.headless,
    since OpenRocket's startup path constructs a Swing GuiModule.
    aasitvora99 committed Aug 6, 2026
    Configuration menu
    Copy the full SHA
    63f921d View commit details
    Browse the repository at this point in the history
  2. test(service): cover the wrapper, fix four defects it exposed

    Expands service/test_app.py from 12 to 64 unit tests across _read_pairs,
    _classify, _inline_csv, _safe_name, the subprocess contract, the envelope,
    the error map, the HTTP layer and the concurrency cap. Subprocess is stubbed
    throughout, so the suite needs no JVM and no jar and runs in ~0.7s.
    
    Writing them surfaced four real defects, each fixed and each verified by
    reverting the fix and confirming the suite goes red:
    
    - A filename of ".." escaped the job directory. Path("..").name returns ".."
      unchanged, so job_dir / ".." resolved to the temp root and write_bytes
      raised an unhandled IsADirectoryError. Path().name also does not split on
      backslashes under POSIX, so a Windows client's "C:\a\b.ork" arrived whole.
      Extracted _safe_name() to normalise separators and reject dot-only names.
    
    - _inline_csv crashed on a null section. ork_extractor wraps lookups in
      _safe_search and can emit null rather than a dict, which made
      parameters.get(section, {}).get(key) raise AttributeError. Same fix applied
      to the id.filepath strip.
    
    - Malformed ork2json output escaped as a traceback. A non-numeric CSV cell or
      truncated parameters.json now returns 500 parse_failed.
    
    - The upload size limit was enforced only after the body was read, so an
      oversized request was pulled into memory just to be discarded. Now checked
      against the declared size first, with the post-read check kept as a fallback
      for clients that send none.
    aasitvora99 committed Aug 6, 2026
    Configuration menu
    Copy the full SHA
    a8d9373 View commit details
    Browse the repository at this point in the history
  3. fix(service): make the image build and classify corrupt uploads

    Verified end to end for the first time: image builds, container serves, and
    examples/Anonymous--Mu/rocket.ork converts in 11s (EPFL--BellaLui in 6.5s)
    with both CSVs inlined and no temp directories left behind.
    
    Three problems only a real build could surface:
    
    - jpype1 is pinned <1.5, which predates aarch64 wheels, so pip compiles it
      from source on arm64 and the image had no C++ toolchain. build-essential
      and python3-dev are now installed and purged inside a single layer.
    
    - jammy ships pip 22.0.2, whose setuptools predates the PEP 660
      build_editable hook, so `pip install -e .` failed outright. pip/setuptools
      are upgraded first, and the package is installed non-editable — an image has
      no reason to hot-reload it.
    
    - A corrupt or non-OpenRocket upload returned 500 with a raw Python traceback.
      parse_ork_file raises "The .ork file is not in UTF-8" for both a genuine
      encoding problem and any file that is not an .ork archive, so it now maps to
      422 invalid_encoding with copy covering both readings.
    
    README documents the arm64/amd64 split: a build on Apple Silicon produces an
    image that will not run on an amd64 host.
    aasitvora99 committed Aug 6, 2026
    Configuration menu
    Copy the full SHA
    fec9cbf View commit details
    Browse the repository at this point in the history
Loading