From oadp-rebase
Complete reference for all post-rebase hook scripts used in OADP rebases
How this skill is triggered — by the user, by Claude, or both
Slash command
/oadp-rebase:hook-scriptsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill documents every post-rebase hook script, what it does, when it's used, and how to debug failures.
This skill documents every post-rebase hook script, what it does, when it's used, and how to debug failures.
Hook scripts are shell scripts stored in the rebasebot-hook-scripts/ directory of the oadp-rebase repository. They are referenced in config files via git: URLs:
git:https://github.com/oadp-rebasebot/oadp-rebase/oadp-dev:rebasebot-hook-scripts/{script-name}.sh
When rebasebot runs, it:
git: URLUPSTREAM: <drop> prefix)REBASEBOT_SOURCE: The source repo URL (e.g., https://github.com/velero-io/velero:v1.18.1-rc.1)GIT_USERNAME: Git committer nameGIT_EMAIL: Git committer emailPurpose: Adds a go.mod replace directive pointing the upstream velero module to github.com/openshift/velero at the downstream branch.
Used by: All repos that import velero (plugins, oadp-operator, non-admin, etc.)
What it does:
go.mod for either github.com/vmware-tanzu/velero or github.com/velero-io/velero in require blocksgo mod edit -replace {detected-module}=github.com/openshift/velero@{branch}vmware-tanzu replace if the project now uses velero-io)UPSTREAM: <drop>: ...Branch-specific: Each OADP branch has its own script (e.g., go-replace_velero_oadp-1.6.sh)
Important: The script NEVER hardcodes the module path. The upstream Velero project moved from vmware-tanzu to velero-io on GitHub, but the Go module path (module line in go.mod) may still be github.com/vmware-tanzu/velero. These are two independent identifiers. The replace directive must match the require path, not the GitHub URL.
Debugging: If this fails, the downstream velero branch may not exist yet (wave ordering issue).
Purpose: Adds a go.mod replace directive pointing github.com/kopia/kopia to github.com/migtools/kopia at the downstream branch.
Used by: Velero (which imports kopia for backup operations)
What it does:
go mod edit -replace github.com/kopia/kopia=github.com/migtools/kopia@{branch}Debugging: If this fails, the downstream kopia branch may not exist yet (must rebase kopia in Wave 1 first).
Purpose: Runs go mod tidy and optionally go mod vendor to resolve dependencies after replace directives are applied.
Used by: Almost all repos
What it does:
go mod tidyvendor/ directory exists, runs go mod vendorUPSTREAM: <drop>: ...Debugging:
go mod tidy fails, check that all replace targets exist and are accessiblePurpose: Normalizes Dockerfile formatting to ensure consistency.
Used by: Almost all repos
What it does:
UPSTREAM: <drop>: ...Purpose: Updates the restic git submodule reference in the velero repo.
Used by: Velero only
What it does:
Prerequisite: Restic must be rebased first (Wave 1).
Purpose: Fixes filenames with special characters that can cause issues on some platforms.
Used by: Velero (some upstream test fixtures have special characters in filenames)
What it does:
Purpose: Copies CRD YAML files from the downstream velero repo into the oadp-operator repo.
Used by: oadp-operator only
What it does:
config/crd/ to oadp-operator's expected locationPrerequisite: Velero must be rebased and the velero PR must be merged first (Wave 2 before Wave 3).
Purpose: Runs make bundle in the oadp-operator repo to regenerate the OLM bundle.
Used by: oadp-operator only
What it does:
make bundle which regenerates CSV, CRDs, and other OLM artifactsDebugging: Requires operator-sdk and other build tools. May fail if CRDs are stale (run CRD copy hook first).
The order of hooks matters. The typical order is:
fix-malformed-filenames-and-commit.sh (if needed - velero only)go-replace_kopia_{branch}.sh (if needed - velero only)go-replace_velero_{branch}.sh (if the repo imports velero)go-mod-tidy-and-commit.sh (always after replace hooks)restic-submodule-and-commit_{branch}.sh (velero only, after tidy)oadp-operator-copy-crds-from-velero-and-commit_{branch}.sh (oadp-operator only)oadp-operator-run-make-bundle-and-commit.sh (oadp-operator only, after CRD copy)normalize-dockerfiles-and-commit.sh (always last)When you need to run hooks outside of rebasebot (e.g., for manual intervention):
# Set required environment variables
export REBASEBOT_SOURCE="https://github.com/{upstream-org}/{repo}:{tag}"
export GIT_USERNAME="oadp-team-rebase-bot"
export GIT_EMAIL="[email protected]"
git config user.name "$GIT_USERNAME"
git config user.email "$GIT_EMAIL"
# Get hook scripts
# Option 1: Clone from remote
git clone -b oadp-dev https://github.com/oadp-rebasebot/oadp-rebase.git /tmp/hooks
HOOKS=/tmp/hooks/rebasebot-hook-scripts
# Option 2: Use local copy from oadp-rebase repo
HOOKS=/path/to/oadp-rebase/rebasebot-hook-scripts
# Run hooks in order
bash $HOOKS/{hook1}.sh
bash $HOOKS/{hook2}.sh
# etc.
| Repository | go-replace velero | go-replace kopia | go-mod-tidy | restic-submodule | fix-filenames | CRD copy | make bundle | normalize-dockerfiles |
|---|---|---|---|---|---|---|---|---|
| kopia | Y | Y | ||||||
| velero | Y | Y | Y | Y | Y | Y | ||
| velero-plugin-for-aws | Y | Y | Y | |||||
| velero-plugin-for-gcp | Y | Y | Y | |||||
| velero-plugin-for-azure | Y | Y | Y | |||||
| velero-plugin-for-legacy-aws | Y | Y | Y | |||||
| kubevirt-velero-plugin | Y | Y | Y | |||||
| oadp-operator | Y | Y | Y | Y | Y | |||
| oadp-non-admin | Y | Y | Y | |||||
| openshift-velero-plugin | Y | Y | Y |
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub migtools/oadp-rebase-ai-helpers --plugin oadp-rebase