Skip to content

OCPBUGS-60769: telco-ran: update ptp4lConfig reference to tolerate ordering#690

Open
abraham2512 wants to merge 3 commits intoopenshift-kni:mainfrom
abraham2512:ptp4lConf-update
Open

OCPBUGS-60769: telco-ran: update ptp4lConfig reference to tolerate ordering#690
abraham2512 wants to merge 3 commits intoopenshift-kni:mainfrom
abraham2512:ptp4lConf-update

Conversation

@abraham2512
Copy link
Copy Markdown
Member

This PR updates the PtpConfigDualCardGmWpc reference CR to tolerate different ordering in ptp4lConf

@openshift-ci openshift-ci Bot requested review from imiller0 and yuvalk April 2, 2026 19:20
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: abraham2512
Once this PR has been reviewed and has the lgtm label, please assign irinamihai 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

@abraham2512 abraham2512 changed the title telco-ran: update ptp4lConfig reference to tolerate ordering OCPBUGS-60769: telco-ran: update ptp4lConfig reference to tolerate ordering Apr 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

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
📝 Walkthrough

Walkthrough

Consolidated repeated per-interface masterOnly 1 regex blocks into a single masterPorts capture in the PTP operator YAML and added a matching multiline captureGroup_defaults.masterPorts entry in the default values YAML. Changes affect two configuration YAML files only.

Changes

Cohort / File(s) Summary
PTP Operator Configuration
telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml
Replaced multiple named capture regexes for iface_timeTx1*/iface_timeTx2* (each followed by masterOnly 1) with a single multiline named capture masterPorts that aggregates the interface matches and inline masterOnly 1 occurrences.
Default Value Additions
telco-ran/configuration/kube-compare-reference/hack/default_value.yaml
Added ptp_operator_configuration_PtpConfigDualCardGmWpc.captureGroup_defaults.masterPorts: a multiline block enumerating the iface_timeTx1* and iface_timeTx2* capture-group patterns with masterOnly 1.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating PtpConfigDualCardGmWpc to tolerate different ordering in ptp4lConf, which aligns with the refactoring of capture patterns in the YAML configuration.
Description check ✅ Passed The description directly relates to the changeset, stating the PR updates PtpConfigDualCardGmWpc to tolerate different ordering in ptp4lConf, matching the actual modifications in both YAML files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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-robot
Copy link
Copy Markdown
Collaborator

@abraham2512: This pull request references Jira Issue OCPBUGS-60769, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This PR updates the PtpConfigDualCardGmWpc reference CR to tolerate different ordering in ptp4lConf

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In
`@telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml`:
- Around line 117-118: The current masterPorts regex aggregate (masterPorts)
allows any alphanumeric interface names and thus drops the shared named captures
iface_timeTx1 and iface_timeTx2 used by spec.profile.0.ts2phcConf and
spec.profile.0.ptp4lConf (metadata.yaml uses inlineDiffFunc: capturegroups),
breaking the enforced name-consistency; update the masterPorts matcher to
preserve per-interface named capture groups (iface_timeTx1 and iface_timeTx2)
instead of a generic alnum capture and make the pattern order-tolerant (like the
multi-card example PtpConfigThreeCardGmWpc.yaml) so ptp4lConf interface names
remain identical to those captured from ts2phcConf while allowing fields to
appear in any order.
🪄 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: Pro

Run ID: 9a7dfc71-d669-4800-8a3f-7864512e78c4

📥 Commits

Reviewing files that changed from the base of the PR and between 41d1b93 and 3da8892.

📒 Files selected for processing (1)
  • telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml

Comment on lines +117 to +118
(?<masterPorts>((\[[[:alnum:]]+\]
masterOnly 1| *#.*| *)(\n|$))+)
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 2, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C2 'pathToKey: spec\.profile\.0\.(ptp4lConf|ts2phcConf)|iface_timeTx1|iface_timeTx2|masterPorts' \
  telco-ran/configuration/kube-compare-reference

Repository: openshift-kni/telco-reference

Length of output: 36069


Keep the shared iface_timeTx1 / iface_timeTx2 capture names in this matcher.

Both spec.profile.0.ts2phcConf and spec.profile.0.ptp4lConf are configured with inlineDiffFunc: capturegroups in metadata.yaml (lines 288-291). Named capture groups are shared across these fields, and repeated names enforce consistency. The masterPorts aggregate capture on lines 117-118 accepts any alphanumeric interface names, breaking the requirement that ptp4lConf interface names must match those captured from ts2phcConf (iface_timeTx1 and iface_timeTx2). Preserve the per-interface named captures while making the block order-tolerant, consistent with other multi-card GM configurations like PtpConfigThreeCardGmWpc.yaml.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml`
around lines 117 - 118, The current masterPorts regex aggregate (masterPorts)
allows any alphanumeric interface names and thus drops the shared named captures
iface_timeTx1 and iface_timeTx2 used by spec.profile.0.ts2phcConf and
spec.profile.0.ptp4lConf (metadata.yaml uses inlineDiffFunc: capturegroups),
breaking the enforced name-consistency; update the masterPorts matcher to
preserve per-interface named capture groups (iface_timeTx1 and iface_timeTx2)
instead of a generic alnum capture and make the pattern order-tolerant (like the
multi-card example PtpConfigThreeCardGmWpc.yaml) so ptp4lConf interface names
remain identical to those captured from ts2phcConf while allowing fields to
appear in any order.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An interesting observation, but not as important as it seems. It's true that we did have an extra layer of validation with the named-capture groups in the ptp4lConf, but the flexibility of allowing different numbers and different ordering of this section outweights that minor benefit.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@lack, understood — the added flexibility in tolerating arbitrary ordering and varying numbers of masterOnly 1 port blocks is a deliberate trade-off over the stricter per-interface name validation. Thanks for the context!


📝 Learnings were identified and not saved (knowledge base disabled). Enable

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml (1)

117-118: ⚠️ Potential issue | 🟠 Major

Don't make the masterOnly preamble fully generic.

Line 117-Line 118 now match any alphanumeric masterOnly 1 block, so ptp4lConf no longer has to use the same iface_timeTx1 / iface_timeTx2 interfaces captured by phc2sysOpts, ts2phcConf, and the pins map. That weakens this reference from “the expected dual-card ports in any order” to “any ports in any order,” which is broader than the PR objective. Keep the order-tolerant structure, but preserve the explicit iface_timeTx* named captures in the matcher.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml`
around lines 117 - 118, The masterOnly preamble regex was made too generic and
loses the explicit iface_timeTx1/iface_timeTx2 captures used elsewhere
(ptp4lConf, phc2sysOpts, ts2phcConf, pins); update the (?<masterPorts>...) group
so it still allows multiple lines in any order but explicitly captures
iface_timeTx1 and iface_timeTx2 (use the same named capture tokens iface_timeTx1
and iface_timeTx2 inside the masterOnly block instead of a generic
[[:alnum:]]+), ensuring those named captures are present and consistent with
phc2sysOpts, ts2phcConf and pins while preserving order-tolerance and comments
handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml`:
- Around line 117-118: The masterOnly preamble regex was made too generic and
loses the explicit iface_timeTx1/iface_timeTx2 captures used elsewhere
(ptp4lConf, phc2sysOpts, ts2phcConf, pins); update the (?<masterPorts>...) group
so it still allows multiple lines in any order but explicitly captures
iface_timeTx1 and iface_timeTx2 (use the same named capture tokens iface_timeTx1
and iface_timeTx2 inside the masterOnly block instead of a generic
[[:alnum:]]+), ensuring those named captures are present and consistent with
phc2sysOpts, ts2phcConf and pins while preserving order-tolerance and comments
handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2e4050f-b36f-49b2-b24a-4fe41ac19ac0

📥 Commits

Reviewing files that changed from the base of the PR and between 3da8892 and 84f2f6f.

📒 Files selected for processing (2)
  • telco-ran/configuration/kube-compare-reference/hack/default_value.yaml
  • telco-ran/configuration/kube-compare-reference/ptp-operator/configuration/PtpConfigDualCardGmWpc.yaml

[(?<iface_timeTx2_2>[[:alnum:]]+)]
masterOnly 1
[(?<iface_timeTx2_3>[[:alnum:]]+)]
masterOnly 1
Copy link
Copy Markdown
Member

@lack lack Apr 7, 2026

Choose a reason for hiding this comment

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

I think this could be a bit clearer now; Maybe since the capturegroups aren't in use any more, we could go with something a bit more human-readable:

# Include one section for each TimeTransmitter port on the WPC cards:
[ens1f0]
masterOnly 1
[ens1f1]
masterOnly 1
[ens2f0]
masterOnly 1
[ens2f1]
masterOnly 1
# ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the reference with these interface names

@abraham2512 abraham2512 force-pushed the ptp4lConf-update branch 2 times, most recently from bcc1f87 to acc9006 Compare April 7, 2026 20:02
@abraham2512
Copy link
Copy Markdown
Member Author

/cc @lack

@openshift-ci openshift-ci Bot requested a review from lack April 7, 2026 20:51
captureGroup_defaults:
priority2: 128
domainNumber: 24
iface_timeRx: ens1f0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe use "$iface_timeRx" as the example, since which interface a customer will choose to be the time-receiver will be variable?

captureGroup_defaults:
priority2: 128
domainNumber: 24
iface_timeRx: ens1f0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

3 participants