|
| 1 | +# Populating `OWNERS` and `OWNERS_ALIASES` |
| 2 | + |
| 3 | +This utility pulls `OWNERS` and `OWNERS_ALIASES` from upstream OpenShift repositories. |
| 4 | +Usage: |
| 5 | + |
| 6 | +```console |
| 7 | +$ go run main.go |
| 8 | +``` |
| 9 | + |
| 10 | +Or, equivalently, execute [`populate-owners.sh`](../../ci-operator/populate-owners.sh) from anywhere in this repository. |
| 11 | + |
| 12 | +Upstream repositories are calculated from `ci-operator/jobs/{organization}/{repository}`. |
| 13 | +For example, the presence of [`ci-operator/jobs/openshift/origin`](../../ci-operator/jobs/openshift/origin) inserts [openshift/origin][] as an upstream repository. |
| 14 | + |
| 15 | +The `HEAD` branch for each upstream repository is pulled to extract its `OWNERS` and `OWNERS_ALIASES`. |
| 16 | +If `OWNERS` is missing, the utility will ignore `OWNERS_ALIASES`, even if it is present upstream. |
| 17 | + |
| 18 | +Once all the upstream content has been fetched, the utility namespaces any colliding upstream aliases. |
| 19 | +Collisions only occur if multiple upstreams define the same alias with different member sets. |
| 20 | +When that happens, the utility replaces the upstream alias with a `{organization}-{repository}-{upstream-alias}`. |
| 21 | +For example, if [openshift/origin][] and [openshift/installer][] both defined an alias for `security` with different member sets, the utility would rename them to `openshift-origin-security` and `openshift-installer-security` respectively. |
| 22 | + |
| 23 | +After namespacing aliases, the utility writes `OWNERS_ALIASES` to the root of this repository. |
| 24 | +If no upstreams define aliases, then the utility removes `OWNER_ALIASES` from the root of this repository. |
| 25 | + |
| 26 | +The utility also iterates through the `ci-operator/jobs/{organization}/{repository}` directories, writing `OWNERS` to reflect the upstream configuration. |
| 27 | +If the upstream did not have an `OWNERS` file, the utility removes the associated `ci-operator/jobs/{organization}/{repository}/OWNERS`. |
| 28 | + |
| 29 | +[openshift/origin]: https://github.com/openshift/origin |
| 30 | +[openshift/installer]: https://github.com/openshift/installer |
0 commit comments