Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Project Overview

Operator-index repository contains Advanced Cluster Security (ACS) operator File-based catalog (FBC). FBC is a Operator Lifecycle Manager (OLM) format for operator bundles.

## Key Commands
- `make clean && make valid-catalogs` - Generate catalog-csv-metadata/rhacs-operator/catalog.json and catalog-bundle-object/rhacs-operator/catalog.json files
- `./scripts/get-built-images.sh <short_commit> <branch>` - Get list of build images on Konflux for each OCP version
- `./scripts/generate-releases.sh staging|prod` - Generate release file in the release-history folder.
- `./scripts/monitor-release.sh <short_commit>` - Monitors release status on Konflux for the provided commit.

## Important Notes
- Never read or edit catalog-csv-metadata/rhacs-operator/catalog.json and catalog-bundle-object/rhacs-operator/catalog.json files.
13 changes: 13 additions & 0 deletions .claude/commands/add-bundle-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Add a new version of ACS bundle to the `catalog-template.yaml` file: $ARGUMENTS.

Do the following changes in the `catalog-template.yaml` file using version and bundle image provided via $ARGUMENTS:

1. Add bundle image. Add a new `olm.bundle` entity using the provided operator image. Insert a comment with provided version. Keep `olm.bundle` entities sorted by version.
2. Find `stable` channel. Add a new item into its `entries` list but keep entries sorted by version. Update next version's `replaces` with the new version if next version exists.
3. Add entry to the next version's channel(s) if next version(s) exists.
4. Add channel with entries for the new version if it doesn't exist yet. It should contain all previous versions of the major version.
5. Run `make clean && make valid-catalogs` command.
6. Open a PR with with "Add <version> version" title.

There are `olm.channel` (channel) items in the file. Channels are named with pattern "rhacs-<version_major>.<version_minor>".
Also remember to use the GitHub CLI (`gh`) for all GitHub-related tasks.
17 changes: 17 additions & 0 deletions .claude/commands/test-and-prepare-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Add a new Konflux release and to the release-history folder and test it on stage environment for version: $ARGUMENTS.

Read version from $ARGUMENTS and do the following:

1. Check that version in a foramt X.Y.Z is passed via $ARGUMENTS.
2. Run `oc project` command and validate that the output has `rh-acs-tenant` and `stone-prd-rh01.pg1f.p1.openshiftapps.com`. Otherwise stop and tell user to login to Konflux cluster using `oc login --web https://api.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443/` and then try again.
3. Run `git checkout master && git pull`
4. Run `./scripts/generate-releases.sh prod` command. It will generate a new production release for the version.
5. Create a branch with pattern "add-<version>-release".
6. Add newly generated production release and open a draft PR with title "Add <version> release". Remember the PR number.
7. Switch back to master branch by `git checkout master`.
8. Run `./scripts/generate-releases.sh staging` and remember the current commit. It will be used later.
9. Deploy the newly generated stage release to the cluster `oc create -f release-history/<name-of-the-new-stage-release-file>`
10. Run the `kubectl -n rh-acs-tenant get releases.appstudio.redhat.com -l pac.test.appstudio.openshift.io/sha="<stage_release_commit>"` command on background every 30 seconds until all releases have "Succeeded" in "RELEASE STATUS". If any release has "Failed" status stop the background task and tell user to follow the `Restarting Konflux Release` steps from README.md.
11. If All releases "Succeeded" from the previous step then add a comment to the "Add <version> release" PR from the previous step that staging release succeeded.

Also remember to use the GitHub CLI (`gh`) for all GitHub-related tasks.
25 changes: 25 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"permissions": {
"allow": [
"Bash(make:*)",
"Bash(git checkout:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push:*)",
"Bash(git pull:*)",
"Bash(gh pr create:*)",
"Bash(oc project:*)",
"Bash(./scripts/generate-releases.sh:*)",
"Bash(./scripts/monitor-release.sh:*)",
"Bash(kubectl -n rh-acs-tenant get releases.appstudio.redhat.com:*)",
"Edit(catalog-template.yaml)"
],
"deny": [
"Edit(catalog-bundle-object/rhacs-operator/catalog.json)",
"Edit(catalog-csv-metadata/rhacs-operator/catalog.json)",
"Bash(rm:*)",
"Bash(sudo:*)"
],
"ask": []
}
}
3 changes: 0 additions & 3 deletions scripts/generate-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ generate_release_resources() {
snapshot: ${snapshot_copy}"

done <<< "$snapshots_data" > "${out_file}"

echo "Staging the file for commit..."
git add --verbose "${out_file}"
}

usage "$@"
Expand Down