Skip to content

Reclassify spot-check jobs from 'rare' to 'spotcheck-30d' tier#3617

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
dgoodwin:spotcheck-30d-variants
Jun 15, 2026
Merged

Reclassify spot-check jobs from 'rare' to 'spotcheck-30d' tier#3617
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
dgoodwin:spotcheck-30d-variants

Conversation

@dgoodwin

@dgoodwin dgoodwin commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Introduce SpotCheckComponent and SpotCheckCapability variants for
cpu-partitioning and etcd-scaling jobs, replacing the generic 'rare'
tier with the explicit 'spotcheck-30d' tier. Add validation that
spot-check jobs must define both component and capability variants.

This prepares the variant registry for the upcoming spot-check analysis
feature in Component Readiness while keeping BigQuery data compatible
via the existing COALESCE fallback SQL.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Preparation for #3612, will allow for better testing locally before calling for review there.

Summary by CodeRabbit

  • New Features

    • Spot-check variant classification enforces non-empty component and capability fields and auto-assigns the job tier to spotcheck-30d when applied.
  • Improvements

    • Validation failures across all jobs are aggregated, sorted, and reported together for clearer diagnostics.
    • Several snapshot entries updated to use spotcheck-30d with corresponding component/capability values.
  • Tests

    • Added test cases covering spot-check job variant scenarios and tier behavior.

Introduce SpotCheckComponent and SpotCheckCapability variants for
cpu-partitioning and etcd-scaling jobs, replacing the generic 'rare'
tier with the explicit 'spotcheck-30d' tier. Add validation that
spot-check jobs must define both component and capability variants.

This prepares the variant registry for the upcoming spot-check analysis
feature in Component Readiness while keeping BigQuery data compatible
via the existing COALESCE fallback SQL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Adds spot-check classification: new exported variant keys, a classifier that infers component and capability from job names, tier assignment to spotcheck-30d when classification is present, aggregated validation across jobs, updated snapshots, and tests exercising the new behavior.

Changes

Spot-Check Variant Classification

Layer / File(s) Summary
Variant constants and type extensions
pkg/variantregistry/ocp.go
New exported variant keys VariantSpotCheckComponent, VariantSpotCheckCapability, plus insertion of a spot-check classification step into IdentifyVariants.
Spot-check classification and tier assignment
pkg/variantregistry/ocp.go
setSpotCheckClassification infers component/capability from job names; setJobTier now sets VariantJobTier to spotcheck-30d when a spot-check component is present and returns early.
Spot-check validation across loader and snapshot
pkg/variantregistry/ocp.go, pkg/variantregistry/snapshot.go
Loader (LoadExpectedJobVariants) and VariantSnapshot.Identify collect per-job spot-check validation errors, sort them, and return a single aggregated formatted error when required spot-check fields are missing.
Test coverage for spot-check behavior
pkg/variantregistry/ocp_test.go
Added TestVariantSyncer cases for cpu-partitioning and etcd-scaling asserting VariantJobTier=spotcheck-30d and spot-check fields; updated TestAdjustJobTierBasedOnView to use a spotcheck-30d non-adjustment scenario.
Snapshot data with spot-check metadata
pkg/variantregistry/snapshot.yaml
Many snapshot entries updated from rare to spotcheck-30d and populated with SpotCheckCapability and SpotCheckComponent values (Etcd/Scaling or Node / Kubelet/CPU Partitioning).

🎯 3 (Moderate) | ⏱️ ~25 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 3 warnings)

Check name Status Explanation Resolution
Sql Injection Prevention ❌ Error pkg/variantregistry/ocp.go builds BigQuery SQL via strings.ReplaceAll(fmt.Sprintf(...)) using bigQueryProject/bigQueryDataset from CLI flags (user input), enabling injection. Validate/allowlist project/dataset/table identifiers (and quote safely) before inserting into SQL; avoid fmt.Sprintf/concatenation of untrusted identifiers when constructing queries.
No-Sensitive-Data-In-Logs ❌ Error pkg/variantregistry/ocp.go logs internal hostname/URLs (gcsweb-ci...) and logs entire clusterData map via logrus.Infof/WithField, which can expose sensitive internal info. Remove or redact the logged internal URL/hostname and avoid logging full clusterData; if needed, log only minimal non-sensitive identifiers or behind a safer/debug setting.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Go Error Handling ⚠️ Warning New spot-check validation aggregates errors via err.Error() and returns errors.New/fmt.Errorf without %w; VariantSnapshot.Identify ranges over s.config.Releases without nil checking. Use fmt.Errorf(...%w) or errors.Join to preserve/wrap underlying errors instead of stringifying err, and add nil guards before dereferencing pointer fields like s.config.
Test Coverage For New Features ⚠️ Warning ocp.go adds validateSpotCheckVariants to aggregate sorted errors for spotcheck-* jobs missing SpotCheckComponent/Capability, but ocp_test only asserts success (no assert.Error). Add unit test(s) covering the validation failure path (spotcheck-* job missing SpotCheckComponent or SpotCheckCapability) and assert Identify/LoadExpectedJobVariants returns the aggregated error message deterministically.
✅ Passed checks (15 passed)
Check name Status Explanation
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.
Excessive Css In React Should Use Styles ✅ Passed PR changes are in Go/YAML (pkg/variantregistry/ocp.go, snapshot.go, snapshot.yaml); repo search found 0 JS/TS files mentioning new spotcheck keys, so no React inline CSS was introduced.
Single Responsibility And Clear Naming ✅ Passed New spot-check logic is split into focused helpers (setSpotCheckClassification, validateSpotCheckVariants) and a clear aggregation step; names directly describe intent and responsibilities.
Stable And Deterministic Test Names ✅ Passed PR uses Go t.Run subtest names from static table fields (e.g., t.Run(test.job)); no Ginkgo titles and no timestamps/pods/UUIDs/IPs/random data appear in test titles.
Test Structure And Quality ✅ Passed No Ginkgo (search showed none) and tests are table-driven Go parsing assertions only; no cluster resources or waits, and assertion usage matches existing require/assert patterns in repo.
Microshift Test Compatibility ✅ Passed PR #3617 only changes variant registry Go unit tests/snapshot YAML (4 files) and contains no Ginkgo e2e tests or MicroShift-incompatible API references to flag.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR changes only variantregistry Go logic/tests and snapshot.yaml; no new Ginkgo e2e tests or multi-node SNO assumptions found in modified files.
Topology-Aware Scheduling Compatibility ✅ Passed PR #3617 only touches pkg/variantregistry/ocp.go, ocp_test.go, snapshot.go, snapshot.yaml; scans show no k8s scheduling constructs (affinity/topologySpreadConstraints/nodeSelector/PDB) introduced.
Ote Binary Stdout Contract ✅ Passed Checked PR-touched Go files (pkg/variantregistry/{ocp.go,ocp_test.go,snapshot.go}) for fmt.Print*/os.Stdout/klog stdout writes and for init/main/TestMain—none found; errors use fmt.Errorf only.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR changes only variant-registry Go/snapshot files; inspected them and found no Ginkgo e2e Describe/It blocks or IPv4/external-connectivity logic, so the IPv6/disconnected compatibility check is no...
No-Weak-Crypto ✅ Passed Checked pkg/variantregistry/ocp.go, ocp_test.go, snapshot.go, snapshot.yaml for crypto/md5, sha1, crypto/des, rc4, blowfish, ecb/ECB and constant-time/bytes.Equal; no such weak-crypto usage or cryp...
Container-Privileges ✅ Passed PR #3617 only changes variant registry Go files and snapshot.yaml; the PR diff contains no Kubernetes securityContext/privileged/hostPID/hostNetwork/hostIPC/SYS_ADMIN/allowPrivilegeEscalation keywo...
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: reclassifying spot-check jobs from 'rare' to 'spotcheck-30d' tier, which is the primary focus of the changeset across multiple files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from deads2k and sosiouxme June 12, 2026 17:48
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/variantregistry/ocp_test.go (1)

2207-2266: ⚡ Quick win

Add negative tests for the new spot-check validation path.

These additions cover classification, but there’s no direct regression test for invalid spot-check variants (missing VariantSpotCheckComponent/VariantSpotCheckCapability) and aggregated error behavior in LoadExpectedJobVariants/VariantSnapshot.Identify.

As per coding guidelines: “New or modified functionality must include test coverage … bug fixes should include a regression test that fails without the fix.”

🤖 Prompt for 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.

In `@pkg/variantregistry/ocp_test.go` around lines 2207 - 2266, Add negative tests
exercising the new spot-check validation path by adding test cases in
pkg/variantregistry/ocp_test.go that simulate spot-check job names but omit
VariantSpotCheckComponent and/or VariantSpotCheckCapability from the expected
map, then assert that LoadExpectedJobVariants (and/or VariantSnapshot.Identify)
returns an error and that multiple missing-field errors are aggregated; locate
the test table entries near the existing spot-check cases and add corresponding
failing-case entries and assertions that check for a non-nil error and that the
error message contains both missing-field details (or uses the aggregated error
type).

Source: Coding guidelines

🤖 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 `@pkg/variantregistry/ocp.go`:
- Around line 263-271: The aggregated validation errors collected into the errs
slice in the loop over variantsByJob (where validateSpotCheckVariants is called)
are nondeterministic because map iteration order varies; sort errs (e.g., using
sort.Strings(errs)) before calling strings.Join so the returned error message is
stable. Make the same change in the analogous aggregation in
pkg/variantregistry/snapshot.go (the errs slice/strings.Join there) to ensure
deterministic ordering across runs.

---

Nitpick comments:
In `@pkg/variantregistry/ocp_test.go`:
- Around line 2207-2266: Add negative tests exercising the new spot-check
validation path by adding test cases in pkg/variantregistry/ocp_test.go that
simulate spot-check job names but omit VariantSpotCheckComponent and/or
VariantSpotCheckCapability from the expected map, then assert that
LoadExpectedJobVariants (and/or VariantSnapshot.Identify) returns an error and
that multiple missing-field errors are aggregated; locate the test table entries
near the existing spot-check cases and add corresponding failing-case entries
and assertions that check for a non-nil error and that the error message
contains both missing-field details (or uses the aggregated error type).
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 2f6d2be2-359f-48a0-a4af-bffa14970885

📥 Commits

Reviewing files that changed from the base of the PR and between 9d7d81d and a0ff2dc.

📒 Files selected for processing (4)
  • pkg/variantregistry/ocp.go
  • pkg/variantregistry/ocp_test.go
  • pkg/variantregistry/snapshot.go
  • pkg/variantregistry/snapshot.yaml

Comment thread pkg/variantregistry/ocp.go
Sort the aggregated spot-check validation errors before joining them
into the error message, since map iteration order is nondeterministic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

}
if len(errs) > 0 {
sort.Strings(errs)
return nil, errors.New("variant registry validation failed:\n" + strings.Join(errs, "\n"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: You can build a bit friendly error by wrapping the underlying errors instead of appending the errors' strings into a new error's string.

return nil, fmt.Errorf("variant registry validation failed:\n %w", errors.Join(errs...))

FeatureSet: default
Installer: ipi
JobTier: rare
JobTier: spotcheck-30d

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this yaml file generated programatically?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, via make update-variants for prs and periodic-prow-auto-sippy-config-generator

@neisw

neisw commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/hold
to review comments from @mstaeble and potentially promise to address in the followup pr.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 12, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2026
@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgoodwin, neisw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mstaeble

Copy link
Copy Markdown
Contributor

to review comments from @mstaeble and potentially promise to address in the followup pr.

We certainly don't need to hold for my super nit.

@dgoodwin

Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 15, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@dgoodwin: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit d362395 into openshift:main Jun 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants