From f9dda2ef5332afb182ffb1966db573572b07b669 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurlov Date: Thu, 6 Nov 2025 18:33:51 +0100 Subject: [PATCH 1/3] Add test-and-prepare-release and add-bundle-version claude commands --- .claude/CLAUDE.md | 12 ++++++++++ .claude/commands/add-bundle-version.md | 13 +++++++++++ .claude/commands/test-and-prepare-release.md | 17 ++++++++++++++ .claude/settings.json | 24 ++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 .claude/CLAUDE.md create mode 100644 .claude/commands/add-bundle-version.md create mode 100644 .claude/commands/test-and-prepare-release.md create mode 100644 .claude/settings.json diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 0000000..4cce575 --- /dev/null +++ b/.claude/CLAUDE.md @@ -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 ` - 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 ` - 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. diff --git a/.claude/commands/add-bundle-version.md b/.claude/commands/add-bundle-version.md new file mode 100644 index 0000000..7dfb706 --- /dev/null +++ b/.claude/commands/add-bundle-version.md @@ -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" title. + +There are `olm.channel` (channel) items in the file. Channels are named with pattern "rhacs-.". +Also remember to use the GitHub CLI (`gh`) for all GitHub-related tasks. \ No newline at end of file diff --git a/.claude/commands/test-and-prepare-release.md b/.claude/commands/test-and-prepare-release.md new file mode 100644 index 0000000..d41c937 --- /dev/null +++ b/.claude/commands/test-and-prepare-release.md @@ -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--release". +6. Add newly generated production release and open a draft PR with title "Add release". Remember the PR number. +7. Switch back to master branch by `git checkout master`. +8. Run `./scripts/generate-releases.sh staging` and remember a current commit. It will be used later. +9. Deploy the newly generated stage release to the cluster `oc create -f release-history/` +10. Monitor the release progress with `./scripts/monitor-release.sh ` command on background. Explicitly tell user that this command is running on background and tell how to check it. Stop when all releases has "Succeeded" status or if any is in "Failed" status. If any release "Failed" stop monitoring and tell the 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 release" PR from the previous step that staging release successed + +Also remember to use the GitHub CLI (`gh`) for all GitHub-related tasks. \ No newline at end of file diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..3a85ee3 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,24 @@ +{ + "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:*)", + "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": [] + } +} From 7a050e2fdc14e0d6df6030fcdeebab5ac8db7af1 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurlov Date: Thu, 6 Nov 2025 18:47:17 +0100 Subject: [PATCH 2/3] Change monitoring and do not stash releases by deafult --- .claude/commands/test-and-prepare-release.md | 6 +++--- scripts/generate-releases.sh | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.claude/commands/test-and-prepare-release.md b/.claude/commands/test-and-prepare-release.md index d41c937..0a24e56 100644 --- a/.claude/commands/test-and-prepare-release.md +++ b/.claude/commands/test-and-prepare-release.md @@ -9,9 +9,9 @@ Read version from $ARGUMENTS and do the following: 5. Create a branch with pattern "add--release". 6. Add newly generated production release and open a draft PR with title "Add release". Remember the PR number. 7. Switch back to master branch by `git checkout master`. -8. Run `./scripts/generate-releases.sh staging` and remember a current commit. It will be used later. +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/` -10. Monitor the release progress with `./scripts/monitor-release.sh ` command on background. Explicitly tell user that this command is running on background and tell how to check it. Stop when all releases has "Succeeded" status or if any is in "Failed" status. If any release "Failed" stop monitoring and tell the 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 release" PR from the previous step that staging release successed +10. Run the `kubectl -n rh-acs-tenant get releases.appstudio.redhat.com -l pac.test.appstudio.openshift.io/sha=""` 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 release" PR from the previous step that staging release succeeded. Also remember to use the GitHub CLI (`gh`) for all GitHub-related tasks. \ No newline at end of file diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 235052b..a19dc1a 100755 --- a/scripts/generate-releases.sh +++ b/scripts/generate-releases.sh @@ -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 "$@" From 0f94dd7e3b28a1f44b033405fcc7b08bff522849 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurlov Date: Thu, 6 Nov 2025 18:49:09 +0100 Subject: [PATCH 3/3] Allow kubectl monitoring command --- .claude/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.claude/settings.json b/.claude/settings.json index 3a85ee3..a25b691 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -11,6 +11,7 @@ "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": [