Skip to content

Extract utility functions and GitHub helpers from release-runtime.ts#732

Merged
selfcontained merged 2 commits into
mainfrom
agt_03ad4bd23c61/job-debt-collector-860bf7d4
Jul 8, 2026
Merged

Extract utility functions and GitHub helpers from release-runtime.ts#732
selfcontained merged 2 commits into
mainfrom
agt_03ad4bd23c61/job-debt-collector-860bf7d4

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Extracted 9 pure utility and GitHub helper functions (~140 lines) from the createReleaseRuntime() closure in release-runtime.ts into a new release-helpers.ts module.
  • Functions extracted: parseGhJson, compareSemver, currentReleaseBinaryGlob, defaultServiceRestartCommand, getGitHubRepo, checkIsAdmin, fetchReleaseMetadata, plus the RunCommand and GitHubReleaseMetadata types.
  • release-runtime.ts drops from 886 to 746 lines. The public API surface is unchanged — callers are unaffected.

Why this qualifies as tech debt

The createReleaseRuntime() function was a single 737-line closure containing everything from pure string utilities to GitHub CLI wrappers to deploy orchestration. The pure/GitHub-only functions had no dependency on the closure state and were unnecessarily entangled with deploy/streaming logic. Extracting them improves readability and makes them independently testable.

What's next

The backlog top item is extracting createAgent() in apps/server/src/agents/manager.ts.

🤖 Generated with Claude Code

@selfcontained
selfcontained merged commit 1f51a9b into main Jul 8, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_03ad4bd23c61/job-debt-collector-860bf7d4 branch July 8, 2026 09: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.

1 participant