This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository holds OpenShift cluster manifests, component build manifests and CI workflow configuration for OpenShift component repositories for both OKD and OCP.
ci-operator/config/- CI configuration files defining builds and tests for component repositoriesci-operator/jobs/- Generated Prow job configurations (auto-generated, rarely edited manually)ci-operator/step-registry/- Reusable test steps, chains, and workflows for multi-stage jobsci-operator/templates/- Legacy black-box test workflows (deprecated, use step-registry instead)core-services/- Core service configurations applied to api.ci clusterservices/- Additional service configurationscluster/- Legacy cluster provisioning manifestsprojects/- Experimental, legacy, or non-critical service manifeststools/- Container image build manifests for tooling
This repository includes custom slash commands to improve productivity:
Search the step-registry (4,400+ reusable CI components) to find existing steps, workflows, and chains before creating new ones:
/step-finder aws upgrade workflow # Find AWS upgrade workflows
/step-finder install operator step yes # Find operator installation steps with usage examplesAlways use /step-finder before creating new step-registry components to avoid duplication.
See .claude/SLASH_COMMANDS.md for detailed documentation.
After modifying CI configuration files, regenerate downstream artifacts:
make updateThis runs: make jobs, make ci-operator-config, make prow-config, make registry-metadata, make release-controllers, make boskos-config
When modifying CI jobs in ci-operator/config/:
make updateThis validates config, generates Prow job configs, and sanitizes job definitions.
make check # Validate all service configs
make check-core # Validate core-services
make check-services # Validate services
make checkconfig # Validate Prow configurationmake new-repoInteractive tool to configure CI workflow for a new component repository. Automatically runs make update afterwards.
make validate-step-registryValidates step registry definitions for correctness.
make release-controllersRegenerates release controller configurations.
- Developers edit YAML files in
ci-operator/config/<org>/<repo>/ - Each config file defines:
build_root: Base image for buildsimages: Container images to buildtests: Test definitions (can reference step-registry workflows)promotion: Where to push successful buildsreleases: OpenShift releases to test against
- Running
make updategenerates Prow job configs inci-operator/jobs/ - Prow triggers jobs based on PR/merge/periodic events
- Jobs execute ci-operator with the config, which orchestrates builds and tests
The step-registry contains reusable CI components:
- Steps (
.yaml+-commands.sh): Atomic tasks (e.g.,openshift-e2e-test) - Chains (
-chain.yaml): Ordered sequences of steps - Workflows (
-workflow.yaml): Complete test scenarios with pre/test/post phases - References (
-ref.yaml): Step definitions with metadata
Steps are referenced in ci-operator/config/ test definitions using multi-stage syntax. The registry allows sharing common operations (cluster provisioning, testing, cleanup) across many repositories.
ci-operator/config/is the source of truth (manually edited)ci-operator-prowgengeneratesci-operator/jobs/from config filesdeterminize-ci-operatornormalizes config file formattingdeterminize-prow-confignormalizes Prow configuration- All generation uses containerized tools (pulled from quay.io/openshift/ci-public)
ci-operator/config/:<org>-<repo>-<branch>.yamlci-operator/config/:<org>-<repo>-<branch>__periodics.yaml(variant periodic config)ci-operator/jobs/:<org>-<repo>-<org>-<repo>-<branch>-<jobtype>.yamlstep-registry/: Component name prefixed (e.g.,openshift-e2e-test-ref.yaml)core-services/:admin_*.yamlfor admin resources,_*.yamlexcluded from application
Periodic tests can be separated from main configuration into dedicated __periodics.yaml files:
- Maintains release specific periodic configuration that is consumable by CI analytical tooling
- Example:
openshift-cluster-authentication-operator-release-4.21__periodics.yaml - Contains only periodic tests with
interval:orcron:scheduling zz_generated_metadatacontains data extracted from the__periodics.yamlconfiguration duringmake update- Generated jobs go to separate
-periodics.yamlfiles inci-operator/jobs/
- Edit config in
ci-operator/config/<org>/<repo>/ - Run
make updateto generatezz_generated_metadataand Prow jobs - Run
make checkconfigto validate - Commit both config and generated job files
- Create files in
ci-operator/step-registry/<component>/:<name>-ref.yaml(step metadata)<name>-commands.sh(script to execute)
- Run
make registry-metadatato update metadata - Reference the step in workflow chains or directly in configs
- Define individual steps if needed
- Create a workflow file:
<name>-workflow.yaml - Define
pre,test, andpostphases using existing steps/chains - Run
make validate-step-registryto check correctness
CI analytical tooling requires release specific configuration. Branch fast-forwarding from main to the active release duplicates configuration and job execution for periodics defined in the default configuration. For jobs producing test data that will be processed by CI analytical tooling, periodic jobs should be configured separately from the main config:
- Create
ci-operator/config/<org>/<repo>/<org>-<repo>-<branch>__periodics.yaml - Include
base_images,build_root,images,promotion,releasessections (copy from main config) - Add only
tests:entries withinterval:orcron:(periodic scheduling) - Run
make updateto generate Prow jobs in separate-periodics.yamlfile - This pattern creates release specific config that produces data consumable by CI analysis tooling
OpenShift uses semantic versioning with minor releases (4.18, 4.19, 4.20, 4.21, 4.22, etc.):
- Branch names:
release-4.21,release-4.20, etc. (ormain/master) - Config files: One per branch per repository (e.g.,
openshift-oauth-server-release-4.21.yaml) - CI Analysis: Release specific configurations are necessary for CI analytical tooling
The config-brancher tool automates creating CI configs for new releases:
# Example from recent commits
config-brancher --config-dir ./ci-operator/config --current-release 4.21 --future-release 4.22 --confirmThe source content for config-brancher is always the current development branch, such as master/main. The --current-release 4.21 flag tells the tool "main development branch currently targets 4.21". It means the tool takes the content from the main config (assumed to be managed by humans) and copies it to the release-4.21 config (assumed to not be maintained by humans at this time because there is also an assumption that the release git branch is being fast-forwarded from the main branch content). The --future-release 4.22 param tells it to also maintain an additional config for another future branch. The tool makes sure the versions in the copied configs are modified appropriately.
Use --skip-periodics to avoid branching periodic jobs (they're often managed separately in __periodics.yaml files).
Repos not relying on release specific CI analysis typically only have periodics set up for master and only want to run jobs for master code. The code in both managed release branches is identical so there is no point in having copies of these periodics; they build and test the same code. That's why --skip-periodics exists.
When teams rely on release specific CI analysis then they should only exist in release specific __periodics.yaml CI configurations so the data they produce is tied to a specific release. In this case we do not want the jobs to run against the main or master configurations and we cannot put them in the default release branch CI configurations because that's owned by config-brancher enforcing that the release branch config is derived from main config.
If Python scripts fail (e.g., generate-release-controllers.py), set up a virtual environment:
python3 -m venv venv/ # First time only
source venv/bin/activate
python3 -m pip install pyyaml
# Run your Python commands...
deactivate # When doneBy default, podman is used. Override with:
export CONTAINER_ENGINE=dockerCustom slash commands in .claude/commands/ must include frontmatter:
---
description: Brief description of what the command does
args: "[arg1] [arg2]"
allowed-tools: Read, Edit, Bash(make release-controllers), AskUserQuestion
---- Never manually edit files in
ci-operator/jobs/- always editci-operator/config/and regenerate - New test workflows should use step-registry, not templates (templates are legacy)
- Core services config in
core-services/is auto-applied by Prow postsubmit after merge - ConfigMaps are updated by the
config-updaterProw plugin - The repository uses containerized tooling for most operations (check Makefile for specific images)
- Config files are deterministically formatted - manual formatting will be overwritten by generation tools
- Metadata like
zz_generated_metadatais created bymake updateand should not be manually edited