|
| 1 | +# Repository structure |
| 2 | + |
| 3 | +The bootc-dev organization contains a number of repositories. While not every |
| 4 | +repository will function in exactly in the same way, there are |
| 5 | +"baseline" configuration and procedures that should generally apply. |
| 6 | + |
| 7 | +## Maintainers |
| 8 | + |
| 9 | +There should be a `maintainers` team with the **Maintain** permission |
| 10 | +that is used by repositories by default. |
| 11 | + |
| 12 | +## Renovate |
| 13 | + |
| 14 | +The organization uses a centralized Renovate configuration managed from this |
| 15 | +repository. To enable Renovate on a new repository, create a `renovate.json` |
| 16 | +file in the repository root: |
| 17 | + |
| 18 | +```json |
| 19 | +{ |
| 20 | + "$schema": "https://docs.renovatebot.com/renovate-schema.json", |
| 21 | + "extends": [ |
| 22 | + "local>bootc-dev/infra:renovate-shared-config.json" |
| 23 | + ] |
| 24 | +} |
| 25 | +``` |
| 26 | + |
| 27 | +## PR gating and merging |
| 28 | + |
| 29 | +Each repository MUST enable the following settings via a branch protection rule for `main`: |
| 30 | + |
| 31 | +- Require a pull request before merging |
| 32 | +- Require approvals |
| 33 | + |
| 34 | +### required-checks |
| 35 | + |
| 36 | +Having some kind of CI is also required. Repositories SHOULD enable the automatic merge setting, |
| 37 | +and configure at least one gating CI check. |
| 38 | + |
| 39 | +The ["required-checks" pattern](https://github.com/bootc-dev/bootc/blob/main/.github/workflows/ci.yml) |
| 40 | +is where the repository configuration gates solely on that check which in turn gates on others, allowing easy dynamic |
| 41 | +reconfiguration of the required checks without requiring administrator intervention. |
| 42 | + |
| 43 | +## Language |
| 44 | + |
| 45 | +In this organization, Rust is preferred. |
| 46 | + |
| 47 | +## Developer experience |
| 48 | + |
| 49 | +Repositories SHOULD have a [Justfile](https://just.systems/) which acts as a development entry point. It |
| 50 | +is strongly encouraged to follow the pattern in [bootc Justfile](https://github.com/bootc-dev/bootc/blob/main/Justfile) |
| 51 | +where e.g. GitHub Actions mostly invoke `just <x>` so all CI flows are easily |
| 52 | +replicable outside of GHA. |
| 53 | + |
| 54 | +## Devcontainer |
| 55 | + |
| 56 | +Repositories SHOULD have a `.devcontainer.json` (one is synchronized by default from this repo) |
| 57 | +and key targets in the `Justfile` should run in that environment. |
| 58 | + |
| 59 | +## Unit and integration tests |
| 60 | + |
| 61 | +Any nontrivial code SHOULD have unit tests and integration tests. An integration test MUST |
| 62 | +be a separately built artifact that tests a production build in a "black box" fashion. |
| 63 | + |
| 64 | +### Integration test environments |
| 65 | + |
| 66 | +Integration tests SHOULD be flexible and adaptable. In particular, there are multiple |
| 67 | +"test suite runner environments" which our integration tests should work with. |
| 68 | + |
| 69 | +- [Debian autopkgtest](https://wiki.debian.org/autopkgtest) |
| 70 | +- [tmt](https://tmt.readthedocs.io/en/stable/) (and [Fedora CI](https://packit.dev/fedora-ci/)) |
| 71 | + |
| 72 | +Privileged and destructive tests should be clearly distinct. |
| 73 | + |
| 74 | +At the current time, bootc has some "bridging" between a custom integration test suite |
| 75 | +and tmt. However, a pattern used in other repositories is to have an integration test |
| 76 | +binary written in Rust that uses `libtest-mimic` - in this pattern all tests are just |
| 77 | +part of a simple single binary. |
| 78 | + |
| 79 | +- [composefs-rs](https://github.com/composefs/composefs-rs/tree/main/crates/integration-tests) |
| 80 | +- [bcvk](https://github.com/bootc-dev/bcvk/blob/main/Justfile) |
| 81 | + |
| 82 | +### Future direction |
| 83 | + |
| 84 | +Goal: Convert all repositories to a pattern like this, and create reliable bridging |
| 85 | +between it and tmt and Debian autopkgtest. For example, support converting |
| 86 | +the tests into the relevant framework format. |
0 commit comments