diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 00000000..4cce5757 --- /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 00000000..7dfb706a --- /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 00000000..0a24e562 --- /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 the current commit. It will be used later. +9. Deploy the newly generated stage release to the cluster `oc create -f release-history/` +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/.claude/settings.json b/.claude/settings.json new file mode 100644 index 00000000..a25b6919 --- /dev/null +++ b/.claude/settings.json @@ -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": [] + } +} diff --git a/scripts/generate-releases.sh b/scripts/generate-releases.sh index 235052ba..a19dc1aa 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 "$@"