Add tier for -claw namespace#1282
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**⚙️ CodeRabbit configuration file
Files:
🔀 Multi-repo context codeready-toolchain/api, codeready-toolchain/toolchain-common, codeready-toolchain/host-operator[::codeready-toolchain/api::]
[::codeready-toolchain/toolchain-common::]
[::codeready-toolchain/host-operator::]
Cross-repo assessment (relevant to this PR pair)
🔇 Additional comments (1)
WalkthroughRegisters a new ChangesClaw tier end-to-end testing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@testsupport/tiers/checks.go`:
- Around line 596-603: The CRQ currently only sets
hard[count("deployments.apps")] and hard[count("routes.route.openshift.io")],
allowing deploymentconfigs and ingresses to bypass limits; update the hard quota
map to also set hard[count("deploymentconfigs.apps")] and
hard[count("ingresses.extensions")] (using resource.ParseQuantity like the other
entries) alongside the existing hard[count(corev1.ResourcePods)] and
hard[count(corev1.ResourceServices)] assignments so the claw CRQ matches the
existing deployment/route quota surface (refer to the hard map,
count("deployments.apps"), count("routes.route.openshift.io"), and the
resource.ParseQuantity calls).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 523212f8-4753-4911-9065-7386ab99ca49
📒 Files selected for processing (4)
test/e2e/parallel/nstemplatetier_test.gotest/e2e/parallel/spacerequest_test.gotestsupport/tiers/checks.gotestsupport/wait/host.go
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: govulncheck
- GitHub Check: GolangCI Lint
- GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
test/e2e/parallel/nstemplatetier_test.gotestsupport/wait/host.gotest/e2e/parallel/spacerequest_test.gotestsupport/tiers/checks.go
🪛 GitHub Check: SonarCloud Code Analysis
testsupport/tiers/checks.go
[failure] 633-633: Define a constant instead of duplicating this literal "compute-deploy" 4 times.
🔀 Multi-repo context codeready-toolchain/api, codeready-toolchain/toolchain-common, codeready-toolchain/host-operator
[::codeready-toolchain/api::]
- NSTemplateTier types and generated deepcopy/openapi are present; no code referencing a specific tier name found here. Files:
- api/v1alpha1/nstemplatetier_types.go (type definitions)
- api/v1alpha1/zz_generated.deepcopy.go (deepcopy)
- api/v1alpha1/zz_generated.openapi.go (openapi)
[::codeready-toolchain/toolchain-common::]
- Tier generator and test helpers that create/handle NSTemplateTier objects — adding a new bundled tier likely requires providing templates that the generator will load:
- pkg/template/nstemplatetiers/nstemplatetier_generator.go — generates/creates NSTemplateTier resources from bundled templates; error if unexpected number of tiers.
- pkg/template/nstemplatetiers/testdata/nstemplatetiers/* (tier.yaml test data)
- pkg/templates/nstemplatetiers/nstemplatetier_generator_test.go — tests expect specific tier names (cases include "base1ns", "base1nsnoidling", "base1ns6didler", "test"); new tier name "claw" is not present here and tests may need updating.
- Code that computes/applies tier hashes and labels (affects Spaces/NSTemplateSet logic):
- pkg/hash/hash.go and hash tests reference specific tier-name patterns (e.g., "base1ns-*").
- Test fixtures and helpers assume default tier names (many occurrences of "base1ns") and may need to be updated to include/handle "claw":
- pkg/test/space/space.go, pkg/test/nstemplateset/nstemplateset.go, pkg/test/socialevent/socialevent.go and multiple tests reference "base1ns".
[::codeready-toolchain/host-operator::]
- Host operator contains the bundled NSTemplateTier templates and controllers that consume NSTemplateTier CRs; adding a new bundled tier requires adding its template files and possibly updating lists of bundled tiers:
- deploy/templates/nstemplatetiers/base1ns/tier.yaml (existing bundled tier templates)
- deploy/templates/nstemplatetiers/base/tier.yaml
- pkg/templates/nstemplatetiers/nstemplatetier_generator.go — SyncResources / LoadFiles loads deploy.NSTemplateTiersFS; uses bundledTierKeys and removeNoLongerBundledTiers to delete tiers no longer bundled.
- test/nstemplatetier/nstemplatetier.go — test helpers / sample NSTemplateTier specs (PreviousBase1nsTemplates, CurrentBase1nsTemplates).
- controllers/** (space, usersignup, spacerequest, nstemplatetier controllers) — many controllers read NSTemplateTier by name (validate/get) and rely on tiers being present; tests reference "base1ns" widely (e.g., controllers/usersignup/, controllers/space/, controllers/spacerequest/*).
- CRD manifests present for NSTemplateTier:
- config/crd/bases/toolchain.dev.openshift.com_nstemplatetiers.yaml
Implications (observed evidence)
- The host-operator loads bundled NSTemplateTier templates from deploy/templates/nstemplatetiers via the generator; to actually bundle a new "claw" tier you must add its template files under deploy/templates/nstemplatetiers and ensure the generator picks them up. [::codeready-toolchain/host-operator::pkg/templates/nstemplatetiers/nstemplatetier_generator.go, deploy/templates/nstemplatetiers/*]
- Many components/tests in host-operator and toolchain-common assume default tiers (numerous references to "base1ns"). Adding a new tier in e2e tests (toolchain-e2e) may be sufficient for tests, but production code/users of host-operator will only see the new tier if host-operator is updated to bundle/install the "claw" NSTemplateTier templates. [::codeready-toolchain/host-operator::controllers/*] [::codeready-toolchain/toolchain-common::pkg/template/nstemplatetiers/nstemplatetier_generator.go]
- Tests and generator unit tests that enumerate expected tiers (toolchain-common and host-operator tests) may need updates to include "claw" where explicit expectations exist (e.g., test cases and length/assertions). Examples:
- toolchain-common: pkg/template/nstemplatetiers/nstemplatetier_generator_test.go (case lists), pkg/template/nstemplatetiers/testdata
- host-operator: controllers/nstemplatetier_controller_test.go and many controller tests referencing "base1ns" in expectations. [::codeready-toolchain/toolchain-common::pkg/template/nstemplatetiers/nstemplatetier_generator_test.go] [::codeready-toolchain/host-operator::controllers/nstemplatetier_controller_test.go]
Conclusion
- Cross-repo: API CRD types exist in api repo and do not need changes.
- To fully support the new "claw" tier beyond e2e tests, host-operator must bundle corresponding NSTemplateTier template files (deploy/templates/nstemplatetiers) so controllers/generator/loaders see it; toolchain-common/unit tests and host-operator controller tests that assert exact sets/counts of tiers should be reviewed/updated to include "claw" where applicable.
- I found cross-repo references that are relevant to this PR and its paired host-operator PR.
🔇 Additional comments (4)
test/e2e/parallel/spacerequest_test.go (1)
14-16: LGTM!Also applies to: 346-414
test/e2e/parallel/nstemplatetier_test.go (1)
304-306: LGTM!testsupport/tiers/checks.go (1)
35-35: LGTM!Also applies to: 66-67, 531-582, 618-692
testsupport/wait/host.go (1)
53-53: Verify the paired host-operator change is always deployed with this bundled-tier update.Once
clawis listed here, shared helpers will treat it as always present. If an environment still runs a host-operator build without bundledclawtemplates, tier discovery/wait logic will fail against a missing tier.
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, MatousJobanek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e7056bb
into
codeready-toolchain:master



Paired with codeready-toolchain/host-operator#1265
Summary by CodeRabbit
New Features
Tests
Chores