CI Issue

In most CI setups a build process is triggered on push to a PR (or a given pattern for the name of the branch).

To avoid having to fetch everything anew it it common to cache succesful runs of the main branch and use that at the start of each CI run.

This works fine as long as the PR is ahead of main. However in active teams (or in a monorepo with many teams) it is easy to get behind. This can cause odd effects. Typically this presents as errors that exist on CI that don’t exist locally and vanish when the branch is updated.

One solution would to cache per branch but initialise the cache to the main.

Another posibility is to datestamp the main cache and only use the most recent one older than the current branch.

Both of these require careful cache management.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s