Skip to content

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

Merged
vitus133 merged 1 commit into
redhat-cne:mainfrom
vitus133:014-deprecate-min-offset-threshold
Aug 26, 2026
Merged

CNF-26637: Deprecate minOffsetThreshold and use absolute offset comparison#738
vitus133 merged 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

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e074e73-2faa-47ae-9d48-c50449533985


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

Comment thread plugins/ptp_operator/metrics/manager.go Outdated
Comment thread plugins/ptp_operator/metrics/manager.go Outdated
Comment thread plugins/ptp_operator/metrics/manager.go Outdated
Comment thread plugins/ptp_operator/metrics/manager.go Outdated
Comment thread plugins/ptp_operator/metrics/manager.go Outdated
Comment thread plugins/ptp_operator/metrics/manager.go Outdated

@nocturnalastro nocturnalastro 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

Assisted by Opencode with Gemini and Claude
@vitus133
vitus133 force-pushed the 014-deprecate-min-offset-threshold branch from a32a68a to 79ef649 Compare August 25, 2026 10:46
@openshift-ci openshift-ci Bot removed the lgtm label Aug 25, 2026

@nocturnalastro nocturnalastro 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 added the lgtm label Aug 25, 2026
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nocturnalastro, 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:
  • OWNERS [nocturnalastro,vitus133]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

@vitus133
vitus133 enabled auto-merge (squash) August 26, 2026 10:13
@vitus133
vitus133 merged commit 5c50d4d into redhat-cne:main Aug 26, 2026
14 checks passed
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