Hey Team
I'm having some issues with cache miss's in my mono repo.
I have a folder structure of:
- lib
|- lib1
|- lib2
- service
|- service1
|- service2
And a dagger module that will dynamically read the go.mod and pull in only the required libs for a particular service.
My intention is that when either service2 changes, only those tests are run, or if lib1 is updated, the tests for both service1 and service2 are run as lib1 is a dependency.
The issue I'm having, is that when only service2 is changed, dagger is running tests for all services. When I run this with a "simple" pipeline line as per this example repo: https://github.com/DMajrekar/dagger-cache-monorepo everything is working as expected.
In my more complex prod monorepo, it's not working and I guess I'm doing something differint.
Looking at the -vvvv output from my dagger module, I'm getting the following output:
https://github.com/DMajrekar/dagger-cache-monorepo/blob/main/log
There are some lines such as
✔ Container@xxh3:31fddde736af50f9.withDirectory(
directory: ✔ Directory.directory(path: "lib/db"): Directory! = xxh3:2262feec381368ba 0.0s
path: "/go/src/neo/lib/db"
): Container! = xxh3:2ab223e595c3bab8 0.0s
✔ Container@xxh3:8815f64604dfadb3.withDirectory(
directory: ✔ Directory.directory(path: "lib/instrumentation/"): Directory! = xxh3:aab975df517d8a29 0.0s
path: "/go/src/neo/lib/instrumentation/"
): Container! = xxh3:e2f15381f94e4f4d 0.0s
✔ load cache: copy /lib/instrumentation /go/src/neo/lib/instrumentation 0.0s
which makes me think that lib/instrumentation has been cached correctly, but lib/db has not been and triggering a cache miss
Am I on the right track with this thought, or do I need to keep building up my demo repo into a more accurate replication of my prod pipeline to see where I've made a mistake?