Post

My CI got a little out of hand

A look at how Meguruto's CI grew from build and tests to catalogue, destination, data-quality, browser, and image checks.

Meguruto started with the usual checks: does it build, and do the tests pass? That was enough for a while.

Then I started finding problems that had little to do with application code. A destination could point to a broken image. Travel data could be inconsistent. A page could render and still show information I wouldn’t want someone to plan a trip around. The TypeScript compiler couldn’t tell me whether any of that was okay.

So I added a check. Then another one. At some point I opened the GitHub Actions page and realised my CI had got a little out of hand.

It started normally

The first version was the familiar sequence: lint and type checks, tests, then a build. If those passed, I could review the pull request and merge it.

The original pipeline
  1. Pull request
  2. Lint / type checks
  3. Tests
  4. Build
  5. Ready to merge

It answered a useful, limited question: did the code pass the checks I had written? For a while, that was the question I needed answered.

At that point, most of the problems I expected to catch lived in the source code. I didn’t need a browser pass or an external image check to tell me whether a change was ready to merge.

The data became part of the product

The more I worked on Meguruto, the more the destination data felt like part of the application. The planner depends on it. If an entry is malformed or contradicts another one, the app can compile and still be wrong in a way a traveller will notice.

The same goes for values that are technically valid but suspicious. A travel time can be a number and still deserve a closer look. A page can load with an image URL that no longer works. A catalogue change can affect a destination somewhere else. A bilingual product can drift between its English and Japanese content.

Those problems need checks that understand more than the type of a field. Catalogue Integrity and Destination Checks cover parts of that job. I also added deterministic data-quality validation.

The data checks run against content in the repository, so their results should be repeatable and traceable to a change. Image checks ask an outside server for an answer, and the same change can get a different response later. That difference matters when CI fails. A data result can point me to a problem I can fix. An image result may only mean the provider is temporarily unavailable.

That has changed how I review destination changes. One edited record can affect another page, so checking only the record I touched is not enough. Catalogue and destination checks give CI a chance to catch that wider problem before I open pages and look around by hand.

npm test was no longer enough to tell me whether Meguruto was okay. The tests could pass while the information around them was stale, inconsistent, or difficult to trust.

The checks spread

By this point, the pipeline had started covering much more than code. Here’s roughly what it checks:

The current pipeline
Pull request
  • Code checks
  • Browser tests
  • Meguruto data
  • Image checks
Required checks pass?
YesMergeDeploy
Fix

Each check has a narrower job. The build tells me the project can be built. End-to-end checks exercise the app in a browser. The data checks look for problems in the catalogue and destinations. The image checks look beyond the repository, at URLs the project depends on.

That separation helps when something fails. A broken build points me toward code. A catalogue error points me toward data. A failed request to an image provider needs a different response again. There are more checks now, but when something fails I usually know where to look.

External checks made things weird

Image monitoring is where a simple pass-or-fail rule stopped working. The naive version is easy to describe: an HTTP 200 means the image is good; anything else means it’s broken.

But an image host can rate-limit a request. Wikimedia can return a 429. A runner can also lose its network connection for a moment. None of those responses proves that the image URL is permanently broken.

The monitor now needs to distinguish three outcomes: verified, broken, and inconclusive. If a provider asks us to slow down, the check observes a cooldown instead of immediately treating every affected image as broken. An inconclusive result can be tried again later.

That distinction matters to the result CI reports. I don’t want a temporary problem reaching an external service to look like a data error in Meguruto. The image may be fine, and the check may simply be unable to confirm it at that moment.

Not every check should block a pull request

Deciding which results are allowed to say “no” took more thought.

A failed build, a test failure, an invalid catalogue entry, or a repeatable data-quality error should stop a merge. Those checks can point to a problem in the change itself, and I can fix it before the change goes out.

If the image monitor gets a rate limit or a network error, it hasn’t shown that my change broke an image. Treating every inconclusive response as a failure would make the pipeline less useful. Those results should be reported as inconclusive and retried.

A check should only block a PR when it actually knows something is wrong.

I still add a check when I find something I don’t want to remember to verify by hand again. I have a feeling I’m not done adding them yet.