Skip to content

CNF-26637: Deprecate minOffsetThreshold and use absolute offset comparison - #738

Open
vitus133 wants to merge 1 commit into
redhat-cne:mainfrom
vitus133:014-deprecate-min-offset-threshold
Open

CNF-26637: Deprecate minOffsetThreshold and use absolute offset comparison#738
vitus133 wants to merge 1 commit into
redhat-cne:mainfrom
vitus133:014-deprecate-min-offset-threshold

Conversation

@vitus133

@vitus133 vitus133 commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

In ptpClockThreshold, threshold configuration currently specifies both maxOffsetThreshold and minOffsetThreshold. Because timing offsets are symmetric, defining separate upper and lower offset boundaries is redundant.

minOffsetThreshold is deprecated in favor of a single absolute-value comparison against maxOffsetThreshold:

abs(offset) < maxOffsetThreshold

This PR updates isOffsetInRange() and its call sites in cloud-event-proxy to evaluate whether abs(offset) < maxOffsetThreshold (non-inclusive boundary, preserving existing comparison semantics).

Jira

Testing

  • Unit tests added in logparser_internal_test.go and config_test.go covering in-range, out-of-range positive/negative, exact non-inclusive boundary, and backward compatibility when minOffsetThreshold is omitted/zero/asymmetric.

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vitus133

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

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d750de8b-57e2-4688-bcb1-d802054e8c14


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.

@vitus133 vitus133 changed the title [PTP] Deprecate minOffsetThreshold and use absolute offset comparison CNF-26637: [PTP] Deprecate minOffsetThreshold and use absolute offset comparison Aug 17, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 17, 2026

Copy link
Copy Markdown

@vitus133: This pull request references CNF-26637 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 sub-task to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

In ptpClockThreshold, threshold configuration currently specifies both maxOffsetThreshold and minOffsetThreshold. Because timing offsets are symmetric, defining separate upper and lower offset boundaries is redundant.

minOffsetThreshold is deprecated in favor of a single absolute-value comparison against maxOffsetThreshold:

abs(offset) < maxOffsetThreshold

This PR updates isOffsetInRange() and its call sites in cloud-event-proxy to evaluate whether abs(offset) < maxOffsetThreshold (non-inclusive boundary, preserving existing comparison semantics).

Jira

Testing

  • Unit tests added in logparser_internal_test.go and config_test.go covering in-range, out-of-range positive/negative, exact non-inclusive boundary, and backward compatibility when minOffsetThreshold is omitted/zero/asymmetric.

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.

@vitus133 vitus133 changed the title CNF-26637: [PTP] Deprecate minOffsetThreshold and use absolute offset comparison CNF-26637: Deprecate minOffsetThreshold and use absolute offset comparison Aug 17, 2026
@vitus133
vitus133 force-pushed the 014-deprecate-min-offset-threshold branch from ec9d188 to d771c08 Compare August 17, 2026 16:51
Assisted by Opencode with Gemini
@vitus133
vitus133 force-pushed the 014-deprecate-min-offset-threshold branch from d771c08 to 985a351 Compare August 17, 2026 16:56
@vitus133
vitus133 marked this pull request as ready for review August 17, 2026 16:58
@vitus133

Copy link
Copy Markdown
Member Author

/verified later @dpopsuev

@openshift-ci-robot

Copy link
Copy Markdown

@vitus133: This PR has been marked to be verified later by @dpopsuev.

Details

In response to this:

/verified later @dpopsuev

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.

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.

2 participants