Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

NO-ISSUE: Add unit tests to validate table CEL expressions - #770

Merged
openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
jhernand:add_unit_tests_for_table_cel_expressions
Jun 25, 2026
Merged

openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
jhernand:add_unit_tests_for_table_cel_expressions

Conversation

@jhernand

@jhernand jhernand commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Extract Helper and ObjectHelper interfaces from the reflection package with generated mocks,
    enabling tests to use mock helpers instead of live gRPC connections.
  • Add a unit test that scans all YAML table definition files, resolves the corresponding protobuf
    type, and renders an empty instance to force compilation of every CEL expression, catching syntax
    errors and references to non-existent fields at test time.
  • Rewrite existing table renderer tests to use mock helpers, removing the dependency on a test gRPC
    server and improving test speed.
  • Remove stale HostClass table definitions that referenced types no longer in the proto registry.

Test plan

  • ginkgo run internal/rendering passes (6 specs)
  • ginkgo run -r internal passes
  • CI passes

Summary by CodeRabbit

  • Bug Fixes

    • Improved consistency of object lookup used by table rendering, enhancing template-based columns (including correct fallback when a template name is missing).
    • Updated table output for RoleBinding to display USERS instead of GROUPS.
    • Updated HostClass table rendering by removing the prior ID/Name/Title columns.
  • Tests

    • Modernized table rendering tests to use mock-based reflection helpers, added compute instance template rendering coverage, and expanded validation for CEL expressions across all table YAML definitions.

@openshift-ci-robot

Copy link
Copy Markdown

@jhernand: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Extract Helper and ObjectHelper interfaces from the reflection package with generated mocks,
    enabling tests to use mock helpers instead of live gRPC connections.
  • Add a unit test that scans all YAML table definition files, resolves the corresponding protobuf
    type, and renders an empty instance to force compilation of every CEL expression, catching syntax
    errors and references to non-existent fields at test time.
  • Rewrite existing table renderer tests to use mock helpers, removing the dependency on a test gRPC
    server and improving test speed.
  • Remove stale HostClass table definitions that referenced types no longer in the proto registry.

Test plan

  • ginkgo run internal/rendering passes (6 specs)
  • ginkgo run -r internal passes
  • CI passes

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 1dbf638b-3136-4be7-87d0-4217eb7db5f9

📥 Commits

Reviewing files that changed from the base of the PR and between 6ab8120 and 1dc5eed.

📒 Files selected for processing (20)
  • internal/cmd/cli/annotate/annotate_cmd.go
  • internal/cmd/cli/delete/delete_cmd.go
  • internal/cmd/cli/edit/edit_cmd.go
  • internal/cmd/cli/edit/edit_cmd_test.go
  • internal/cmd/cli/get/get_cmd.go
  • internal/cmd/cli/get/get_cmd_watch_e2e_test.go
  • internal/cmd/cli/label/label_cmd.go
  • internal/reflection/find_object.go
  • internal/reflection/reflection_helper.go
  • internal/reflection/reflection_helper_mock.go
  • internal/reflection/reflection_helper_test.go
  • internal/reflection/reflection_object_helper_mock.go
  • internal/rendering/table_renderer.go
  • internal/rendering/table_renderer_compute_instance_test.go
  • internal/rendering/table_renderer_test.go
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.private.v1.RoleBinding.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.RoleBinding.yaml
  • internal/terminal/terminal_console.go
💤 Files with no reviewable changes (2)
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml

Walkthrough

The PR converts reflection helpers to interfaces backed by unexported implementations, updates renderer, CLI, and terminal consumers to store helper values, adds generated mocks and renderer coverage, and removes HostClass table definitions.

Changes

Reflection helper migration

Layer / File(s) Summary
Public contract and scan pipeline
internal/reflection/reflection_helper.go
Helper and ObjectHelper become interfaces, and Build, scan, Lookup, and related helper construction move onto unexported receivers.
ObjectHelper methods
internal/reflection/reflection_helper.go, internal/reflection/find_object.go
Descriptor, identity, CRUD, update, delete, and FindObject move onto *objectHelper while keeping the same method surfaces.
Generated mocks and reflection tests
internal/reflection/reflection_helper_mock.go, internal/reflection/reflection_object_helper_mock.go, internal/reflection/reflection_helper_test.go
GoMock files are added for the reflection interfaces, and the reflection tests switch to value-typed helper variables.
Renderer helper values
internal/rendering/table_renderer.go
TableRendererBuilder and TableRenderer store reflection helpers by value, and loadTable and renderRow accept ObjectHelper values.
Renderer tests and table definitions
internal/rendering/table_renderer_test.go, internal/rendering/table_renderer_compute_instance_test.go, internal/rendering/tables/osac.private.v1.HostClass.yaml, internal/rendering/tables/osac.public.v1.HostClass.yaml
The renderer tests move to gomock-based helpers, add compute-instance TEMPLATE coverage, add CEL compile/evaluation coverage for table definitions, and remove the two HostClass table definitions.
CLI and terminal helper values
internal/cmd/cli/annotate/annotate_cmd.go, internal/cmd/cli/delete/delete_cmd.go, internal/cmd/cli/edit/edit_cmd.go, internal/cmd/cli/edit/edit_cmd_test.go, internal/cmd/cli/get/get_cmd.go, internal/cmd/cli/get/get_cmd_watch_e2e_test.go, internal/cmd/cli/label/label_cmd.go, internal/terminal/terminal_console.go
The CLI runner contexts and terminal console switch their helper fields and setters from pointers to interface values, and the related tests update their helper variables.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • adriengentil
  • eranco74
  • trewest

Poem

Pointers drifted into the mist,
Interfaces took the helm and kissed
The renderer, CLI, and tests in tune,
While mocks now hum a gentler moon 🌙

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding unit tests that render tables to validate CEL expressions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
No-Hardcoded-Secrets ✅ Passed Changed files add mocks/tests and remove table YAML; no API keys, tokens, passwords, embedded creds, or long base64 literals were introduced.
No-Weak-Crypto ✅ Passed Touched files only refactor helpers/tests/rendering; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons found.
No-Injection-Vectors ✅ Passed No flagged sinks found in touched code; YAML uses yaml.Unmarshal, and edit launches the editor via exec.Cmd without a shell.
Container-Privileges ✅ Passed No touched manifest sets privileged/hostPID/hostNetwork/hostIPC/SYS_ADMIN or allowPrivilegeEscalation:true; deployments shown use allowPrivilegeEscalation:false and runAsNonRoot:true.
No-Sensitive-Data-In-Logs ✅ Passed Touched files only change helper types/mocks/tests; existing log statements expose editor env names, file paths, and object IDs, not secrets/PII.
Ai-Attribution ✅ Passed The sole commit includes the required Assisted-by: Cursor trailer, and no Co-Authored-By AI attribution appears in history.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.23.0)
internal/cmd/cli/edit/edit_cmd.go

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.23][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

internal/cmd/cli/delete/delete_cmd.go

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.38][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

internal/cmd/cli/annotate/annotate_cmd.go

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

[00.53][ERROR]: unable to find a config; path .coderabbit-opengrep-fallback.yml does not exist

  • 13 others

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

@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 `@internal/rendering/table_renderer_test.go`:
- Around line 67-70: The DELETING test setup is too broad because
helper.Lookup() always returns subnetHelper, which only stubs basic methods and
can break if unrelated lookup-backed columns are added. Update the test fixture
in table_renderer_test.go to use the same fallback lookup-helper pattern as the
CEL test, so only the DELETING behavior is exercised while any other lookup
columns get their own mocked helper. Keep the existing subnetHelper for the
intended DELETING path, but avoid routing every Lookup() call to it.
🪄 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: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 6fdab5aa-e4ff-43fc-8d21-d8dc75fb8e59

📥 Commits

Reviewing files that changed from the base of the PR and between 6b1f439 and 249b97f.

📒 Files selected for processing (18)
  • internal/cmd/cli/annotate/annotate_cmd.go
  • internal/cmd/cli/delete/delete_cmd.go
  • internal/cmd/cli/edit/edit_cmd.go
  • internal/cmd/cli/edit/edit_cmd_test.go
  • internal/cmd/cli/get/get_cmd.go
  • internal/cmd/cli/get/get_cmd_watch_e2e_test.go
  • internal/cmd/cli/label/label_cmd.go
  • internal/reflection/find_object.go
  • internal/reflection/reflection_helper.go
  • internal/reflection/reflection_helper_mock.go
  • internal/reflection/reflection_helper_test.go
  • internal/reflection/reflection_object_helper_mock.go
  • internal/rendering/table_renderer.go
  • internal/rendering/table_renderer_compute_instance_test.go
  • internal/rendering/table_renderer_test.go
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/terminal/terminal_console.go
💤 Files with no reviewable changes (2)
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/rendering/tables/osac.private.v1.HostClass.yaml

Comment thread internal/rendering/table_renderer_test.go
@jhernand
jhernand force-pushed the add_unit_tests_for_table_cel_expressions branch from 249b97f to 50ee5a3 Compare June 24, 2026 20:04

@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 `@internal/rendering/table_renderer_compute_instance_test.go`:
- Around line 47-49: The “Shows the template name” test case in
table_renderer_compute_instance_test.go is not validating the name path because
the template name, id, and lookup key are all the same value. Update the second
entry in the test setup to use a distinct template name from the id and spec
key, using the existing templateName argument and the ComputeInstanceTemplate
fields near templateObj so the assertion proves the renderer is displaying the
actual name rather than falling back to the key. This same adjustment should be
reflected in the duplicated test case referenced by the comment.
🪄 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: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 64caa2a9-ee7e-4df9-bbe8-0bad14a74844

📥 Commits

Reviewing files that changed from the base of the PR and between 249b97f and 50ee5a3.

📒 Files selected for processing (4)
  • internal/rendering/table_renderer_compute_instance_test.go
  • internal/rendering/table_renderer_test.go
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
💤 Files with no reviewable changes (2)
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/rendering/tables/osac.private.v1.HostClass.yaml

Comment thread internal/rendering/table_renderer_compute_instance_test.go
@jhernand
jhernand force-pushed the add_unit_tests_for_table_cel_expressions branch from 50ee5a3 to 9d929e9 Compare June 24, 2026 21:38

@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 `@internal/rendering/table_renderer_test.go`:
- Around line 148-156: The table rendering test can vacuously pass when the
tables directory is empty or contains no YAML files, so add a guard in
table_renderer_test.go around the existing loop that reads tableFiles and calls
Render to ensure at least one table definition was actually exercised. Use the
existing rendered counter in the test, increment it after each successful
Render, and assert after the loop that at least one table was rendered so the
“compile all tables” test fails when nothing was covered.
🪄 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: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ee049f5a-1b28-4af3-83ce-00d2fc2a86ef

📥 Commits

Reviewing files that changed from the base of the PR and between 50ee5a3 and 9d929e9.

📒 Files selected for processing (4)
  • internal/rendering/table_renderer_compute_instance_test.go
  • internal/rendering/table_renderer_test.go
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
💤 Files with no reviewable changes (2)
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml

Comment thread internal/rendering/table_renderer_test.go Outdated
@omer-vishlitzky

Copy link
Copy Markdown
Contributor

💀 CI Triage: broken_main | Category: BOOT

Root cause: A migration collision between the pre-built cluster snapshot and newly merged Helm chart changes causes strategic merge patch to fail during helm upgrade.

Explanation: The failure is caused by a collision between the pre-built cluster snapshot (flavor) and the newly merged changes in osac-operator PR #316 and osac-installer PR #328. In the snapshot, the pre-installed 'osac-operator' deployment defines the 'OSAC_AAP_TOKEN' environment variable as a literal 'value'. However, the newly merged Helm chart changes configure 'OSAC_AAP_TOKEN' to use 'valueFrom.secretKeyRef'. When 'refresh-after-snapshot.py' runs 'helm upgrade osac', Kubernetes attempts to perform a strategic merge patch on the existing deployment. Because list elements are merged by name, the resulting environment variable has both 'value' and 'valueFrom' specified, which is invalid in Kubernetes and causes the upgrade to fail.

Evidence:

build-log.txt:

Error: UPGRADE FAILED: cannot patch "osac-operator" with kind Deployment: Deployment.apps "osac-operator" is invalid: spec.template.spec.containers[0].env[1].valueFrom: Invalid value: "": may not be specified when `value` is not empty

Suggestion: Rebuild the cluster snapshot (flavor) with the updated osac-operator deployment that uses valueFrom for OSAC_AAP_TOKEN. Alternatively, add a step in 'refresh-after-snapshot.py' to delete the existing 'osac-operator' deployment before running 'helm upgrade' so Helm can recreate it cleanly.


Prow job | Build 2069874375930155008 | 🤖 triagent

For deeper investigation, use the /osac-debug-e2e skill with this build ID.

@omer-vishlitzky

Copy link
Copy Markdown
Contributor

💀 CI Triage: broken_main | Category: BOOT

Root cause: Helm upgrade fails during boot because the pre-installed osac-operator deployment has literal env vars that conflict with the new secretKeyRef configuration.

Explanation: The failure is caused by a conflict during 'helm upgrade' in the boot step. A recent change in osac-operator (#316) and osac-installer (#328) updated the operator's Helm chart to source OSAC_AAP_TOKEN via secretKeyRef instead of a literal value. However, on snapshot-based clusters, the pre-installed osac-operator deployment already has OSAC_AAP_TOKEN and OSAC_AAP_URL injected as literal values. This causes a strategic-merge-patch conflict during 'helm upgrade', failing with 'Invalid value: "": may not be specified when value is not empty'. This broke the main branch for all E2E VMaaS jobs. The issue was resolved in osac-installer PR #333 (merged at 22:01 UTC), which strips these env vars before upgrading. Since this run started at 21:38 UTC, it did not include the fix. Retrying the job will resolve the failure.

Evidence:

build-log.txt:

Error: UPGRADE FAILED: cannot patch "osac-operator" with kind Deployment: Deployment.apps "osac-operator" is invalid: spec.template.spec.containers[0].env[1].valueFrom: Invalid value: "": may not be specified when `value` is not empty

Suggestion: /retest


Prow job | Build 2069897911105228800 | 🤖 triagent

For deeper investigation, use the /osac-debug-e2e skill with this build ID.

@omer-vishlitzky

Copy link
Copy Markdown
Contributor

/retest

@jhernand
jhernand force-pushed the add_unit_tests_for_table_cel_expressions branch from 9d929e9 to 6ab8120 Compare June 25, 2026 07:12

@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: 3

🤖 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 `@internal/rendering/table_renderer_compute_instance_test.go`:
- Around line 64-77: The test for the compute instance table renderer currently
allows any List options, so it won’t catch regressions in lookup filter
construction. Update the expectations around templateHelper.List in the compute
instance rendering test to inspect the passed reflection.ListOptions and assert
that options.Filter matches the expected lookupName predicate using this.id and
this.metadata.name for "my-template", while still returning the template
fixture.

In `@internal/rendering/table_renderer_test.go`:
- Around line 19-21: The table renderer test is globbing YAML files from the
working tree instead of validating the embedded tablesFS asset set used by
loadTable. Update the test setup in table_renderer_test.go to enumerate tablesFS
with fs.Glob (or equivalent fs-based traversal) and feed those paths into the
existing test cases, so the test exercises the same embedded assets production
loads; keep the current loadTable-focused assertions and adjust any
helpers/imports accordingly.

In `@internal/rendering/table_renderer.go`:
- Around line 83-91: The helper guard in TableRenderer can be bypassed by a
typed-nil reflection.Helper, so update SetHelper (or the Build nil check) to
normalize the incoming helper with reflection.NormalizeNil before storing or
validating it. Use the existing TableRenderer and Build methods to ensure the
mandatory-helper check treats typed-nil values as nil and still returns the
expected error when no real helper is set.
🪄 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: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 78c34ab0-3afe-487f-adcc-773fae632b9b

📥 Commits

Reviewing files that changed from the base of the PR and between 9d929e9 and 6ab8120.

📒 Files selected for processing (18)
  • internal/cmd/cli/annotate/annotate_cmd.go
  • internal/cmd/cli/delete/delete_cmd.go
  • internal/cmd/cli/edit/edit_cmd.go
  • internal/cmd/cli/edit/edit_cmd_test.go
  • internal/cmd/cli/get/get_cmd.go
  • internal/cmd/cli/get/get_cmd_watch_e2e_test.go
  • internal/cmd/cli/label/label_cmd.go
  • internal/reflection/find_object.go
  • internal/reflection/reflection_helper.go
  • internal/reflection/reflection_helper_mock.go
  • internal/reflection/reflection_helper_test.go
  • internal/reflection/reflection_object_helper_mock.go
  • internal/rendering/table_renderer.go
  • internal/rendering/table_renderer_compute_instance_test.go
  • internal/rendering/table_renderer_test.go
  • internal/rendering/tables/osac.private.v1.HostClass.yaml
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/terminal/terminal_console.go
💤 Files with no reviewable changes (2)
  • internal/rendering/tables/osac.public.v1.HostClass.yaml
  • internal/rendering/tables/osac.private.v1.HostClass.yaml

Comment thread internal/rendering/table_renderer_compute_instance_test.go
Comment thread internal/rendering/table_renderer_test.go
Comment thread internal/rendering/table_renderer.go
@jhernand
jhernand force-pushed the add_unit_tests_for_table_cel_expressions branch from 6ab8120 to bcba64e Compare June 25, 2026 09:31
jhernand added 2 commits June 25, 2026 11:41
Replace the concrete `Helper` and `ObjectHelper` structs with interfaces,
renaming the implementations to unexported `helper` and `objectHelper`
types. Add `go:generate` directives for `mockgen` so that mocks are
produced automatically.

This is a preparation step for adding unit tests to the CLI rendering
tables, which need to mock the reflection layer without requiring a live
gRPC connection.

Assisted-by: Cursor
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
Rewrite the table renderer tests to use mock reflection helpers instead
of a real gRPC server, making them faster and independent of network
infrastructure.

Add a new test that scans all YAML table definition files, resolves the
corresponding protobuf type from the registry, and renders an empty
instance through the table renderer. This forces compilation and
evaluation of every CEL expression, catching syntax errors and
references to non-existent fields at test time.

Remove the stale `HostClass` table definitions which referenced a type
that no longer exists in the proto registry.

Assisted-by: Cursor
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
@jhernand
jhernand force-pushed the add_unit_tests_for_table_cel_expressions branch from bcba64e to 1dc5eed Compare June 25, 2026 09:43
@jhernand
jhernand requested a review from CrystalChun June 25, 2026 10:18

@CrystalChun CrystalChun 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.

/lgtm

@openshift-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CrystalChun, jhernand

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 8eb016a into osac-project:main Jun 25, 2026
21 of 22 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants