Skip to content

refactor: simplification - #70

Merged
rustatian merged 1 commit into
masterfrom
refactor/simplification
Oct 4, 2026
Merged

rustatian merged 1 commit into
masterfrom
refactor/simplification

Conversation

@rustatian

Copy link
Copy Markdown
Member

Reason for This PR

Reduce the code and dependencies needed to maintain the worker pool.

Description of Changes

  • Remove unused PHP fixtures and duplicate test suites. Reuse the slow payload worker and remove four Composer requirements.
  • Simplify worker cleanup, restart jitter, and library calls. Remove unused fields and the always-nil error result from WorkerWatcher.Watch.
  • Combine the test and coverage commands. Use the built-in Go cache in CI.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

  • All commits in this PR are signed (git commit -s -S).
  • The reason for this PR is clearly provided.
  • The description of changes is clear and encompassing.
  • Any required documentation changes are included in this PR.
  • User-facing API changes are described above; this repository has no CHANGELOG.md.
  • All added or changed functionality is tested.

BREAKING CHANGE: WorkerWatcher.Watch no longer returns an error.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 16:04

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.

Copilot review overview

🟢 Approval recommended

The functional simplifications preserve existing behavior, and removed fixtures and tests have retained equivalents or no remaining references.

Review effort: Balanced
Findings: None

What changed in this PR

Simplifies worker-pool maintenance by removing redundant fixtures/tests, eliminating unused abstractions, and consolidating CI testing and caching.

Changes:

  • Simplifies worker initialization, jitter calculation, watcher cleanup, and IPC factories.
  • Removes obsolete PHP fixtures, dependencies, and duplicate Go test suites.
  • Consolidates Go test coverage and adopts setup-go caching.
File Description
worker/​worker.go Uses io.CopyBuffer directly.
worker/​options.go Simplifies restart jitter generation.
worker_watcher/​worker_watcher.go Simplifies watcher API and cleanup paths.
tests/​worker-slow-dyn.php Removes redundant slow worker.
tests/​stream_worker.php Removes unused stream fixture.
tests/​src/​Workflow/​SagaWorkflow.php Removes unused workflow fixture.
tests/​src/​Client/​StartNewWorkflow.php Removes unused client fixture.
tests/​src/​Activity/​SimpleActivity.php Removes unused activity fixture.
tests/​socket_test_script.sh Removes obsolete socket script.
tests/​slow-pid.php Removes unused PID fixture.
tests/​sample.txt Removes unused sample data.
tests/​raw-error.php Removes unused error fixture.
tests/​psr-worker.php Removes obsolete PSR worker.
tests/​psr-worker-slow.php Removes obsolete slow PSR worker.
tests/​psr-worker-post.php Removes obsolete POST worker.
tests/​psr-worker-bench.php Removes obsolete benchmark worker.
tests/​pipes_test_script.sh Removes obsolete pipe script.
tests/​metrics-issue-571.php Removes unused metrics fixture.
tests/​issue659.php Removes obsolete regression fixture.
tests/​http/​user-agent.php Removes unused HTTP fixture.
tests/​http/​upload.php Removes unused upload fixture.
tests/​http/​stuck.php Removes unused stuck-worker fixture.
tests/​http/​slow-client.php Removes obsolete HTTP client.
tests/​http/​server.php Removes unused server fixture.
tests/​http/​request-uri.php Removes unused URI fixture.
tests/​http/​push.php Removes unused push fixture.
tests/​http/​pid.php Removes unused PID fixture.
tests/​http/​payload.php Removes unused payload fixture.
tests/​http/​memleak.php Removes unused memory fixture.
tests/​http/​ip.php Removes unused address fixture.
tests/​http/​headers.php Removes unused headers fixture.
tests/​http/​header.php Removes unused header fixture.
tests/​http/​error2.php Removes unused exit fixture.
tests/​http/​error.php Removes unused error fixture.
tests/​http/​env.php Removes unused environment fixture.
tests/​http/​echoerr.php Removes unused stderr fixture.
tests/​http/​echoDelay.php Removes unused delayed echo fixture.
tests/​http/​echo.php Removes unused echo fixture.
tests/​http/​data.php Removes unused form-data fixture.
tests/​http/​cookie.php Removes unused cookie fixture.
tests/​http/​client.php Removes obsolete HTTP harness.
tests/​gzip-large-file.txt Removes unused test data.
tests/​composer.json Drops dependencies needed only by removed fixtures.
pool/​static_pool/​supervisor_test.go Removes a redundant supervisor test.
pool/​static_pool/​pool.go Removes unused fields and nil-only errors.
pool/​static_pool/​pool_test.go Reuses the shared slow worker fixture.
pool/​static_pool/​dyn_allocator_test.go Reuses the shared slow worker fixture.
Makefile Consolidates test and coverage commands.
ipc/​socket/​socket.go Stores relays directly.
ipc/​socket/​socket_test.go Defines the shared discard logger.
ipc/​socket/​socket_spawn_test.go Removes duplicate socket tests.
ipc/​pipe/​pipe.go Removes the unused logger field.
ipc/​pipe/​pipe_test.go Consolidates tests and strengthens timeout setup.
ipc/​pipe/​pipe_spawn_test.go Removes duplicate pipe tests.
.github/​workflows/​tests.yml Uses setup-go caching and earlier checkout.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rustatian rustatian self-assigned this Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.13%. Comparing base (23f9030) to head (fef82e8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
- Coverage   77.54%   77.13%   -0.41%     
==========================================
  Files          19       20       +1     
  Lines        1171     1159      -12     
==========================================
- Hits          908      894      -14     
- Misses        263      265       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rustatian
rustatian merged commit 43d99a7 into master Oct 4, 2026
8 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