Skip to content

ROX-33555: Add sensor cap checks for SensorAck for node scanning#19418

Open
vikin91 wants to merge 2 commits intomasterfrom
piotr/ROX-33555-sensor-ack-node-scanning
Open

ROX-33555: Add sensor cap checks for SensorAck for node scanning#19418
vikin91 wants to merge 2 commits intomasterfrom
piotr/ROX-33555-sensor-ack-node-scanning

Conversation

@vikin91
Copy link
Contributor

@vikin91 vikin91 commented Mar 13, 2026

Description

This PR scopes the node-scanning ACK refactor isolated from #19323.

What changed:

  • Added central/sensor/service/common/sensor_ack.go with shared helpers to send:
    • capability-gated SensorACK
    • legacy NodeInventoryACK (always, for backward compatibility)
  • Updated Central node scanning pipelines to use the shared helper path:
    • nodeinventory ACK path
    • nodeindex ACK path
  • Extended node pipeline tests to validate both ACK channels.

Before/after behavior example:

  • Before: Central could emit SensorACK for node scanning regardless of Sensor capability.
  • After: Central emits SensorACK for node scanning only when Sensor advertises SensorACKSupport; legacy NodeInventoryACK remains emitted for compatibility.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • CI
  • On a cluser: Confirmed SensorACK is sent from Central to Sensor by looking at:
    • Sensor debug logs
    • Sensor metrics

@openshift-ci
Copy link

openshift-ci bot commented Mar 13, 2026

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

@vikin91
Copy link
Contributor Author

vikin91 commented Mar 13, 2026

@vikin91 vikin91 marked this pull request as ready for review March 13, 2026 15:38
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The recordingInjectorWithCapabilities type is duplicated in both nodeinventory and nodeindex tests; consider extracting a shared test helper (or extending recordingInjector with a default HasCapability implementation) to avoid repetition and keep capability behavior consistent across tests.
  • SendSensorACK silently returns when the injector does not implement capabilityChecker; if this is expected only for older/non-production injectors, consider documenting that assumption or adding a small debug log/TODO so it’s clearer when SensorACKs might be skipped due to injector type rather than capability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `recordingInjectorWithCapabilities` type is duplicated in both nodeinventory and nodeindex tests; consider extracting a shared test helper (or extending `recordingInjector` with a default `HasCapability` implementation) to avoid repetition and keep capability behavior consistent across tests.
- `SendSensorACK` silently returns when the injector does not implement `capabilityChecker`; if this is expected only for older/non-production injectors, consider documenting that assumption or adding a small debug log/TODO so it’s clearer when SensorACKs might be skipped due to injector type rather than capability.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rhacs-bot
Copy link
Contributor

rhacs-bot commented Mar 13, 2026

Images are ready for the commit at 8b9adc1.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-319-g8b9adc1f14.

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 35.71429% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.70%. Comparing base (25425ae) to head (8b9adc1).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
central/sensor/service/common/sensor_ack.go 0.00% 36 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19418      +/-   ##
==========================================
- Coverage   49.71%   49.70%   -0.01%     
==========================================
  Files        2701     2702       +1     
  Lines      203453   203465      +12     
==========================================
- Hits       101144   101140       -4     
- Misses      94782    94805      +23     
+ Partials     7527     7520       -7     
Flag Coverage Δ
go-unit-tests 49.70% <35.71%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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