Repository navigation
fix(codegen): resolve skill bundle deps from the lathe runtime - #196
Conversation
Bundle codegen pinned kitup with a hardcoded `go get ...@v0.1.3` while go.mod had moved to v0.1.4, so MVS downgraded the runtime to v0.6.1. Generated code now mounts the bundle through pkg/skillbundle, which makes Lathe's go.mod the only source of kitup versions, and codegen runs `go mod tidy` instead of pinning (skipped in workspace mode). Fixes #195 Signed-off-by: samzong <samzong.lu@gmail.com>
Merging this PR will degrade performance by 34.78%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | yaml-large |
9.2 ms | 15.8 ms | -41.5% |
| ❌ | small |
94.8 µs | 160.4 µs | -40.91% |
| ❌ | BenchmarkFindCatalogCommand |
5.6 µs | 9.4 µs | -40.59% |
| ❌ | json-small |
172 µs | 289.3 µs | -40.54% |
| ❌ | small |
127.6 µs | 208.4 µs | -38.78% |
| ❌ | large |
1.1 ms | 1.8 ms | -38.04% |
| ❌ | large |
1.6 ms | 2.6 ms | -37.89% |
| ❌ | BenchmarkCatalogJSON |
2 ms | 3.2 ms | -36.56% |
| ❌ | BenchmarkFormatTableInferredColumns |
765.7 µs | 1,205.2 µs | -36.47% |
| ❌ | json |
886.8 µs | 1,373 µs | -35.41% |
| ❌ | miss |
2.5 ms | 3.9 ms | -35.29% |
| ❌ | table |
507.5 µs | 779.7 µs | -34.91% |
| ❌ | hit |
2.6 ms | 3.9 ms | -34.08% |
| ❌ | small |
81.9 µs | 122.4 µs | -33.14% |
| ❌ | yaml |
3.5 ms | 5.3 ms | -33.05% |
| ❌ | small |
101.3 µs | 149.2 µs | -32.09% |
| ❌ | BenchmarkParseNormalize |
5.3 ms | 7.6 ms | -30.03% |
| ❌ | large |
1.7 ms | 2.4 ms | -29.5% |
| ❌ | large |
1.2 ms | 1.6 ms | -28.2% |
| ❌ | json-large |
2.5 ms | 3.4 ms | -26.93% |
| ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/bootstrap-kitup-downgrade (6e46ecd) with main (f50de53)
…owngrade Signed-off-by: samzong <samzong.lu@gmail.com> # Conflicts: # internal/codegen/render/templates.go
Signed-off-by: samzong <samzong.lu@gmail.com>
Summary
Fixes #195. With
skill.bundle: true, codegen ran a hardcodedgo get github.com/lathe-cli/kitup/go@v0.1.3 github.com/lathe-cli/kitup/go-cobra@v0.1.3. Lathe's owngo.modhad moved tokitup/go v0.1.4, so MVS downgraded the runtimegithub.com/lathe-cli/lathefrom v0.6.2 to v0.6.1 and the generated CLI failed to start, while bootstrap exited 0. The constant drifted because dependabot only updatesgo.mod.pkg/skillbundle.Mountowns the kitup imports. Generatedmodules_gen.gocalls it instead of importing kitup directly, so Lathe'sgo.mod(which now also requireskitup/go-cobra) is the only source of kitup versions, and dependabot bumps both together.go mod tidy, which never downgrades. It is skipped in workspace mode, wheretidyignoresgo.work.Verification
make check: passed.examples/petstorewith bundle enabled and published v0.6.2:go: downgraded github.com/lathe-cli/lathe v0.6.2 => v0.6.1, then__lathe verifyfailed withgenerated CLI failed to start.replace): the lathe requirement is unchanged,kitup/goandkitup/go-cobraresolve to v0.1.4, and__lathe verify --jsonreturnsok: true, includingskill_install.go.workwith the app and this checkout: codegen skipstidy, build succeeds, and__lathe verifyreturnsok: true.pkg/skillbundle): codegen fails with a hint to keep the runtime at the generator version, andgo.modstays at v0.6.2.pkg/runtime,pkg/lathe, andpkg/configdo not depend on kitup.TestRunCodegen_SkillBundleGeneratesEmbedAndTidiesDepsandTestRunCodegen_SkillBundleSkipsTidyInWorkspacefail onmainand pass on this branch.Not verified:
pkg/skillbundle. With a runtime older than that release,go mod tidywill resolve the missing package by upgradinggithub.com/lathe-cli/latheto@latest(shown in its output) instead of failing.lathe initend to end. Starter templates do not enableskill.bundle, so init does not take this path.Compatibility
runtime.SchemaVersion, andCatalogSchemaVersionare unchanged.pkg/skillbundle. Code generated by this version needs a runtime that contains it. Code generated by earlier versions still builds against this runtime.go mod tidyinstead ofgo get <pinned versions>. Documented indocs/cli-usage.mdanddocs/architecture.md.Checklist
internal/generated/,.cache/, and ad-hocskills/<cli-name>/directories is not committed.