annotaterb icon indicating copy to clipboard operation
annotaterb copied to clipboard

Enable frozen mode when CI environment variable is set

Open ivangreene opened this issue 1 year ago • 2 comments

This would be a good enhancement that automatically enforces that annotations are up to date if people run db:migrate in a CI system!

The CI env var is set when running in a CI system: https://stackoverflow.com/a/64289573/7983959

Therefore, running db:migrate in a CI like Github Actions would cause a failure (good) when annotations are out of date

ivangreene avatar Dec 05 '24 18:12 ivangreene

Hi @ivangreene thanks for submitting a suggestion. I've seen a few variations for having annotations checked in CI that seem to work well, that do something along the lines of:

  • Run migrations OR run annotations
  • Check the exit code or output
    • If 0 then succeed
    • If not 0 then fail

I'm curious -- in your experience, would checks like this suffice? If not, I would love to learn more about your use case. There are so many different CI tools that I would want to come up with a general approach that works for most, if not all, CI systems.

drwl avatar Feb 17 '25 03:02 drwl

The solution we ultimately used was to simply run the annotaterb command on it's own in CI, with the --frozen flag

ivangreene avatar Feb 22 '25 00:02 ivangreene

I have down time, so I'm tidying up issues and PRs. This seems like it's been resolved so closing for now. Feel free to re-open this if I misunderstood.

drwl avatar May 30 '25 20:05 drwl