2. Run a flow
Most work starts with + New change (see section 1) or with a label on a GitHub issue (see section 6). An admin can also start one flow directly from the flow editor. To do that, open Flows in the sidebar (Admin view), choose a flow and press Test run. A dialog named Run and the flow's name opens.

- What would you like to change? — the task, in plain language. Flows use it in their prompts.
For a flow that clones its own code (workspace
empty) the box is Extra instructions (optional). With an empty box, the first ▶ Start run only warns; press ▶ Run without a task to start anyway. - Advanced (closed at first):
- Repository — the local git repository to work on.
- Variables — settings the flow exposes, e.g.
test_cmd. Leaveautoto let the Foundry detect the test command (npm/pnpm/yarn, pytest, Go, Cargo, Gradle, Maven, Make).
▶ Start run (or Ctrl/⌘+Enter in the box) starts the run and opens its page. If the flow has unsaved edits, the run uses them.
Your checkout is never touched. Depending on the flow's workspace setting, a run works in:
| Workspace | Where the run works |
|---|---|
worktree (default) | A new git worktree on a factory/<run-id> branch of your repository |
empty | An empty folder; the flow clones what it needs (used by the GitHub flows) |
inplace | Directly in the repository — only for flows you trust |
When a run finishes, its branch stays in your repository. Review it, merge it, or delete it.
What agent steps may run#
An agent step (Claude Code or Codex) may run only the commands its tools allow. A step in a code flow can also ask for
one of three named sets of extra commands in its flow file, with allow_commands (see
Flow authoring). Only steps that can write may ask for them; a reviewer or read-only step may not.
images: the image toolsmagick,sips,cwebp,dwebp,pngquantandqlmanage -t. Only the tools that are installed on the computer are allowed. Each call goes through a checked gate (tools/image-gate.mjs). The gate allows a fixed list of options and paths that stay inside the run's workspace (links are followed). It refuses paths outside the workspace, expressions and options that read other files (such as-draw,-font,text:or@listarguments), URLs, and wildcards. A refused call prints the reason and changes nothing.project_scripts: the build and test scripts of the repository's ownpackage.json(build,test,test:unitand the like), run withnpm runandnpm test; pnpm and yarn too when the repository has their lock file. Other scripts, such aslintordeploy, are not allowed. The conflict and fix steps use this set to make generated files again.read_only: read-only checks ofgitandgh.gitallowslog,show,diff,statusandrev-parse,ls-remote origin(and its--heads/--tagsforms) andbranch -r.git log,showanddiffrefuse--outputand--ext-diff;diffalso refuses--no-indexand paths outside the workspace.ghallowsrun list,run view,pr view,issue viewandapi;apiis GET only, with no GraphQL, no--hostnameand no full URL. Write commands and--webare refused, and so are unknown options. Ordinarygitcalls such asaddandcommitstill work. The set adds nothing when the step declares its own tool profile. A step has no GitHub sign-in, so aghcheck may still fail; aghcall that needs sign-in is refused or fails, and the step goes on without it.
The gate is defence in depth, not a sandbox. The operating-system sandbox and Claude's permission rules remain the real limit.
A refused command stops the run only when it blocked the work. The agent is asked to end its answer with the line
REFUSED_COMMAND: <the command> when it cannot finish a part of the issue without that command, and to leave the line
out after a workaround or when nothing was refused. A refused check, such as a look at a log, does not need the line:
the agent goes on without it. Only the last such line counts. A value of none, n/a, -, nothing or an empty value
means nothing was refused.
- Claude Code: the line stops the run only when that command, or the same program, really was refused. A refused image-tool call stops the run even without the line.
- Codex: the line alone stops the run.
- A refusal the agent worked around does not stop the run, also when it happens again in a later visit. It stays listed as blocked on the step.
- An admin sees each refused command once when the step is opened on the run page, above Details. A successful step there says that the run went on. A user's view shows no refusals.
- Claude Code refuses
NAME=value commandeven whencommandis allowed. Such a refusal of an allowed command does not count. Commands with;,|,&&,$and the like,ghand the image tools are always counted.
A run that stops waits as needs you, and the reason names the command, for example
step "implement" is blocked by a refused command: magick photo.jpg photo.png. Allow it in the flow or install the tool, then resume the run.
A long command is shortened at a space. The step is not retried by its on_failure branch, and a stop from a sub-flow
stops the parent run too.
To go on, first fix the cause: install the tool, or, in a custom flow, add the set the step needs to allow_commands
and save the flow. Then Retry from the failing step on the run's page, or scf resume <run>. The step runs again
from its first visit. A run keeps the copy of the flow it started with, so a change to a flow file reaches new runs only.
Keychain. Agent steps may not read or delete Keychain items. Claude steps are denied security dump-keychain,
find-generic-password, find-internet-password and delete-* by name, also when a flow allows Bash(security *).
A security wrapper first on the PATH of unboxed and team steps refuses the same commands, also after options such as
-q, and refuses interactive mode (-i, -p). Other security commands, such as list-keychains, still run. Boxed
steps keep the sandbox's Keychain rule. The Foundry's own sign-in does not use the agent's PATH and is not affected.
A refused call prints a message that names a fake Keychain and exits with code 1.
- Limit: a Codex step without the OS sandbox can bypass the wrapper, for example with
/usr/bin/securityor a changed PATH. A login shell may also move/usr/binahead of the wrapper. Do not rely on the wrapper alone there. - Sign-in change: an unboxed Claude step that relied only on Claude's own Keychain login may fail to sign in. Fix it
with
scf auth set-token(see chapter 7, "Claude token in the Keychain") or a token variable. - Test Keychain code: put a fake
securityfirst on the PATH in your test, not the real Keychain.
Check the image tools. scf doctor lists magick, sips, cwebp, dwebp, pngquant and qlmanage as installed
or missing (sips and qlmanage only on macOS). On macOS install the missing ones with
brew install imagemagick webp pngquant. A missing tool never makes the check fail.
Review before start#
On Start work, when you choose a flow under Advanced, the main button is Review. It runs the same check for required fields as before. If all is filled in, it shows a review page instead of sending anything.
- What you see. The flow title, the repository as
owner/name(or "No repository" when none is sent), the full task text, and every value that will be sent. A value the flow fixes says "set by the flow". If the administrator set the run to start as you, a "Start as" row says so. - Notes. Short safety notes appear when they apply: the repository connection is "Failed" or "Not tested yet"; the task is empty for a flow that uses it. One fixed note is always there: the work runs on the server against this repository and can be cancelled from the run page.
- Start and Back. Start sends exactly what the page shows, once, even if you press it twice. Back returns to the form with every value in place. If the server refuses or the start fails, you return to the form with the server's sentence in the alert and nothing lost.
- Focus. Focus moves to the review heading when the page opens, and back to Review when you press Back.
- Your draft is kept. The flow, repository, task and input values stay in the page's memory while you go to another page and come back to Start work. The form then shows "Your draft from before". The draft is cleared after a successful start and by Clear. It is never written to disk or to browser storage, so it is gone when you reload or close the tab, and another account never sees it. If the kept flow or repository is no longer offered, the form uses the default; the task text stays.
- Read-only preview. The preview (
?as=) never reads or writes a draft and has no Review, Start or Clear.
Start work as an admin#
An admin can also start work the way a user does. Press + New change in the top bar; it opens Start work (#/start). It is the same page: the box, the starting point and Make a plan; the flow, the repository and the fields are under the closed Advanced. Under Advanced the page asks first only for what is required, each marked "(required)": the repository (when the flow asks for one), the task, and every required input. With one published flow there is no flow choice; with several, a picker shows each flow's title and description. Optional inputs and fixed values are in a closed More options line that says how many there are; it is not shown when there are none, and it opens by itself when the server refuses the start. The repository shows "Connected", "Not tested yet" or "Failed"; a failed one has a note with a link to My repositories. Add repository still works. If no flow is published, a new idea or an existing change still works; under Advanced you see "No published flows yet. Publish one in the flow editor." After Start you land on the run page. The run is yours and shows in Changes with you as owner.
The same rules as for a user apply: only a published flow, only your own repositories, and no changes to the flow or its variables. The Test run button of the flow editor works as before (see above).
Build release files on this machine#
The flow release-build builds the release files of any repository on the Foundry machine. Everything project-specific is in the repository's recipe, .factory/release-build.yaml, so the same flow works for a Node package, a static site or a compiled binary. The files are then uploaded to a draft GitHub release of the recipe's tag. The Foundry never publishes a release, and it keeps only the newest drafts of the recipe (see "Upload to a draft" and "Pruning drafts" below).
Start it. By hand: scf run release-build --repo <owner/name> [--ref <branch, tag or sha>]. --repo takes owner/name when no folder of that name exists here; it sets the variable github_repo. --ref sets the variable ref (default main). In the web UI, start release-build and fill in the repository and the ref. The flow clones the repository and resolves the ref to one commit. It finds the recipe for that commit (see the next paragraph). A repository without a recipe fails at once with "this repository has no release-build recipe", and the message says whether the repository is registered in the Foundry.
Or automatically. A schedule watcher with the option release_build starts this flow by itself after each new commit on main (see Sources). Those runs skip a commit that was built, skipped or seen before, and say so in the run log.
Where the recipe comes from. The file .factory/release-build.yaml at the commit wins. When the commit has no such file, the recipe stored in the Foundry settings of the repository is used: an admin sets it on the admin page (Administration → All repositories, Edit) or with PUT /api/admin/repos/<id>/settings, field releaseRecipe. Use it for a repository that should not contain a Foundry file. The run summary says which one was used: recipe: .factory/release-build.yaml or recipe: stored in the Foundry settings. The repository is matched by owner/name in any letter case, with or without .git. If the repository is registered under two accounts with different stored recipes, the run fails and an admin must keep one. Only an admin can store a recipe, and a stored recipe runs commands on the Foundry machine just like a file in the repository, so store only what you would commit.
Who may build which ref. An admin may build any ref. A user may build only the repository's default branch: its mainBranch setting, else main. For any other ref, a branch, a tag or a commit id (even one that is on the default branch), the server refuses the start with a 403 that names the ref. This also holds for a published flow that fixes the ref. An admin who starts a run as a user (likeUser) follows the user rule.
The recipe. The keys:
| Key | Default | Meaning |
|---|---|---|
version | {commit_datetime} | The version of the release. |
tag | v{version} | The git tag of the release. |
prerelease | true | Mark the release as a pre-release. |
keep | 5 | How many releases to keep, 1 to 50. |
timeout_minutes | 60 | The time limit of each build, 1 to 480 minutes. |
builds | (required) | The list of builds, at least one. |
assemble | (none) | A command that runs after all builds. |
tag, prerelease and keep are used by the upload, described below.
The placeholders, filled from the committer time of the resolved commit in UTC (the server's timezone does not change them):
{commit_datetime}:YYYYMMDDHHMM, for example202610181430.{commit_date}:YYYYMMDD, for example20261018.{sha}: the short commit id, 7 characters.{version}: only intag; the expandedversion.
The same commit always gives the same version and tag.
Each build has:
name: letters a–z, digits and-, unique in the recipe. It names the folder of the build's files.on: a list ofmacos,linuxandwindows. Default: any.arch(optional):arm64orx64.requires(optional): command names that must be on the machine'sPATH.run: the build command. It runs in the build's own checkout.artifacts: file globs, relative to the checkout (*,?,**). Every matching file is collected.
What happens.
- Builds run one after the other. Each runs in its own
git worktreeof the commit, never in your checkout, and throughtools/test-slot, so it waits for a test slot at low priority. Its time limit istimeout_minutes. - A build whose
onorarchdoes not match this machine is skipped, with a line such aswindows-x64: skipped, needs windows. If every build is skipped, the run fails with "nothing to build on this machine". - A missing
requirescommand fails that build before any build runs, with a line that names the command. - A build whose
artifactsmatch no file fails. - The matching files go to
release/in/<name>/in the run folder. Each build has its log inrelease/logs/<name>.log. assembleruns after all builds. It readsrelease/inand writes its files torelease/out. Withoutassemble, the collected files are copied torelease/outas they are.- A
SHA256SUMSfile is added torelease/outwhen there is none. - Stopping the run stops the running build and its whole process tree.
Environment of a build. The run and assemble commands get a short environment, not the Foundry's: PATH, HOME, LANG, a fixed list of toolchain variables, and the five release variables below. The list of toolchain variables is LC_ALL, LC_CTYPE, TMPDIR, TEMP, TMP, USER, LOGNAME, SHELL, TERM, JAVA_HOME, GOPATH, GOROOT, GOCACHE, GOMODCACHE, CARGO_HOME, RUSTUP_HOME, NVM_DIR, ANDROID_HOME, ANDROID_SDK_ROOT, ANDROID_NDK_HOME, PYENV_ROOT, DEVELOPER_DIR, SDKROOT, the proxy variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY and the lower-case forms; a proxy with a password in it is left out), and on Windows SystemRoot, ComSpec, PATHEXT, WINDIR, USERPROFILE, APPDATA and LOCALAPPDATA.
Never passed: GH_TOKEN, GITHUB_TOKEN, GH_ENTERPRISE_TOKEN, the bot's token variable, the provider key variables, and any other name that contains TOKEN, SECRET, PASSW, CREDENTIAL, _KEY or AUTH. A tool that needs another variable is not helped by the recipe: put the tool on PATH and let it find its own settings in HOME.
The variables the commands get:
FACTORY_RELEASE_VERSION: the expandedversion.FACTORY_RELEASE_TAG: the expandedtag.FACTORY_RELEASE_SHA: the full commit id.FACTORY_RELEASE_IN: the folder of the collected files (release/in).FACTORY_RELEASE_OUT: the folder for the release files (release/out).
The recipe text never goes into a shell command line. The commands run the way the repository's own test command runs, through sh -c.
Windows. The commands run with sh. On a Windows machine, install Git for Windows (Git Bash) and make sure sh is on PATH.
Recipes for several kinds of project. Each recipe is the .factory/release-build.yaml of a repository.
A Node command-line package, packed with npm pack:
builds:
- name: npm-package
requires: [npm]
run: npm ci && npm pack
artifacts: ["*.tgz"]
A static site, zipped:
version: "{commit_date}-{sha}"
builds:
- name: site
requires: [npm, zip]
run: npm ci && npm run build && cd dist && zip -qr ../site.zip .
artifacts: ["site.zip"]
A compiled binary, one build per platform (Go here; any compiler works the same way):
builds:
- name: linux-x64
on: [linux]
arch: x64
requires: [go]
run: go build -o tool .
artifacts: ["tool"]
- name: macos-arm64
on: [macos]
arch: arm64
requires: [go]
run: go build -o tool .
artifacts: ["tool"]
- name: windows-x64
on: [windows]
arch: x64
requires: [go]
run: go build -o tool.exe .
artifacts: ["tool.exe"]
Each machine builds the entries that match it and skips the others. The collected files of linux-x64 are in release/in/linux-x64/.
Suggest a recipe#
scf release-build init --repo <owner/name> looks at the build files of a repository and prints a suggested .factory/release-build.yaml. It uses plain rules and no agent. It builds nothing, and it changes nothing unless you add --write.
What it does. It makes a shallow clone of the repository in a temporary folder, reads the tracked files, prints the suggestion to stdout and deletes the folder. The clone may take up to 5 minutes; each other git or gh call up to 2 minutes. Only files at the top of the repository count, and for Go also cmd/<name>/main.go.
What it detects.
| File | Suggested build |
|---|---|
package.json | npm-package: the install command of the lock file (npm ci, pnpm install --frozen-lockfile, yarn install --frozen-lockfile, bun install, or npm install with no lock file), then npm run build when there is a build script, then npm pack. Artifact *.tgz. |
pyproject.toml or setup.py | python-package: python3 -m build. The machine needs the build package. Artifacts are the wheel and the source tarball in dist/. |
build.gradle or build.gradle.kts | gradle-jar: ./gradlew build -x test when there is a gradlew file, otherwise gradle build -x test. |
pom.xml | maven-jar: mvn -q package -DskipTests. |
go.mod | go-binaries: one cross-compile each for Linux x64, macOS arm64 and Windows x64, into dist/. The binary is named after the last part of the module path. |
Cargo.toml | rust-binary: cargo build --release for this machine. The binary is named after [package] name. |
Dockerfile | docker-image: builds the image and saves it as image.tar.gz. Requires docker and gzip. |
A name taken from the repository is used only when it is plain (letters, digits, ., _ and -). Otherwise a fallback name is used, and the comment says so.
The output. Every guessed line ends with a # comment that says it is a guess and why. The version is always {commit_date}-{sha}. The first lines name what was detected. Messages go to stderr, so stdout holds only the recipe. When nothing is detected, the output is a commented template and a line on stderr says so. Check every guess before you commit the file.
With --write. The command opens a pull request instead of only printing the recipe:
- It makes one commit on top of the default branch that adds the recipe file and nothing else. Your working copy is not touched.
- It pushes that commit to the new branch
release-build-recipe. The push creates the branch only; it never changes an existing one. - It opens a pull request into the default branch with
gh pr createand prints its URL.
It never commits to or pushes to the default branch. It refuses, changes nothing and exits 1 when:
- the repository already has
.factory/release-build.yaml; .factoryis a link or a file in the repository, not a folder;- nothing was detected;
- the branch
release-build-recipealready exists on GitHub (delete it and run the command again); - the default branch cannot be read, or is itself named
release-build-recipe.
If the pull request cannot be opened, the command first looks for an open pull request from that branch, because gh may have made it before it failed. If there is none, it deletes the branch it pushed. If that fails, it tells you to delete the branch by hand. After Ctrl+C, it does the same.
Merging the pull request adds the recipe to the default branch. Then release-build finds it at the resolved commit.
The command needs git and gh on the machine, and gh signed in with access to the repository.
Upload to a draft release#
Upload to a draft. After the build, the step upload sends the files to the draft release of the recipe's tag. It works in this order:
- It lists the releases of the repository and looks for the tag. If a published release has the tag, the run fails with a link to that release and changes nothing. The Foundry never changes a published release.
- If no release has the tag, it creates a draft on the built commit, with
prereleasefrom the recipe. A git tag without a release is fine: the draft does not create the git tag; it appears when the release is published. - If one draft has the tag, the files go into that draft. If several drafts have it, the newest (by creation date) is used and a warning names the count and the id.
- A file with the same name as one already on the release is replaced. The
prereleaseflag is set when the draft is created; an existing draft keeps its own flag. - The file names on the release have no folders.
/becomes-, and any character other than a letter, a digit,.,_or-becomes_. Solinux-x64/toolislinux-x64-tool. A release takes at most 1000 files, and a name at most 200 characters. Two files that would get the same name fail the run. SHA256SUMSis written again with the names as they are on the release.release/outitself is not changed.- The delivery validator. Every release also gets
scf-delivery-validate-<version>.mjsandscf-delivery-validate-<version>.mjs.sha256, both inSHA256SUMS. The file is the validator of this Foundry install (see "Check a delivery contract in CI"). A build that already has a file with that name fails at the stepvalidator. - If the release is published while the files are uploaded, the upload stops and the message says how many files were uploaded.
The upload step uses the Foundry's GitHub login for the repository (repository access). The build steps never get it. A repository that is reached only with a deploy key cannot be uploaded to: the step fails with the message about the missing GitHub login.
Pruning drafts. After a successful upload, the step deletes the oldest drafts of the recipe until keep drafts remain. The new draft counts. Age is the creation date. A draft is deleted only if all of these hold:
- It is a draft. Published releases are never deleted.
- Its tag matches the recipe's tag pattern. Each placeholder has its own format:
{commit_datetime}is 12 digits,{commit_date}is 8 digits,{sha}is 7 lowercase hex characters, and{version}is the expandedversion. The rest of the tag is literal text. Sov{commit_date}-{sha}matchesv20261018-a1b2c3d, but notv2026-a1b2c3dorv20261018-release. - Its notes hold the Foundry's marker line for this recipe. The Foundry writes it when it creates the draft. A draft made by hand, or made for another recipe, is never deleted. Removing the marker line from the notes of a draft keeps that draft.
Each draft is checked again just before it is deleted. A draft that changed since the list is skipped with a warning. A draft that cannot be deleted gets a warning too; the run still succeeds.
Result. The step output lists the uploaded files with their sizes, the link to the draft, the drafts pruned and the drafts kept. The run's data (run.json, field outputs) holds release_url (the link to the draft), release_tag and release_files (the names and sizes). Later parts of the Foundry read these fields.
One run at a time. Every step that does work takes the lock @release-build. A second run of release-build waits in the queue until the first one finishes, for up to 24 hours at the first step. The lock is not per repository: runs for different repositories also wait for each other.
Start by hand, examples.
scf run release-build --repo owner/repo # the default branch (main)
scf run release-build --repo owner/repo --ref v2.4.0
Review a whole repository#
repo-review reviews a whole repository and files what it confirms as stories the Foundry can build. You write no issues yourself.
Review this repository button. On a repository's page (#/repos/:id), the Overview card has a Review this repository button next to Definition of Ready. It starts the review of that repository and opens the run page. Who sees it:
- An admin always sees it, when the
repo-reviewflow is available. - A user sees it when an admin has published the
repo-reviewflow. - It is not shown on a read-only view, or for a repository that is not on GitHub (a local project).
The button is disabled while the start is in progress. If the start fails (for example with 403), the page shows an alert and opens no run.
scf run repo-review --repo owner/name
scf run repo-review --repo owner/name --var ref=release/2.x --var focus="the login code" --var max_stories=5
What it does, in order (each step shows on the run page):
- Clone and check. It clones the repository into
repo/and runs the build and the tests.build_cmdandtest_cmdareautoby default, which finds the commands from the project files. Failing tests are named from the JUnit reports. The branch isref, elsedevelop_branch, elsedevelop, else the default branch. The clone has no remote, so the checks cannot push. - Check dependencies. When the repository has a
package-lock.json,npm audit --package-lock-onlyfinds the dependencies with a known high or critical vulnerability. What is sent outside: only the names and versions of the packages inpackage-lock.json, to the npm registry (registry.npmjs.org). No source code and no other file leaves the machine. The check waits up to 120 seconds. It never fails the run: when there is no lock file or the audit fails, the summary says "Dependencies not checked" and why. The advisories are written toaudit.mdin the run. - List open issues. The open issues are read so that a finding already covered by one is not filed again.
- Review. A read-only agent (it can read and search files, nothing else) answers with findings. It looks for authorization gaps, injection, XSS, CSRF, SSRF, secrets, insecure defaults, data loss, correctness, error handling, missing tests on critical paths, CI that does not build or test, and dependencies with a known high or critical CVE from step 2. It reports no style nits.
focusnarrows the review. - Verify. A second agent session checks each finding end to end. It drops what it cannot confirm and groups the rest into stories. A finding is also dropped when a
file:lineit names does not exist in the clone. A dependency finding is confirmed whenaudit.mdlists the advisory for that package. - Plan. The Foundry orders the stories by severity, caps them at
max_storiesand skips duplicates: a story covered by an open issue, a story with the same title, or a story already filed by this run. - File. The missing labels are created first. Each story is one issue with the
labels(defaultFactory_go) andbugorenhancement.
Settings. Set them with --var or in the start form.
| Setting | Default | What it does |
|---|---|---|
ref | (see above) | The branch to review. A branch that does not exist fails the run. |
develop_branch | empty | The branch that feature branches are merged into. |
build_cmd, test_cmd | auto | The commands for the checks. Empty build_cmd means no build. |
focus | empty | What the review looks at most. Empty means the whole repository. |
max_stories | 10 | The most stories one review files, from 1 to 50. The most serious come first. |
labels | Factory_go | Labels every story gets, separated by commas. |
summary_issue | no | Also file the summary as one issue (without the build label). |
verify_timeout_min | 180 | The time limit of the checks, in minutes (1 to 720). |
Red base. When the build or the tests fail, story 1 is Make it build and test. It lists the failing tests under ## Failing tests to fix, or uses ## Build to fix when no test can be named. Every other story says ### Depends on with story 1, so the Foundry builds the fix first. The same heading rules apply as in Stories that fix failing tests.
Story format. Each story has a story line, then:
## Problem— what is wrong and why it matters.## Where it applies— the code paths.## Code— eachfile:linereference, checked against the clone.## Fix— what to change.## Acceptance criteria— a checklist.## Only the owner can provide— only when the fix needs something only you have (a secret, an account, a decision). It says to ask it as anowner_action.
Text from the agents is redacted before it is filed: a token-like string is removed from the issue and from the summary. Agent text cannot add headings, Depends on lines or mentions to a story.
Summary. The summary (the stories filed, the stories skipped with the issue that covers them, and the findings dropped with a reason) is shown on the run page. With summary_issue=yes it is also filed as one issue.
Scheduled runs. A run that a schedule watcher starts (the chore_watcher variable is set) stops at approve_stories before anything is filed. The run page shows the list of stories. Approve to file them, or reject to file nothing. A manual start files directly.
What it never writes. The review writes only issues and labels. It does not push, open pull requests or change the repository.
Run the slow tests nightly#
The large and slow tests (slow_test_cmd, see Test tiers in the story section) also run every night on develop, with the flow nightly-slow-tests. They never run in a story. The run clones develop; the clone has no way back to the remote, so the run pushes nothing. Its result shows on the run page like the result of any other run: green when the tests pass, failed when they fail or run out of time, and ended when there is nothing to run or no test slot comes free.
Start it by hand, or let a schedule watcher start it each night:
scf run nightly-slow-tests --var github_repo=owner/name --var slow_test_cmd="npm run test:slow"
watchers:
- id: webshop-slow-tests
source: schedule
flow: nightly-slow-tests # runs slow_test_cmd on develop; pushes nothing
github_repo: acme/webshop
at: "02:00"
timezone: Europe/Berlin
task: Nightly slow tests
vars:
slow_test_cmd: npm run test:slow
Variables: develop_branch (default develop; the run fails when that branch does not exist), slow_test_cmd (empty: nothing runs) and verify_timeout_min (the time limit, 1 to 720, default 360). The wait for a test slot does not count against the limit.
Check dependencies weekly#
deps-weekly lists the dependencies of a repository that have a newer version, and the ones with a known vulnerability, and files them as stories on the repository, so each update is built and tested on develop before it reaches main. It uses no agent. It writes only issues and labels: it opens no pull request and changes nothing in the repository.
Start it by hand, or let a schedule watcher start it every 7 days:
scf run deps-weekly --var github_repo=owner/name [--var develop_branch=develop]
watchers:
- id: webshop-deps
source: schedule
flow: deps-weekly # lists the outdated dependencies of develop
github_repo: acme/webshop
every: 7d # a schedule without "at": one run every 7 days
task: Weekly dependency check
What it does, in order:
- Clone. It clones the branch
develop_branch, elsedevelop, else the default branch, the same way as Review a whole repository. The clone has no remote. - Actions. It finds the GitHub Actions pinned in
.github/workflows/*.yml(theuses:of each step and of each reusable job) and asks GitHub, withgh, for the newest release of each one. This step and the File step are the only ones that talk to GitHub, and this one runs no code from the repository. A pin is compared at its own precision:@v4is not an update while the newest release isv4.2.0. A pin to a full commit SHA is compared by the version in its comment (for example# v4.2.0). Without such a comment, the SHA is compared with the commit of the newest release, and a different commit is listed as "not compared". - Check. Without any agent, it checks each project it finds at the top of the repository, and the whole repository with the OSV scanner. The tools are:
| Tool | Finds | Runs | Override variable |
|---|---|---|---|
| Maven | pom.xml | versions:display-dependency-updates, versions:display-plugin-updates and versions:display-parent-updates, with ./mvnw when the repository has it, else mvn | FACTORY_MVN_BIN |
| npm | package.json | npm ci in the clone (scripts are not run), then npm outdated --json and npm audit --json of the package-lock.json. Without a lock file, npm outdated alone and no audit. The project's own .npmrc and your npm credentials are not used. | FACTORY_NPM_BIN |
| Gradle | build.gradle, build.gradle.kts, settings.gradle or settings.gradle.kts | dependencyUpdates of the Gradle versions plugin (com.github.ben-manes.versions), with ./gradlew when the repository has it, else gradle. Only stable releases count. Without the plugin, Gradle is skipped with a note. | FACTORY_GRADLE_BIN |
| pip | requirements.txt, pyproject.toml, setup.py, setup.cfg or Pipfile | pip list --outdated --format json against PyPI. It runs only when FACTORY_PIP_BIN names the pip of the project's Python environment. Unset, pip is not run and a note says so. | FACTORY_PIP_BIN |
| Go | go.mod | go list -m -u -json all, without downloading a toolchain | FACTORY_GO_BIN |
| GitHub Actions | .github/workflows/*.yml | gh looks up the newest release of each pinned action (step 2) | FACTORY_GH_BIN |
| OSV scanner | the whole repository | osv-scanner --format json --recursive .. Its findings mark the matching updates as security. Without it, a note says so. | FACTORY_OSV_BIN |
Each override names the program to run. Without one, the command name in the Runs column is looked up on the PATH; pip has no default, as above. The overrides are set in the environment that runs the Foundry.
4. File. It files the updates as stories on the repository (github_repo), with the labels set below. This step has repo_access, so it writes to GitHub; the check step does not.
Each update is marked:
- Class:
patch,minorormajor, from the change in the version number. For a pinned action, the class is the change from the pinned version to the newest release. - Security: when
npm auditor the OSV scanner lists the current version of the package.
The result is written to deps.json in the run folder. The output of the check step shows the same table as plain text. An example (the names are made up):
TOOL KIND NAME CURRENT LATEST CLASS SECURITY
npm dependency lodash 4.17.20 4.17.21 patch security
gradle dependency org.example:core 1.2.0 1.4.0 minor
maven dependency com.example:core 1.2.0 1.4.0 minor
pip dependency requests 2.28.0 2.32.3 minor
actions action actions/checkout v3 v4.2.0 major
go dependency example.com/lib/json 1.0.2 2.0.0 major
The table shows at most 100 rows; deps.json has all of them. A vulnerable package with no newer version is listed below the table, with "no update available".
Stories. The file step turns the updates into stories:
- Patch and minor updates go in one story, with the trigger labels and
enhancement. - Each major update gets its own story, with
enhancement. It gets the trigger labels too only whendeps_majors_goisyes, so by default a major update waits for you to add the label. - Security updates, of any size, go in one story with the trigger labels and
bug. The watcher startsbugstories first.
Each story lists the name, the current and the new version, the type, and a release-notes link when one is known. It also gives the build command and the acceptance criteria. Each update carries the marker <!-- deps-weekly: <name>@<version> -->, which is how the next run knows it is already filed.
The variables of the flow:
| Variable | Default | What it does |
|---|---|---|
deps_labels | Factory_go | The trigger labels, separated by commas. They replace Factory_go on every story. |
deps_majors_go | no | yes gives the major stories the trigger labels, so they start by themselves. |
deps_ignore | empty | Names that are never reported, or group:* for a whole group, such as org.springframework:*. Separate them with commas. |
Any other value of deps_labels or deps_majors_go stops the step before it writes to GitHub.
Filing does not repeat itself:
- Run it twice with the same updates, and the second run files nothing.
- An update already in an open story is skipped. When a newer version appears, the open story's line and marker are edited, and no new story is filed.
- An update whose story was closed as not planned is not filed again for that version. A newer version is filed.
- The filed stories are saved in
filed.jsonafter each create and edit, so a run that stops can run again without duplicates. - A repository with more than 1,000 open or closed issues is not filed: the step stops before it writes, and says so.
- Two runs for the same repository wait for each other. The wait is up to 10 minutes (
FACTORY_DEPS_LOCK_WAIT_MS).
Results.
- Nothing outdated: the run succeeds and says "All dependencies are up to date.".
- A tool is missing or fails (for example
mvnis not installed,npmcannot reach the registry, or a check takes longer than its time limit): the failure is a note in the output and indeps.json, and the run still succeeds. A note also says when the result is incomplete. - The summary line is the last line of the output, for example:
Updates found: 12. Filed: 3 in 2 stories. Updated in open stories: 1. Skipped as already filed: 8. Tools not available: 1.
Each tool has its own time limit (Gradle 20 minutes, Go 10, pip and the OSV scanner 5). The check step as a whole can take up to 90 minutes, and the actions step up to 10 minutes.