This document explains the OADP rebase system for AI agents working in this repository.
OADP maintains downstream forks of the Velero backup/restore ecosystem for OpenShift. Each fork carries downstream-only patches on top of upstream releases. This repository automates the process of rebasing those forks onto new upstream versions while preserving all downstream patches.
The rebase process is orchestrated by rebasebot, a tool that cherry-picks downstream commits onto new upstream base tags. This repo provides the configuration, hook scripts, and CI automation around rebasebot.
versions/oadp-1.X.env (SSOT: upstream tags, SHAs)
│
├─→ rebase-configs/ (what to rebase, which hooks to run)
├─→ verify-tag-sha_*.sh (generated: supply chain verification)
└─→ docs/version-matrix.md (generated: reference tables)
run-oadp-rebase.sh
│
├─→ load_config() (sources versions file, then config file)
├─→ get_wave_repos() (returns repos for a branch + wave number)
└─→ rebasebot (container or CLI, runs hooks)
Each OADP release has a versions/oadp-1.X.env with upstream tags:
OADP_BRANCH="oadp-1.6"
VELERO_UPSTREAM_TAG="v1.18.2-rc.2"
VELERO_TAG_SHA="c253c7fe37d78c9b7e55c68544f7c5b2608712d8"
KOPIA_UPSTREAM_TAG="v0.22.3-velero-patch"
AWS_PLUGIN_TAG="v1.14.1"
GCP_PLUGIN_TAG="v1.14.1"
AZURE_PLUGIN_TAG="v1.14.1"
KUBEVIRT_PLUGIN_TAG="v0.9.0"Configs reference these via ${VELERO_UPSTREAM_TAG:?...} — the :? guard fails fast if the variable is missing.
rebase-configs/org_repo_branch.env.sh — shell scripts sourced by run-oadp-rebase.sh. They set:
SOURCE_UPSTREAM_REPO— upstream org/repo:tagDESTINATION_DOWNSTREAM_REPO— downstream org/repo:branchREBASE_REPO— working fork for PRsHOOK_SCRIPTS— post-rebase hooks to runSKIP_REPO— set to "true" to skip (e.g., restic)
Downstream-only repos (oadp-operator, openshift-velero-plugin, etc.) set source == dest as a hack to trigger hooks without rebasing.
rebasebot-hook-scripts/*.sh — run inside the rebasebot container after cherry-picking. Common hooks:
| Hook | Purpose |
|---|---|
go-replace_velero_oadp-1.X.sh |
Point go.mod at downstream velero fork |
go-replace_kopia_oadp-1.X.sh |
Point go.mod at downstream kopia fork |
go-mod-tidy-and-commit.sh |
Run go mod tidy + go vet (shared, not version-specific) |
restic-submodule-and-commit_oadp-1.X.sh |
Sync restic git submodule |
velero-submodule-and-commit_oadp-1.X.sh |
Sync velero git submodule (for must-gather) |
kopia-submodule-and-commit_oadp-1.X.sh |
Sync kopia git submodule (for must-gather) |
normalize-dockerfiles-and-commit.sh |
Strip Go patch versions in Dockerfiles (shared) |
verify-tag-sha_oadp-1.X.sh |
Generated — verify upstream tag wasn't recreated |
oadp-operator-copy-crds-from-velero-and-commit_oadp-1.X.sh |
Copy CRDs from velero fork |
go-use-tag_oadp-operator_oadp-1.X.sh |
Pin oadp-operator module to branch |
go-use-tag_oadp-non-admin_oadp-1.X.sh |
Pin oadp-non-admin module to branch |
Version-specific hooks differ only in their branch name variable. The go-replace_velero hooks for 1.3/1.4 omit the KCP workaround that 1.6 includes.
Repos must rebase in order because of dependency chains:
| Wave | Purpose | Examples |
|---|---|---|
| 1 | Independent deps | kopia, restic |
| 2 | Core | velero |
| 3 | Plugins + operator | velero-plugin-for-aws, oadp-operator |
| 4 | Downstream controllers | oadp-non-admin, openshift-velero-plugin |
| 5 | Final dependents | oadp-must-gather, oadp-cli |
Wave composition varies by OADP version — not all repos exist for all versions. See docs/version-matrix.md for the full matrix.
These files are generated from the SSOT and must never be edited by hand:
rebasebot-hook-scripts/verify-tag-sha_oadp-1.*.sh— generated bytools/generate-verify-tag-sha.shdocs/version-matrix.md— generated bytools/generate-version-matrix.sh
Run make generate to regenerate. Run make verify-generate to check they're up to date.
Edit versions/oadp-1.X.env, run make generate && make test, commit.
- Create
versions/oadp-1.X.env - Create hook scripts (copy nearest version, change branch name)
- Create config files referencing SSOT variables
- Add mappings in
get_config_name()and waves inget_wave_repos()inrun-oadp-rebase.sh make generate && make test
./run-oadp-rebase.sh -t velero-oadp-1.6 # loads config, prints details
./run-oadp-rebase.sh --dry-run --local-hooks \
--working-dir ~/workdir -s ~/.rebasebot/secrets \
velero-oadp-1.6 # full dry-run with rebasebotmake test # syntax-check + config-load + verify-hooks + verify-generate- Configs are shell scripts sourced in the context of
run-oadp-rebase.sh. They can use variables set by the versions file becauseload_config()sources the versions file first. - The Go tool (
tools/rebase-status/) also parses configs. ItsparseConfigFileToDatamerges versions file variables before expanding config variables. If the SSOT schema changes, updateregistry.gotoo. resolve-config.shis used by the auto-rebase pipeline independently ofrun-oadp-rebase.sh. It also sources the versions file before the config.- Remote vs local hooks: In container mode, hooks are fetched from git or mounted from
./rebasebot-hook-scripts/. They run inside the container with no access to the repo root — this is why verify-tag-sha hooks have the SHA baked in rather than reading from the versions file at runtime.