Repository navigation
refactor(build): one BuildPlan pipeline for git and local builds - #218
Closed
metalwarrior665 wants to merge 1 commit into
Closed
metalwarrior665 wants to merge 1 commit into
metalwarrior665 wants to merge 1 commit into
Conversation
Both builders prepared their plans and then ran a copy of the same dry-run / start / wait / summarize flow, joined by actorFullName Maps. They now only produce BuildPlans and executeBuildPlans runs them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KgNt21yfetatNQnqhwG7hA
1 task done
metalwarrior665
added a commit
that referenced
this pull request
Nov 4, 2026
…ed-files (#228) I think this makes sense, users can use `get-affected-actors` to get changedFiles too. ## AI `get-affected-actors` (#204) now computes commits, changed files and changelog in one place from a single diff path. The three older commands (`get-commits`, `get-latest-commit`, `get-changed-files`) are documented as "kept for older workflows", but no workflow in this repo uses them. They still carry a second, parallel git model: - `getCommits`, which has its own rerun and base-commit heuristics and duplicates what `since` does in `get-affected-actors`. - `getChangedFiles`, which is `getChangedFilesBetween` with a `~` hack. - `parseBaseCommit`, with the "SHA or Commit JSON" overload that only existed to pipe `get-latest-commit` output back in. - The `--source-branch`, `--target-branch` and `--base-commit` flags, the `gitRangeOptions` group and the `Config` type. #218 left these out on purpose and said the call belongs to the maintainers. This PR is that proposal. ## What - Remove the three commands and everything only they used. About 140 lines of source and about 250 lines of tests go away. - `resolveReleaseBaseCommit` now validates the SHA inline and reuses `findCommitSha`, instead of a second copy of the "`rev-parse` exit code 1 means missing" handling. - Drop the "Legacy git commands" section from `docs/cli.md`. CONTRIBUTING's CLI example now uses `get-affected-actors --base master`. - Delete `logging.test.ts`. It compiled the whole project with `tsc` (the cause of #227's timeout) just to check log levels through `get-commits`. The same check is now two cases in `cli-bundle.test.ts` that run `get-affected-actors` against the committed bundle. - Rebuild the CLI bundle. ## Breaking Anyone who calls these three commands directly breaks. The `workflows-v0` reusable workflows don't, so only external users scripting the CLI are affected. Since we're before v1, this is the cheapest time to drop them. Whether to do it is the open question for reviewers. ## Other ideas I considered and left out Each overlaps an open PR, so it would conflict: - #218 (build pipeline), #223 (`test` and `notify` commands) and #224 (bundle-based CLI tests) already cover the build and reporting code. - Filling `lib/` gaps from issues (`fails` modifier #159, standby without a task #127) are features, not refactors. ## Checks - [x] `tsc`, eslint, prettier, knip (the unused exports it lists were already on master) and `npm test` pass: 31 files, 438 tests. --- _Generated by [Claude Code](https://claude.ai/code/session_016XtpQvEqmuEhj1cBAaUxML)_ Co-authored-by: Claude <noreply@anthropic.com>
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.
Why
runBuilds(git) andrunBuildsFromLocaleach had their own copy of "prepare read-only, dry-run cutoff, start, wait, summarize". They were glued together withactorFullNameMaps (buildConfigsByActorFullName,preparedByActorFullName,buildersByActorFullName) and arunAndSummarizeBuildscallback API. Every cross-cutting build feature has to be written twice. #217 (env var sync check) already does this: it threadsrequireEnvVarsInSyncthrough both flows and both option types.What
BuildPlan: one Actor build, fully read and checked, with nothing written yet. It holds the builder, the fetchedactorInfo, the version number, the cache flag, the dry-runsummaryanddescription, and a lazytoActorVersion(). For local builds that is where the upload happens, so it only runs for real builds.executeBuildPlans(plans, { label, dryRun })is now the only place that handles dry runs, starts builds, waits for them and prints the summary. A dry run returns the sameDryRunPlanobject as before.loadActoris the shared first step: build the client and fetch the Actor once.runAndSummarizeBuilds,waitAndSummarizeBuilds(now internal to the executor) and the unusedgetDefaultVersionAndTagare gone.uploadSourceZiptakes the Actor id from the plan'sactorInfoinstead of fetching the Actor a second time.createVersionAndBuildnow requiresactorInfo(it was optional only so callers could skip a fetch).Behaviour is unchanged: same logs, same dry-run JSON, builds returned sorted by Actor, and one builder (token check) per Actor. A dry run still never creates a version, build or upload.
Follow-ups this enables
deleteOldBuildscould becomeselectBuildsToDelete(actorInfo, builds, now)plus a thin executor. I left it out to keep this PR to one idea.Not touched on purpose
lib/, which refactor(lib): focused modules, declarative toFinishWith, paged datasets #206 and refactor(lib): declarative toFinishWith, memoized RunTestResult, shared test registration #207 rework.get-commits,get-latest-commitandget-changed-filescommands. They look removable once get-affected-actors is the only consumer, but that needs a call from the maintainers.Testing
Added unit tests for
executeBuildPlans: starting and waiting, sorting, failure propagation, the dry run touching nothing, and empty input. The existing build and build-from-local tests pass unchanged. Type-check, lint, prettier and the unit and bundle tests pass, and I rebuilt.github/cli/apify-test-tools.mjs.Generated by Claude Code