Skip to content

Refactor: strict singleton architecture for TypeScript actions (gforce-gha-src) - #9

Open
gambe94 wants to merge 16 commits into
mainfrom
refactor/actions-package-consolidation
Open

Refactor: strict singleton architecture for TypeScript actions (gforce-gha-src)#9
gambe94 wants to merge 16 commits into
mainfrom
refactor/actions-package-consolidation

Conversation

@gambe94

@gambe94 gambe94 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrates all three TypeScript actions (sync-branches, create-release-pr, sf-find-tests) to a strict, class-based, singleton, MVC-style architecture. Design record: docs/superpowers/specs/2026-07-14-strict-singleton-actions-architecture-design.md.

  • gforce-gha-src/ is the single source of truth: per-action Orchestrator + Validator singletons, clients/github/ (branches + pull-requests sub-clients behind a GitHubClient facade over one shared Octokit), shared services (BranchSyncService, ReleasePrService, LoggerService, FileSystemService, GithubContextService), and libraries/salesforce/ (Apex test selection over pure selectors).
  • .github/actions/<name>/ now holds a zero-logic index.ts entry, a per-action package (esbuild replaces ncc), and the committed dist/index.js.
  • packages/* (core, runtime, adapters) are deleted — logic, tests, and fixtures all moved.
  • Tests rewritten to method_scenario_expectedResult + Given/When/Then with singleton-boundary mocking: 164 unit + 8 integration tests, 100% coverage on every metric (95% gate).
  • CI, pre-commit bundle rebuild, dist:verify, and all docs updated for the new layout.

Behavior

Every action.yml interface (inputs, outputs, dry-run: true defaults) is unchanged — consumers never notice. The CI smoke job executes each action from its committed bundle to prove it.

Validation

  • npm run all (format + lint + typecheck + bundle + test + dist:verify) green after every phase commit
  • Integration suites drive each Orchestrator end-to-end; bundle existence asserted

🤖 Generated with Claude Code

gambe94 and others added 16 commits July 13, 2026 19:52
…github-actions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…arget validation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…before dry-run exit)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…utils (Phase 0)

Scaffold the strict singleton architecture tree per the 2026-07-14 design spec:
clients/github (branches + pull-requests sub-clients, GitHubClient facade,
non-singleton core helpers with one shared Octokit), LoggerService,
GithubContextService, utils, and the mirrored __tests__ suite (82 tests, 100%
coverage, 95% gate). Old packages/* untouched; full repo gate green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(Phase 1)

Validator + Orchestrator under gforce-gha-src/actions/sync-branches,
BranchSyncService holding the sync ladder (throw-based errors, discriminated
outcomes), spec-shaped entry at .github/actions/sync-branches/index.ts with a
per-action package (esbuild bundle replaces ncc for this action). Tests moved
to the new conventions incl. an end-to-end integration suite. Old packages/*
sync-branches code removed; action.yml interface unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ure (Phase 2)

Validator + Orchestrator under gforce-gha-src/actions/create-release-pr,
ReleasePrService owning body templating and the create/update/labels/reviewers
workflow, spec-shaped entry + esbuild bundle. Tests rewritten to the new
conventions incl. end-to-end integration. Old packages/* create-release-pr code
removed; core's transitional coverage gate relaxed pending Phase 4 teardown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(Phase 3)

Validator + Orchestrator under gforce-gha-src/actions/sf-find-tests; the
Salesforce logic moves to libraries/salesforce (ApexTestSelectionService,
pure selectors, package.xml member parsing) over a new generic
FileSystemService. Spec-shaped entry + esbuild bundle; fixtures moved into
gforce-gha-src integration tests. The emptied packages/github-actions adapter
workspace is removed; gforce-gha-src sits at 100% coverage on every metric.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…se 4)

Delete the dismantled packages/core and packages/github-actions-runtime
workspaces (all logic now lives in gforce-gha-src), drop ncc, retarget the
pre-commit bundle rebuild + root tsconfig + .gitignore, point CI coverage
upload and the sf-find-tests smoke fixtures at the new tree, and rewrite
docs/architecture.md, docs/typescript-action-authoring.md, README, and
CLAUDE.md for the strict singleton architecture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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