I am currently seeking a solution to run sanity tests on my GitLab repos architecture. There are more than 20 repos in a GitLab group.
My idea is to create a "Health Check Repo" (HCR) that would do several health checks on all these repos. For example:
- verify that for all the branches whose names respect "branch_v[num_v_maj].[num_v_min].X", the last commit on this branch is associated to a tag with a name respecting "v[num_v_maj].[num_v_min].[num_v_patch]"
- verify all the tags follow a proper format.
- ...
The list will grow to include checks less "git-oriented": check the presence of a README.md, check if users have correct rights, ...
By running these checks, the idea is to avoid the repos to get dirty over time.
For now, I can think of 2 different ways to do this:
- Deploy HCR on a server and for each check, run a script via a cron.
- Use the CI we use in my company (GitLab CI) inside the HCR program and run the CI on a regular basis. This CI would retrieve the code from other repos from its group and run the scripts on them. The CI would be scheduled to run every X.
What is the best way to do this? Is there a better way I have not mentioned?
There are hooks to avoid pushing wrong tags etc., but not everything can be checked with hooks.
I could also create a CI per repo (ie >20 CIs), but on every change, it would quite painful to update. We already have a CI per repo, running unit tests, documentation builds, but these don't change that often.