Skip to content

Harden runtime and add portable releases - #5

Merged
slepp merged 8 commits into
masterfrom
copilot/runtime-build-release
Aug 3, 2026
Merged

Harden runtime and add portable releases#5
slepp merged 8 commits into
masterfrom
copilot/runtime-build-release

Conversation

@slepp

@slepp slepp commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • harden upstream connection lifecycle, client protocol framing, logging, cleanup, signals, and port validation
  • add regression coverage for delayed handshakes, fragmented commands, reconnect shutdown, port validation, and standby restarts
  • modernize the Makefile and Docker build for static amd64, arm64, and ARMv7 binaries
  • add GitHub Actions CI, tagged GitHub releases, and multi-architecture Docker Hub publishing
  • replace obsolete GitLab references and refresh quick-start, LAN safety, build, Docker, and release documentation

Validation

  • make test
  • static Alpine/musl amd64 artifact build
  • static scratch Docker image execution
  • Valgrind shutdown and stats endpoint leak checks

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens rtlmux’s runtime behavior (upstream connection lifecycle, protocol framing, logging safety, cleanup, signal handling, and port validation) and adds portable release artifacts (multi-arch static binaries, Docker images, and GitHub Actions CI/release automation), with new integration/regression tests to lock in the expected behavior.

Changes:

  • Added Python integration tests covering delayed handshakes, fragmented commands, clean reconnect shutdown, port validation, and delayed restarts.
  • Hardened core runtime: safer logging formatting, more robust upstream/client lifecycle handling, improved cleanup paths, and stricter config validation.
  • Modernized build and release pipeline: refreshed Makefile, multi-stage Docker builds (static + scratch), removed GitLab CI config, and added GitHub Actions workflows for CI/releases/Docker publishing.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/integration.py New integration regression suite for handshake framing, command fragmentation, port validation, reconnect shutdown, and restart behavior.
slog.c Replaces unsafe sprintf/vsprintf with bounded snprintf/vsnprintf.
rtlmux.h Uses sig_atomic_t for exit flag and fixed-width types for protocol command framing.
rtlmux.c Refactors upstream connect/reconnect, client readiness handling, safer logging callback formatting, improved allocation/error checks, and cleanup flow.
main.c Improves signal handler setup and thread lifecycle error handling; switches exit flag type.
config.c Adds validation for port ranges and non-empty host; converts validated values to uint16_t.
Makefile Modernizes flags, dependency tracking (.d), adds static, test, install, and generate targets.
Dockerfile Multi-stage build for static multi-arch artifacts and scratch runtime image.
README.md Updates quick-start, LAN safety note, build, Docker, and release documentation; replaces obsolete CI references.
.github/workflows/ci.yml Adds GitHub Actions CI to build, run tests, and verify static artifact build.
.github/workflows/release.yml Adds tag-driven multi-arch binary builds, GitHub releases, and conditional Docker Hub publishing.
.gitlab-ci.yml Removes obsolete GitLab CI configuration.
.gitignore Adds *.d dependency file ignores.
.dockerignore Excludes git metadata and build outputs from Docker build context.
Suppressed comments (3)

tests/integration.py:195

  • This helper thread is non-daemon, and addCleanup(thread.join, 2) only waits briefly. If upstream.accept() blocks due to a test failure, the thread can keep the Python process alive and hang CI.
        thread = threading.Thread(target=serve)
        thread.start()
        self.addCleanup(thread.join, 2)

tests/integration.py:139

  • This helper thread is non-daemon, and addCleanup(thread.join, 2) only waits briefly. If upstream.accept() blocks due to a test failure, the thread can keep the Python process alive and hang CI.
        thread = threading.Thread(target=serve)
        thread.start()
        self.addCleanup(thread.join, 2)

tests/integration.py:227

  • This helper thread is non-daemon, and addCleanup(thread.join, 4) only waits briefly. If upstream.accept() blocks due to a test failure, the thread can keep the Python process alive and hang CI.
        thread = threading.Thread(target=serve)
        thread.start()
        self.addCleanup(thread.join, 4)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rtlmux.c
Comment thread tests/integration.py Outdated
Comment thread main.c Outdated
@slepp
slepp merged commit 345840a into master Aug 3, 2026
1 check passed
@slepp
slepp deleted the copilot/runtime-build-release branch August 3, 2026 00:13
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