Repository navigation
feat(serve)!: require a catalog; catalog/ is the reference catalog - #252
Merged
gusfcarvalho merged 2 commits intoOct 29, 2026
Merged
Conversation
factory serve no longer defaults --catalog-repo to this repository: it exits with "a catalog is required: pass --catalog-repo URL or --catalog-dir DIR". --catalog-ref and --catalog-path keep main and catalog. catalog/README.md marks catalog/ as the reference catalog to copy, deploy/poc/run.sh takes FACTORY_CATALOG_REPO, _REF and _PATH, and the PoC README's catalog section becomes bring your own. BREAKING CHANGE: a dispatcher started with no catalog flag must now pass --catalog-repo or --catalog-dir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der checks (self-review pass 1) Co-Authored-By: Claude Opus 5.5 <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.
Task: IMPROVEMENTS item 8, stack A PR A3 of 3: fx/cat-a3-require-catalog on fx/cat-a2-rules-test-render.
Stack: #250 (A1) → #251 (A2) → this PR.
Summary
Breaking change (
!):factory serveno longer defaults--catalog-repotohttps://github.com/ContainerSolutions/factory. Anyone who startedservewith no catalog flag must now pass--catalog-repo URLor--catalog-dir DIR; without either it exits 2 witha catalog is required: pass --catalog-repo URL or --catalog-dir DIR.cmd/factory/serve.go,internal/controllers/catalogsource.go):DefaultCatalogRepoandGitSource.withDefaults' repo default are gone, and--catalog-repodefaults to"".--catalog-refkeepsmainand--catalog-pathkeepscatalog. The existing checks stay:--catalog-direxcludes the git flags, and an explicitly empty--catalog-repo/-ref/-pathis still "must not be empty". An explicitly empty--catalog-diris now--catalog-dir must not be empty(it used to fall through to the git default). The usage line and text name the two ways.catalog/README.md(new):catalog/is the reference catalog. The tests and fixtures use it, it is the example to copy, and no dispatcher deploys it. Itspoc-*RuleSets name compliance-framework repos as examples. The README says whatmake catalogandcatalog_test.gocheck, and how to start your own catalog: copy the directory, set the App IDs and scopes, runfactory validateandfactory rules testin CI with a pinned release, thenserve --catalog-repo(plus A1's App flags for a private repo). Nothing else undercatalog/changes.deploy/poc:run.shtakesFACTORY_CATALOG_REPO(required unlessFACTORY_CATALOG_DIRis set; it fails before the build with a clear message),FACTORY_CATALOG_REF(defaultmain),FACTORY_CATALOG_PATH(defaultcatalog) andFACTORY_CATALOG_APP_ID(A1's)..env.examplelists them, with CCF'shttps://github.com/compliance-framework/factory-catalogas the commented example. README §4 is now "Catalog: bring your own", with three options (a public repo, a private repo with the App flags, a local directory), and the local-copy recipe starts from a copy of the reference. The "Run the image" example passes--catalog-repo. The expectedfactory validatecount in the recipe is corrected from 11 warnings to 23 (all CAT1200), which is what the copy gives on this base.run.shsending the catalog App's token to the hard-coded public repo (discussion_r4411918033): withFACTORY_CATALOG_APP_IDset,run.shnow passes--catalog-repo "$FACTORY_CATALOG_REPO", the repo from.env.controllers.md,api-server.md(synopsis, flag table, config validation) androllout.mdnow say serve requires a catalog, and they point tocatalog/README.md. ADR-0006 is untouched.Design decisions (also in the
lisa-designnote):.env.examplekeepsFACTORY_CATALOG_REPOcommented out. It is needed only whenFACTORY_CATALOG_DIRis unset, so it is not inrun.sh's unconditionalrequired=()list, whichdeploykit_test.gopins to the uncommented lines.run.shchecks the either/or itself, sodeploykit_test.goneeds no change.TestParseServeConfiggives every row that names no catalog--catalog-repo https://github.com/example/catalog, the same way it already adds--state-memory. AnoCatalogfield turns that off for the row that tests the refusal.GitSourcekeeps no repo default. An emptyReporeaches gitsource, which already rejects it, so serve is the one place that validates the flags.Verification
make reviewable(PATH starting with the go1.26 golangci-lint and the claude/codex guard): passes (generated-code check, lint,go test -race,make catalogwith 66 cases, 66 ok, 0 differ, and openapi-lint 100/100).gofmt -l $(git ls-files '*.go'): prints nothing.TestParseServeConfigrows:no catalog(the exact message),empty repo,empty dir, anddev serve on the PoC catalog dir(--dev-fake-providers --catalog-dir internal/catalog/testdata/poc, the AGENTS.md command, gets past flag parsing).testConfig/TestServeEndToEndstill start serve on that directory.TestDefaultschecks thatGitSource{}has no repo and keepsmain/catalog.factory serve --state-memorywith no catalog flag printsa catalog is required: pass --catalog-repo URL or --catalog-dir DIRand exits 2.run.sh:bash -npasses. A copy ran in a scratch tree with a stubbin/factorythat prints its arguments (SKIP_BUILD=1, dummy.envvalues, so serve never started), in four cases. With no catalog variable it refuses with the message. With onlyFACTORY_CATALOG_REPOit passes--catalog-repo <repo> --catalog-ref main --catalog-path catalog. With_REF,_PATHand_APP_IDalso set it passes them plus--catalog-app-key-ref ccf-factory-app/private-key. WithFACTORY_CATALOG_DIRit passes only--catalog-dir.catalog/with the App IDs and skill refs patched gives0 errors, 23 warnings, all of them CAT1200.run.shagainstcompliance-framework/factory-catalogwithFACTORY_CATALOG_APP_IDand the real ccf-factory key. That needs the private repo, the App installed on it, and the real.env.🤖 Generated with Claude Code