Skip to content

MON-4648: relax pathPrefix CEL rules on additionalAlertmanagerConfigs - #3053

Open
danielmellado wants to merge 1 commit into
openshift:masterfrom
danielmellado:fix/relax-pathprefix-rules
Open

danielmellado wants to merge 1 commit into
openshift:masterfrom
danielmellado:fix/relax-pathprefix-rules

Conversation

@danielmellado

Copy link
Copy Markdown
Contributor

Remove the leading-slash, trailing-slash, and bare-slash restrictions.
Prometheus accepts relative paths, trailing slashes, and defaults
path_prefix to "/". Lower MinLength from 2 to 1.

Signed-off-by: Daniel Mellado dmellado@fedoraproject.org

Remove the leading-slash, trailing-slash, and bare-slash restrictions.
Prometheus accepts relative paths, trailing slashes, and defaults
path_prefix to "/". Lower MinLength from 2 to 1.

Signed-off-by: Daniel Mellado <dmellado@fedoraproject.org>
@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: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Sep 21, 2026

Copy link
Copy Markdown

@danielmellado: This pull request references MON-4648 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Remove the leading-slash, trailing-slash, and bare-slash restrictions.
Prometheus accepts relative paths, trailing slashes, and defaults
path_prefix to "/". Lower MinLength from 2 to 1.

Signed-off-by: Daniel Mellado dmellado@fedoraproject.org

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.

@openshift-ci

openshift-ci Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Hello @danielmellado! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9dfc5f4f-3a79-4911-9ad5-5834b25b947b

📥 Commits

Reviewing files that changed from the base of the PR and between 3d742f0 and 31d8da3.

⛔ Files ignored due to path filters (5)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitorings.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
📒 Files selected for processing (3)
  • config/v1alpha1/tests/clustermonitorings.config.openshift.io/ClusterMonitoringConfig.yaml
  • config/v1alpha1/types_cluster_monitoring.go
  • payload-manifests/crds/0000_10_config-operator_01_clustermonitorings.crd.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The AdditionalAlertmanagerConfig.pathPrefix contract now accepts absolute and relative paths, trailing slashes, and /. Its minimum length is one character. Query strings and fragments remain invalid. Creation tests cover accepted bare, relative, and trailing-slash values, plus rejection of a query string.

Suggested reviewers: marioferh

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: relaxing CEL validation rules for pathPrefix on additionalAlertmanagerConfigs.
Description check ✅ Passed The description directly explains the removed restrictions and the MinLength change for pathPrefix, which matches the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Stable And Deterministic Test Names ✅ Passed The four added YAML test names are literal, static strings. They contain no pod names, timestamps, UUIDs, node names, namespaces, IP addresses, or generated identifiers. The test generator passes each…
Test Structure And Quality ✅ Passed The PR adds four independent onCreate table cases. Each case tests one pathPrefix behavior and uses the existing declarative Ginkgo test pattern. Accepted cases compare the persisted object, and t…
Microshift Test Compatibility ✅ Passed The added cases are declarative CRD validation data in config/v1alpha1/tests/.../ClusterMonitoringConfig.yaml, not new MicroShift e2e tests. The existing harness loads these YAML files, installs the…
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The PR adds declarative API validation cases, not tests with multi-node or HA assumptions. The new cases only create ClusterMonitoring objects with additionalAlertmanagerConfigs.pathPrefix v…
Topology-Aware Scheduling Compatibility ✅ Passed PASS. The scoped diff changes only pathPrefix validation, API documentation/generated schemas, and admission tests. It adds no deployment, controller, pod, replica, affinity, topology spread, node s…
Ote Binary Stdout Contract ✅ Passed PASS: The pull request changes schema comments, validation markers, generated schema artifacts, and YAML test data only. It adds individual On Create test entries, which the repository generator reg…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS. The pull request adds declarative API validation cases in a YAML test suite. The generated Ginkgo cases only create and read Kubernetes objects in the local envtest API; they do not connect to `…
No-Weak-Crypto ✅ Passed The pull request changes only pathPrefix validation, documentation, generated schemas, and configuration tests. The added-line scan found no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, crypto API, custo…
Container-Privileges ✅ Passed PASS. The pull request changes a ClusterMonitoring CRD schema, generated OpenAPI/CRD files, and validation tests for pathPrefix. The changed YAML objects are CRDs or test fixtures, not container or …
No-Sensitive-Data-In-Logs ✅ Passed PASS: The pull request changes pathPrefix validation, generated schema documentation, and admission test fixtures only. The diff adds no logging calls and does not add passwords, tokens, API keys, P…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.13.2)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


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

@openshift-ci openshift-ci Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 21, 2026
@openshift-ci

openshift-ci Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign everettraven for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-ci

openshift-ci Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@danielmellado: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants