Skip to content

fix: escape reserved words from perses cel validation expressions#1091

Merged
openshift-merge-bot[bot] merged 1 commit into
rhobs:mainfrom
jgbernalp:fix-perses-cel-validation
May 18, 2026
Merged

fix: escape reserved words from perses cel validation expressions#1091
openshift-merge-bot[bot] merged 1 commit into
rhobs:mainfrom
jgbernalp:fix-perses-cel-validation

Conversation

@jgbernalp
Copy link
Copy Markdown
Member

@jgbernalp jgbernalp requested review from PeterYurkovich and zhuje May 18, 2026 17:09
@openshift-ci openshift-ci Bot requested review from danielmellado and jan--f May 18, 2026 17:09
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@jgbernalp has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 49 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 37040cad-2b9c-4e29-acf6-bbdd7fa17a84

📥 Commits

Reviewing files that changed from the base of the PR and between 36ee5d5 and 8326eda.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • bundle/manifests/observability-operator.clusterserviceversion.yaml
  • bundle/manifests/perses.dev_perses.yaml
  • bundle/manifests/perses.dev_persesdatasources.yaml
  • bundle/manifests/perses.dev_persesglobaldatasources.yaml
  • deploy/perses/crds/perses.dev_perses.yaml
  • deploy/perses/crds/perses.dev_persesdatasources.yaml
  • deploy/perses/crds/perses.dev_persesglobaldatasources.yaml
  • go.mod
📝 Walkthrough

Walkthrough

This PR updates validation rules across three Kubernetes CRDs used by the Perses operator integration. The CEL rules for namespace presence checks in authentication and TLS configurations are refactored to use the internal namespace field reference (self.__namespace__) instead of checking a user-facing namespace field (self.namespace). This change is applied consistently to six validation rules in the Perses CRD, four in the PersesDatasource CRD, and four in the PersesGlobalDatasource CRD. The perses-operator Go dependency version is also bumped to a newer commit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing CEL validation expressions by escaping reserved words (namespace → namespace) in Perses CRD schemas.
Description check ✅ Passed The description references a related issue ticket, which provides context about the purpose of the changes, though minimal implementation detail is included.
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

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.

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@jgbernalp jgbernalp force-pushed the fix-perses-cel-validation branch from 36ee5d5 to 8326eda Compare May 18, 2026 17:18
@etmurasaki
Copy link
Copy Markdown
Contributor

Manually tested against ocp4.15 and 4.21 consuming quay.io/gbernal/observability-operator-bundle:1.5.0-beta-perses-cel and it got successfully installed and monitoring UIPlugin - Perses feature is working fine.

@PeterYurkovich
Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label May 18, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit d0bde27 into rhobs:main May 18, 2026
12 checks passed
jan--f added a commit that referenced this pull request May 19, 2026
* fix: update tls log to omit length of ciphers array (#1074)

* fix: update tls log to omit length of ciphers array

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* fix: tls cipher logging

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

---------

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>

* build(deps): bump github.com/operator-framework/api (#1059)

Bumps [github.com/operator-framework/api](https://github.com/operator-framework/api) from 0.38.0 to 0.42.0.
- [Release notes](https://github.com/operator-framework/api/releases)
- [Changelog](https://github.com/operator-framework/api/blob/master/RELEASE.md)
- [Commits](operator-framework/api@v0.38.0...v0.42.0)

---
updated-dependencies:
- dependency-name: github.com/operator-framework/api
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update obo-prom-op to v0.90.1 (#1077)

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* build(deps): bump github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring (#1060)

Bumps [github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring](https://github.com/prometheus-operator/prometheus-operator) from 0.89.0 to 0.90.1.
- [Release notes](https://github.com/prometheus-operator/prometheus-operator/releases)
- [Changelog](https://github.com/prometheus-operator/prometheus-operator/blob/main/CHANGELOG.md)
- [Commits](prometheus-operator/prometheus-operator@v0.89.0...v0.90.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring
  dependency-version: 0.90.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: update perses operand image (#1085)

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* feat: coo 1.5 image tag and compat. matrix update (#1075)

* fix: add 'create tokenreview' to korrel8r RBAC (#1073)

Korrel8r uses 'create tokenreview' to get user names for session tokens.
Need usernames for reliable session keys.
Same user can get different tokens per log-in.

* fix: remove ui plugin finalizers in favor of k8s garbage collection (#1084)

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

* NO-JIRA: remove SupportsTLSProfile (#1089)

* fix: enable tls support for troubleshooting plugin

* feat: remove supports tls profile  flag because all uiplugin support tls now

* fix: lint

* chore: unpin github.com/openshift/api (#1090)

This commit unpins the version of `github.com/openshift/api` to depend
on the latest version. To continue supporting older OpenShift versions
which require the Console v1alpha1 API (removed since 2024), we fork the
`github.com/openshift/api` under `github.com/rhobs/openshift-api` and
pinned to the same version that was used before this change.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* fix: use pointer-to-struct for fields with json omitempty (#1063)

Use pointers for API struct fields marked "omitempty".

"omitempty" does not work on non-pointer struct fields.
A zero valued struct will serialize at least as "{}" and may contain zero valued fields
if any fields are not "omitempty".
This can cause problems with default values and round-trip (de)serialization
and break even if the kubebuilder "+optional" comment is applied.

Additional fixes:
- Add nil-safe GetFoo() methods to avoid long !=nil tests.
- Rename TracingObjectStorageSpec.GCSSTSSpec to GCSWIF to match its type and json tag
- Update CEL validation rule to handle nil storage/objectStorage with has() guards
- Add nil guards for Tracing, Storage, ObjectStorageSpec, and Operators in controller code
- Remove spurious omitempty from required S3Spec.AccessKeySecret field
- Fix ConfigMapKeySelector doc comments that incorrectly referenced "Secret"

* fix: escape reserved words from perses cel validation expressions (#1091)

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>

---------

Signed-off-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Jenny Zhu <jenny.a.zhu@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan Fajerski <jan--f@users.noreply.github.com>
Co-authored-by: Alan Conway <aconway@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants