Repository navigation
refactor(arch): move the run flows to src/flows and add the public entry src/index.ts - #138
Merged
Merged
Conversation
Contributor
File size check0 over a hard cap (fails), 91 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 6 managed file(s) skipped; repo-platform owns them. |
There was a problem hiding this comment.
🟢 Approval recommended
The refactor preserves behavior with broad test coverage; only a non-blocking stale inline path remains.
Pull request overview
Refactors execution into reusable flow and library layers while keeping the GitHub Action as a consumer of the public entry point.
Changes:
- Moves orchestration, redaction, delivery, and secret-reference logic into dedicated layers.
- Adds public library helpers, reusable IO implementations, and an artifact uploader port.
- Updates architecture enforcement, documentation, and tests.
File summaries
| File | Description |
|---|---|
test/report/delivery.test.ts |
Updates moved delivery imports. |
test/report/artifact-report.test.ts |
Tests uploader-first API. |
test/private.test.ts |
Updates private-data boundary checks. |
test/library/public-surface.test.ts |
Pins exports and architecture boundary. |
test/io/collecting.test.ts |
Tests reusable IO sinks. |
test/io-fake.ts |
Re-exports production silent IO. |
test/flows/single.test.ts |
Tests extracted single flow. |
test/flows/settings-read.test.ts |
Updates settings-reader import. |
test/flows/redact.test.ts |
Updates redaction import. |
test/flows/multi.test.ts |
Updates multi-flow imports. |
test/flows/library.test.ts |
Tests new library helpers. |
test/flows/deliver.test.ts |
Updates delivery tests and uploader injection. |
test/engine/secrets.test.ts |
Updates secret source import. |
test/engine/secret-refs.test.ts |
Updates moved secret-reference tests. |
test/e2e/schema.ts |
Updates secret-reference import. |
test/e2e/mock/core-paths.ts |
Updates report-channel import. |
test/e2e/apply-idempotence-proof.ts |
Updates report-channel import. |
test/docs/readme.test.ts |
Updates documentation contract imports. |
test/docs/guides.test.ts |
Updates layer-flow import. |
test/action/io.test.ts |
Updates summary import. |
test/action/inputs.test.ts |
Uses the refactored run configuration. |
test/action/artifact.test.ts |
Tests the action artifact adapter. |
test/action/action-yml.test.ts |
Updates merge-result import. |
src/report/delivery.ts |
Owns report types and uploader validation. |
src/report/artifact-report.ts |
Makes artifact upload an injected port. |
src/io.ts |
Adds collecting and silent IO implementations. |
src/index.ts |
Defines the public library surface. |
src/flows/summary.ts |
Hosts summary rendering. |
src/flows/single.ts |
Extracts single-repository execution. |
src/flows/settings-read.ts |
Hosts settings-file parsing. |
src/flows/redact.ts |
Hosts redaction behavior. |
src/flows/multi.ts |
Hosts multi-repository execution. |
src/flows/merge.ts |
Hosts merge execution. |
src/flows/library.ts |
Adds public validation and repository helpers. |
src/flows/layers.ts |
Hosts layer reading and validation. |
src/flows/deliver.ts |
Centralizes flow delivery and conclusions. |
src/engine/secrets.ts |
Uses engine-owned secret references. |
src/engine/secret-refs.ts |
Moves secret-reference logic into the engine. |
src/engine/orchestrate.ts |
Updates secret-reference dependency. |
src/action/run.ts |
Delegates execution to public flows. |
src/action/io.ts |
Consumes IO through the public entry. |
src/action/inputs.ts |
Consumes shared types through the public entry. |
src/action/artifact.ts |
Implements the artifact uploader port. |
knip.json |
Registers the public entry. |
docs/reference/architecture.md |
Documents the new layer structure. |
biome.json |
Moves the redaction override path. |
architecture.yml |
Enforces library and flow boundaries. |
AGENTS.md |
Updates repository architecture guidance. |
.github/scripts/gen-docs.ts |
Updates merge-result import. |
.github/scripts/changed-sections.ts |
Makes new layers select all sections. |
Review details
- Files reviewed: 46/50 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vivswan
force-pushed
the
refactor/flows-library
branch
from
September 11, 2026 22:40
4c18180 to
6bc1674
Compare
Vivswan
force-pushed
the
refactor/flows-library
branch
from
September 11, 2026 22:46
6bc1674 to
649afb3
Compare
Vivswan
marked this pull request as ready for review
September 11, 2026 22:51
…try src/index.ts The single-, multi-, and merge-run flows, delivery, redaction, settings reading, and the step summaries move from src/action/ to src/flows/; the secret-reference module moves to src/engine/, the private-report channel list and the redacted-detail types to src/report/delivery.ts, and the @actions/artifact uploader to src/action/artifact.ts behind the report layer's ArtifactUploader port. src/index.ts is the public entry, and src/action/ reaches the rest of src/ only through it: architecture.yml grants the action that one edge, so the action is a consumer of the library. No behavior changes: every flow, message, output, and test keeps its meaning, and the single-repo body of run() becomes runSingle, symmetric with runMulti.
Vivswan
force-pushed
the
refactor/flows-library
branch
from
September 12, 2026 01:11
649afb3 to
801c7ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
src/action/*.tsof anything outsidesrc/action/goes through../index.js;architecture.ymlgrants the action that one edge andlint:archfails on any other.src/flows/; the single-repo body ofrun()is nowrunSingle, symmetric withrunMulti.src/index.tsre-exports the library surface (declaration-only); a test pins its exact export set.validateSettings,checkRepository,applyRepository, andrenderMergedYamlinsrc/flows/library.ts;collectingIo()andsilentIo()insrc/io.ts.Proof
bun run checkgreen (2726 tests, 0 fail),bun run test:e2e217/217, fuzz 40/40 iterations,lint:archmatches the tree,typosclean.src/actionfile importingsrc/enginedirectly fails the architecture lint by name (test/library/public-surface.test.ts).Technical details
Moves
src/action/secret-refs.tssrc/engine/secret-refs.tssrc/action/{deliver,layers,multi,redact,settings-read,summary}.tssrc/flows/(same names)src/action/merge-mode.tssrc/flows/merge.tsrun()single-repo bodysrc/flows/single.ts(runSingle,SingleConfig)PRIVATE_REPORT_CHANNELS,PrivateReportChannel,IssueChannel,isIssueChannel,TargetDetail,RedactedDetailsrc/report/delivery.tsCapturedLineCollectedLineinsrc/io.tsMergeConfig,MultiConfig, the sharedRunFlowConfig,DEFAULT_SETTINGS_FILE,quoteListsrc/flows/(inputs.ts imports them back via../index.js)DEFAULT_PRIVATE_REPOS,DEFAULT_PRIVATE_REPORTsrc/action/inputs.ts(input defaults,satisfiestheir list types)runMergeitself (the flow that writes), out of the input parser; same message, same exit@actions/artifactuploadersrc/action/artifact.ts(actionsArtifactUploader);deliverArtifactReport(uploader, document, recipient)takes the port firsttest/io-fake.tssilentIofromsrc/io.tstest/action/{deliver,multi,redact,settings-read}.test.tstest/flows/test/action/secret-refs.test.tstest/engine/Edge changes (
architecture.yml):action: [library]; newlibraryandflowslayers;engineandreportdrop theiractionedge; every declared edge is drawn.Artifact channel without an uploader:
runSingle/runMultireturn a fatal naming the fix before any API call (missingUploaderProblem);openReportChannelthrows the same message as the backstop. The action always supplies its own uploader.Gates updated:
biome.jsonprivate-open override ->src/flows/redact.ts;changed-sections.tsall-selecting prefixes gainsrc/flows/andsrc/index.ts;knip.jsonentry gainssrc/index.ts;docs/reference/architecture.mdregenerated and its hand-authored diagrams re-pointed;test/private.test.tsopener-importer pins follow the moves; AGENTS.md layout bullet updated.Export-list deviations (additions the consumer rule forces):
DEFAULT_SETTINGS_FILE,quoteList,MustBeNever,RunFlowConfig,RepoRunReport,CollectedLine.Recorded, not built:
checkRepository/applyRepositoryacceptrequiredSectionsoutsideonlySectionsand report green (the engine marks the section excluded); the action's parser rejects that contradiction, the library helpers do not. The fix is a validated section-selection type on the engine'sRepoRunOptions, which belongs to the typed-results follow-up, not this reorganization.Reviewer note (Copilot): pure reorganization; report a finding only with a concrete input and the changed output it produces.