|
2 | 2 |
|
3 | 3 | CI tooling and hacks to improve CI |
4 | 4 |
|
| 5 | +## Tools |
| 6 | + |
| 7 | +| Tool | Description | |
| 8 | +|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 9 | +| [prowgen](cmd/prowgen) | Generates OpenShift CI (Prow) configurations from repository config YAML files. Clones repos, parses Makefiles, and creates presubmit/periodic test jobs for `openshift/release`. Used by the [release-generate-ci](#ci-workflows) workflow. | |
| 10 | +| [prowcopy](cmd/prowcopy) | Copies and adapts Prow CI configuration from one branch to another in `openshift/release`. Useful when cutting new release branches. | |
| 11 | +| [discover](cmd/discover) | Discovers new release branches across repositories and updates config files automatically. Also manages Konflux resources for unsupported versions. Used by the [release-discover-branches](#ci-workflows) workflow. | |
| 12 | +| [generate](cmd/generate) | Generates Dockerfiles and build artifacts from project metadata. Supports regular, must-gather, test, and source image Dockerfiles. | |
| 13 | +| [generate-ci-action](cmd/generate-ci-action) | Generates GitHub Actions CI workflow files by populating a template with steps for each configured repository. | |
| 14 | +| [konflux-apply](cmd/konflux-apply) | Applies Konflux manifests (applications, components, ...) to a Konflux instance. See its [README](cmd/konflux-apply/README.md) for service account setup. Used by the [apply-konflux-manifests](#ci-workflows) workflow. | |
| 15 | +| [konflux-gen](cmd/konflux-gen) | Generates Konflux application and component manifests from `openshift/release` CI configs. See its [README](cmd/konflux-gen/README.md) for usage. | |
| 16 | +| [konflux-release-gen](cmd/konflux-release-gen) | Generates Konflux release CRs (ReleasePlans, ReleasePlanAdmissions) for Serverless Operator releases. Used by the [generate-release-crs](#ci-workflows) workflow. | |
| 17 | +| [sobranch](cmd/sobranch) | Maps upstream Knative version numbers to Serverless Operator release branch names (e.g. `1.11` → `release-1.32`). | |
| 18 | +| [sorhel](cmd/sorhel) | Maps Serverless Operator versions to compatible RHEL versions. | |
| 19 | +| [testselect](cmd/testselect) | Determines which test suites to run based on changed files in a PR, using regex patterns from a testsuites YAML config. | |
| 20 | + |
| 21 | +## CI Workflows |
| 22 | + |
| 23 | +GitHub Actions workflows in [`.github/workflows/`](.github/workflows/): |
| 24 | + |
| 25 | +| Workflow | Trigger | Description | |
| 26 | +|----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 27 | +| [apply-konflux-manifests](.github/workflows/apply-konflux-manifests.yaml) | Daily (06:00 UTC), push to `.konflux/**`, manual | Applies Konflux manifests from all repos (configured in [./config](./config) to the Konflux cluster using the `konflux-apply` tool. | |
| 28 | +| [generate-release-crs](.github/workflows/generate-release-crs.yaml) | Manual | Generates Konflux release CRs using `konflux-release-gen`, applies override snapshots, and creates PRs in hack repos containing the component and FBC release CRs. Merging those PRs will trigger a Konflux release pipeline. <br /> ⚠️ It is important to merge the component PR first and let the release pipeline succeed before merging the FBC release PR, as the FBC references the components and thus needs them to be released first. | |
| 29 | +| [release-discover-branches](.github/workflows/release-discover-branches.yaml) | Daily (05:00 UTC), push to main, PRs, manual | Runs `discover` to find new release branches and creates a PR to update the [configs](./config) with the new branches. | |
| 30 | +| [release-generate-ci](.github/workflows/release-generate-ci.yaml) | Weekly (Monday 06:00 UTC), push to main, PRs, manual | Generates CI configurations for all tracked repositories using `prowgen`, updates dependabot and OWNERS files, updates the Konflux pipelines and creates sync PRs. | |
| 31 | + |
5 | 32 | ## Generate openshift/release config |
6 | 33 |
|
7 | 34 | - Add configuration for your repository in `config/<file.yaml>` |
@@ -33,17 +60,41 @@ This generation works this way: |
33 | 60 | - There are also CI job config generated, which use the tests above. |
34 | 61 | - If the matching regex is specified in `onDemand` field, then the presubmit is marked as |
35 | 62 | optional (`always_run: false`). |
36 | | -- Individual OpenShift versions can specify `generateCustomConfigs: true`. |
| 63 | +- Individual OpenShift versions can enable custom configurations via `customConfigs`: |
| 64 | + ```yaml |
| 65 | + customConfigs: |
| 66 | + enabled: true |
| 67 | + includes: |
| 68 | + - ".*ocp-4.22-lp-interop.*" |
| 69 | + excludes: |
| 70 | + - ".*some-pattern.*" |
| 71 | + ``` |
37 | 72 | The repository configuration should then list custom configurations under `customConfigs`. |
38 | 73 | The `releaseBuildConfiguration` key should include at least `tests` key |
39 | 74 | with the list of tests to be run. For custom configurations, tests are not generated from Makefile |
40 | 75 | targets but rather taken directly from the configuration. The resulting build configuration is |
41 | | - then |
42 | | - enriched with images, base images, and dependencies for test steps. |
| 76 | + then enriched with images, base images, and dependencies for test steps. |
| 77 | + |
| 78 | +- Periodic jobs can be disabled per test or per OpenShift version using `skipCron: true`: |
| 79 | + ```yaml |
| 80 | + # Per test: |
| 81 | + e2eTests: |
| 82 | + - match: "^test-e2e$" |
| 83 | + skipCron: true |
| 84 | +
|
| 85 | + # Per OpenShift version: |
| 86 | + openShiftVersions: |
| 87 | + - version: "4.22" |
| 88 | + skipCron: true |
| 89 | + ``` |
43 | 90 |
|
44 | | -Limitations: |
| 91 | +### Additional Makefile targets |
45 | 92 |
|
46 | | -- It is not currently possible to disable periodics per job |
| 93 | +- `make discover-branches` — Run `discover` to detect new release branches and update configs automatically. |
| 94 | +- `make generate-ci-action` — Regenerate the `.github/workflows/release-generate-ci.yaml` workflow from the template. |
| 95 | +- `make generate-konflux-release` — Generate Konflux release CRs using `konflux-release-gen`. |
| 96 | +- `make konflux-update-pipelines` — Pull latest Konflux Tekton pipeline bundles and rebuild local pipeline YAMLs via kustomize. |
| 97 | +- `make test-select` — Run `testselect` to determine which tests to run. Requires `TESTSUITES` and `CLONEREFS` variables. |
47 | 98 |
|
48 | 99 | ## Apply Konflux configurations |
49 | 100 |
|
@@ -77,9 +128,9 @@ SO branch follows the product versioning, while midstream branches follows the u |
77 | 128 | To make the "clone associated SO branch" easier, you can run the `sobranch` tool as follows: |
78 | 129 |
|
79 | 130 | ```shell |
80 | | -GO111MODULE=off go get -u github.com/openshift-knative/hack/cmd/sobranch |
| 131 | +go install github.com/openshift-knative/hack/cmd/sobranch@latest |
81 | 132 |
|
82 | | -so_branch=$( $(go env GOPATH)/bin/sobranch --upstream-version "release-1.11") # or "release-v1.11" or "release-1.11" or "v1.11" or "1.11" |
| 133 | +so_branch=$(sobranch --upstream-version "release-1.11") # or "release-v1.11" or "release-1.11" or "v1.11" or "1.11" |
83 | 134 |
|
84 | 135 | git clone --branch $so_branch git@github.com:openshift-knative/serverless-operator.git |
85 | 136 | ``` |
|
0 commit comments