Skip to content

ci: add VersionDowngrade and PluginCompatibility validation to kind test#21

Open
cooktheryan wants to merge 4 commits into
mainfrom
feat/surface-deployment-failures
Open

ci: add VersionDowngrade and PluginCompatibility validation to kind test#21
cooktheryan wants to merge 4 commits into
mainfrom
feat/surface-deployment-failures

Conversation

@cooktheryan

@cooktheryan cooktheryan commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extends the kind CI test (test-kind.yml) with smoke tests for two of the three conditions introduced in PR #13:

VersionDowngrade — simulates a previously-deployed version by writing lastDeployedVersion directly to the status subresource (bypasses the ready guard so no real image tag is required), then patches spec.version down and asserts:

  • VersionDowngrade=True condition appears
  • lastDeployedVersion is preserved as a high-water mark (not overwritten by the downgraded version)

PluginCompatibility — creates a separate Claw (instance-compat) with a GCP-type Anthropic credential and spec.version below the PluginMinVersion threshold for the Anthropic Vertex plugin. The operator sets PluginCompatibility=False at reconcile time without needing a pod to start. Upgrading to the minimum version verifies the condition clears.

Version constants are extracted to job-level env vars so they can be updated in one place when plugin versions change:

Var Value
PLUGIN_MIN_VERSION 2026.6.8 (must match knownProviders in claw_providers.go)
PLUGIN_COMPAT_LOW_VERSION 2026.6.1
VERSION_DOWNGRADE_HIGH 2026.6.8
VERSION_DOWNGRADE_LOW 2026.6.5

InitContainerFailure is not included — it requires actual plugin download and CrashLoopBackOff timing, making it too fragile for a kind smoke test. It is covered by unit tests.

Test plan

  • make lint passes
  • Kind CI run passes with the new steps

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced CI test coverage with new validation scenarios for version downgrade handling and plugin compatibility checks.

cooktheryan and others added 2 commits June 18, 2026 15:04
Adds two new validation steps to the kind CI test:

VersionDowngrade — simulates a previously-deployed version by writing
lastDeployedVersion directly to the status subresource (bypasses the
ready guard so no real image tag is required), then patches spec.version
down to "2026.6.5" and asserts VersionDowngrade=True appears and that
lastDeployedVersion is preserved as a high-water mark at "2026.6.8".

PluginCompatibility — creates a separate Claw (instance-compat) with a
GCP-type Anthropic credential and spec.version "2026.6.1", which is
below the PluginMinVersion threshold of "2026.6.8". The operator sets
PluginCompatibility=False at reconcile time without needing the pod to
start. Upgrading to "2026.6.8" verifies the condition clears.

InitContainerFailure is covered by unit tests; it requires actual plugin
download timing and is too fragile for a kind smoke test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Centralizes the four version constants used by the VersionDowngrade and
PluginCompatibility kind test steps so they can be bumped in one place:

  PLUGIN_MIN_VERSION        — must match PluginMinVersion in knownProviders
  PLUGIN_COMPAT_LOW_VERSION — below threshold to trigger PluginCompatibility=False
  VERSION_DOWNGRADE_HIGH    — recorded as lastDeployedVersion baseline
  VERSION_DOWNGRADE_LOW     — below HIGH to trigger VersionDowngrade=True

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cooktheryan, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 29 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: fa540914-dbe6-4388-b289-f6bcf886d19f

📥 Commits

Reviewing files that changed from the base of the PR and between c6ada54 and fe37a55.

📒 Files selected for processing (5)
  • .github/workflows/lint-bundle.yml
  • .github/workflows/lint.yml
  • .github/workflows/test-e2e.yml
  • .github/workflows/test-kind.yml
  • .github/workflows/test.yml
📝 Walkthrough

Walkthrough

The CI test-kind.yml workflow gains four new environment variables for version/plugin compatibility parameterization, plus two new test steps: one exercises the VersionDowngrade condition via status patching and spec downgrade, and another validates PluginCompatibility using a fake GCP secret and a Claw resource cycled through incompatible and compatible versions.

Changes

CI VersionDowngrade and PluginCompatibility validation

