Skip to content

refactor(worker): restructure src into infrastructure/ + strategies/ - #37

Merged
Alimedhat000 merged 2 commits into
mainfrom
30-refactor-worker
May 17, 2026
Merged

refactor(worker): restructure src into infrastructure/ + strategies/#37
Alimedhat000 merged 2 commits into
mainfrom
30-refactor-worker

Conversation

@Alimedhat000

Copy link
Copy Markdown
Owner

closes #30

- db: unknown/any → PostgresJsDatabase<Record<string, unknown>>
- app: Record<string, any> → App from @shipyard/shared/schema
- env: any → Env from config/env
- Remove all (db as any) casts and biome-ignore noExplicitAny
- Suppress noExplicitAny in test files via biome overrides
Closes #30

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

Pure refactor of packages/worker/src/ that restructures files into infrastructure/ (cross-cutting infra) and deployments/strategies/ (build packs), splits shared.ts into env-vars.ts and events.ts, renames orchestrator.ts/process-deployment.ts to pipeline.ts/processor.ts, removes the trivial jobs/deploy.ts re-export, and tightens types by replacing many any casts with App, Env, and a DB alias for PostgresJsDatabase. Test files are moved to mirror the new source layout, and a Biome override disables noExplicitAny under packages/worker/test/**.

Changes:

  • Moved caddy/, docker/, log-buffer, retry into infrastructure/; static & dockerfile deploys into deployments/strategies/; split shared.ts.
  • Replaced any casts in pipeline/strategies/events with proper App/Env/DB types.
  • Mirrored tests under test/unit/infrastructure/ and test/unit/deployments/, consolidating the dockerfile test into pipeline.test.ts.

Reviewed changes

Copilot reviewed 25 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
biome.json Adds override disabling noExplicitAny for worker tests
packages/worker/src/index.ts Updates imports to new infrastructure/processor paths
packages/worker/src/jobs/deploy.ts Removed re-export module
packages/worker/src/infrastructure/caddy/{client,config-builder}.ts Moved from deployments/caddy
packages/worker/src/infrastructure/docker/docker-runner.ts Moved from deployments/docker
packages/worker/src/infrastructure/{log-buffer,retry}.ts Moved from deployments/logs and deployments/utils
packages/worker/src/deployments/pipeline.ts Renamed from orchestrator.ts; typed db and app
packages/worker/src/deployments/processor.ts Renamed from process-deployment.ts; new import paths
packages/worker/src/deployments/{env-vars,events}.ts Split out from shared.ts with proper DB types
packages/worker/src/deployments/shared.ts Deleted (split into env-vars/events)
packages/worker/src/deployments/strategies/{static,dockerfile}.ts Moved from deploy-static/deploy-dockerfile; typed params
packages/worker/src/deployments/steps/{build,clone,install,verify}-step.ts Updated import paths to infrastructure/
packages/worker/test/unit/infrastructure/{caddy-config,log-buffer,retry}.test.ts Test files mirroring new layout
packages/worker/test/unit/deployments/{pipeline,classify-error,steps/verify-step}.test.ts Test files mirroring new layout
packages/worker/test/unit/{orchestrator,deploy-dockerfile,verify-step,caddy-config}.test.ts Old test files removed

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

@Alimedhat000
Alimedhat000 merged commit 35ad3e0 into main May 17, 2026
8 checks passed
@Alimedhat000
Alimedhat000 deleted the 30-refactor-worker branch May 17, 2026 04:20
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.

refactor(worker): restructure into infrastructure/ + deployments/strategies/ pattern

2 participants