Conversation
✅ Testkube GitHub IntegrationReview based on commit All tests and quality gates passed.
7 workflows executed
|
|
| // cacheToolkitCommand builds the toolkit invocation, passing the step's volume mounts so | ||
| // the walker knows which roots it may read and write. | ||
| func cacheToolkitCommand(container stage.Container, verb string) []string { | ||
| cmd := []string{constants.DefaultToolkitPath, "cache", verb} |
There was a problem hiding this comment.
Every cache-enabled step invokes /.tktw/toolkit cache restore and later cache save, but the toolkit built and shipped by this repository does not register a cache command. Cobra will reject the first invocation, causing the cache stage to exit unsuccessfully instead of restoring the cache or continuing with an uncached run.
| cleaned := path.Clean(declared) | ||
| if cleaned == "/" { | ||
| return fmt.Errorf("cache.paths[%d]: %q: caching the container root is not supported", i, declared) |
There was a problem hiding this comment.
Root-path validation runs before relative paths are resolved against cache.workingDir. A configuration with workingDir: / and paths: [.] therefore passes this check, but mountCachePaths later resolves the path to / and mounts an emptyDir over the container root. This hides the image filesystem from the step and bypasses the explicit prohibition on caching the container root.
eaa2f9f to
1cd2f5f
Compare
1cd2f5f to
23aac78
Compare
23aac78 to
5fa4144
Compare
bb12a79 to
ee0ad67
Compare
ee0ad67 to
304cd66
Compare
The restore runs before the step and the save after it passes. A parent step with children gets one cache around all of them, which is usually what is wanted: caching each child separately packs and uploads the same tree more than once. Save runs only when the step passed. Publishing a half-finished install under a content-hash key would have every later run restore the broken tree, and an entry cannot be replaced. Cached paths must resolve before the pod starts, because the volumes are decided then while the toolkit resolves paths inside it; a path that can only be resolved in the pod is refused at build time rather than silently doing nothing. The two end-to-end workflows land here rather than with the rest of the fixtures, because the bundling test in this package reads them: a test and the file it opens have to arrive together or the layer does not pass on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
304cd66 to
1f93a1a
Compare
The restore runs before the step and the save after it passes. A parent step with children gets one cache around all of them, which is usually what is wanted: caching each child separately packs and uploads the same tree more than once.
Save runs only when the step passed. Publishing a half-finished install under a content-hash key would have every later run restore the broken tree, and an entry cannot be replaced.
Cached paths must resolve before the pod starts, because the volumes are decided then while the toolkit resolves paths inside it; a path that can only be resolved in the pod is refused at build time rather than silently doing nothing.
Pull request description
Checklist (choose whats happened)
Breaking changes
Changes
Fixes