Layer / File(s) Summary
Version/plugin env var declarations
.github/workflows/test-kind.yml
Adds PLUGIN_MIN_VERSION, PLUGIN_COMPAT_LOW_VERSION, VERSION_DOWNGRADE_HIGH, and VERSION_DOWNGRADE_LOW as workflow-level environment variables.
VersionDowngrade and PluginCompatibility test steps
.github/workflows/test-kind.yml
Adds two test steps: one patches status.lastDeployedVersion, downgrades spec.version, polls for VersionDowngrade=True, asserts the high-water mark is preserved, then restores the spec; the other creates a fake GCP secret, applies a Claw below PLUGIN_MIN_VERSION, polls for PluginCompatibility=False, upgrades to PLUGIN_MIN_VERSION, polls for the condition to clear, and cleans up.

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI Runner
  participant K8s as Kubernetes API
  participant Op as Claw Operator

  rect rgba(173, 216, 230, 0.5)
    Note over CI,Op: VersionDowngrade test
    CI->>K8s: PATCH status.lastDeployedVersion = VERSION_DOWNGRADE_HIGH
    CI->>K8s: PATCH spec.version = VERSION_DOWNGRADE_LOW
    K8s->>Op: reconcile triggered
    Op->>K8s: set VersionDowngrade condition = True
    CI->>K8s: poll until VersionDowngrade=True
    CI->>K8s: assert lastDeployedVersion = VERSION_DOWNGRADE_HIGH
    CI->>K8s: restore spec.version
  end

  rect rgba(144, 238, 144, 0.5)
    Note over CI,Op: PluginCompatibility test
    CI->>K8s: create fake GCP service-account secret
    CI->>K8s: apply Claw at PLUGIN_COMPAT_LOW_VERSION with Anthropic Vertex GCP credential
    K8s->>Op: reconcile triggered
    Op->>K8s: set PluginCompatibility condition = False
    CI->>K8s: poll until PluginCompatibility=False
    CI->>K8s: PATCH spec.version = PLUGIN_MIN_VERSION
    Op->>K8s: clear PluginCompatibility condition
    CI->>K8s: poll until PluginCompatibility unset
    CI->>K8s: delete Claw and secret
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • redhat-et/claw-operator#13: The new test steps directly exercise the VersionDowngrade condition, PluginCompatibility condition, and status.lastDeployedVersion high-water mark logic introduced in this PR.
  • redhat-et/claw-operator#18: Both PRs modify test-kind.yml; this PR layers new test steps and env vars on top of the unified workflow structure established in that PR.

Suggested reviewers

  • IsaiahStapleton
  • pavelanni
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: adding validation tests for VersionDowngrade and PluginCompatibility conditions to the kind CI workflow. It is concise, directly related to the changeset, and conveys the primary purpose of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/surface-deployment-failures

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @.github/workflows/test-kind.yml:
- Around line 253-259: In the else block where the FAIL condition is detected
(when COND is not empty), add a kubectl get command to dump the full status of
the instance-compat custom resource before exiting with status 1. This will
capture and display the actual CR state for debugging purposes. The dump should
be inserted between the echo "FAIL: ..." statement and the exit 1 command to
ensure the CR status details are visible in CI logs when the PluginCompatibility
condition assertion fails.
🪄 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: 91a7e28c-340a-4b12-b580-e3fef8a560e1

📥 Commits

Reviewing files that changed from the base of the PR and between f13825d and c6ada54.

📒 Files selected for processing (1)
  • .github/workflows/test-kind.yml

Comment thread .github/workflows/test-kind.yml
cooktheryan and others added 2 commits June 18, 2026 15:10
…ilure

Addresses CodeRabbit feedback: show the full CR yaml when the
PluginCompatibility-cleared assertion fails so CI logs contain
the actual condition state for debugging.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Node 20 is deprecated on GitHub Actions runners. Update all actions
to versions that use the node24 runtime:

  actions/checkout:          v4 (node20) → v7 (node24)
  actions/setup-go:          v5 (node20) → v6 (node24)
  golangci/golangci-lint-action: v8 (node20) → v9 (node24)

Pinned SHAs updated accordingly. codecov/codecov-action uses a
composite runtime and is unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant