Skip to content

CCXDEV-16094: add config option to disable runtime extractor #1248

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
opokornyy:CCXDEV-16094-disable-runtime-extractor-config
Mar 23, 2026
Merged

CCXDEV-16094: add config option to disable runtime extractor #1248
openshift-merge-bot[bot] merged 2 commits into
openshift:masterfrom
opokornyy:CCXDEV-16094-disable-runtime-extractor-config

Conversation

@opokornyy

@opokornyy opokornyy commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

This PR adds the disableRuntimeExtractor option to the insights ConfigMap so that users can disable the runtime-extractor functionality.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • pkg/config/configobserver/config_aggregator_test.go
  • pkg/config/legacy_config_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://issues.redhat.com/browse/???
https://access.redhat.com/solutions/???

Summary by CodeRabbit

  • New Features
    • A new boolean configuration option disableRuntimeExtractor has been added, allowing operators to control runtime extraction behavior on a per-deployment basis. This option is configurable through standard configuration files as well as through dynamic configuration map overrides, enabling flexible management of runtime extraction across various environments and deployment configurations without code changes.

This commit adds the disableRuntimeExtractor
option to the insights ConfigMap so that users
can disable the runtime-extractor functionality.

Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
Signed-off-by: Ondrej Pokorny <opokorny@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2026
@openshift-ci-robot

openshift-ci-robot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

@opokornyy: This pull request references CCXDEV-16094 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This PR adds the disableRuntimeExtractor option to the insights ConfigMap so that users can disable the runtime-extractor functionality.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • pkg/config/configobserver/config_aggregator_test.go
  • pkg/config/legacy_config_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://issues.redhat.com/browse/???
https://access.redhat.com/solutions/???

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2026
@openshift-ci openshift-ci Bot requested review from BaiyangZhou and ncaak March 11, 2026 09:06
@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This pull request adds a new boolean configuration field DisableRuntimeExtractor to the DataReporting structure. The field is defined in type definitions, parsed from serialized configuration, merged during config aggregation, and propagated through legacy config handlers with corresponding test updates.

Changes

Cohort / File(s) Summary
Type Definitions
pkg/config/types.go
Added DisableRuntimeExtractor field (string in DataReportingSerialized, bool in DataReporting) with JSON tag for serialization.
Config Parsing
pkg/config/config.go, pkg/config/legacy_config.go
Implemented parsing and propagation of DisableRuntimeExtractor field from serialized input to config objects; included in String() representation and legacy config structures (Serialized and Controller).
Config Aggregation
pkg/config/configobserver/config_aggregator.go
Added merging of DisableRuntimeExtractor from new config into default configuration when values differ.
Test Updates
pkg/config/configobserver/config_aggregator_test.go, pkg/config/legacy_config_test.go
Updated test fixtures and expected values to reflect the new field in DataReporting and Controller structs across test cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a config option to disable the runtime extractor, matching the changeset across multiple config-related files.
Description check ✅ Passed The PR description follows the repository template with all required sections completed, including clear explanation of the feature, appropriate category selection, unit tests listed, privacy consideration documented, and reference to the Jira ticket.
Stable And Deterministic Test Names ✅ Passed PR modifies standard Go tests, not Ginkgo tests. All test names are static and deterministic with no dynamic content.
Test Structure And Quality ✅ Passed Ginkgo test quality check is not applicable as the modified tests use standard Go testing.T with table-driven patterns, not Ginkgo tests.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci-robot

openshift-ci-robot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

@opokornyy: This pull request references CCXDEV-16094 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 "4.22.0" version, but no target version was set.

Details

In response to this:

This PR adds the disableRuntimeExtractor option to the insights ConfigMap so that users can disable the runtime-extractor functionality.

Categories

  • Bugfix
  • Data Enhancement
  • Feature
  • Backporting
  • Others (CI, Infrastructure, Documentation)

Sample Archive

  • None

Documentation

  • None

Unit Tests

  • pkg/config/configobserver/config_aggregator_test.go
  • pkg/config/legacy_config_test.go

Privacy

Yes. There are no sensitive data in the newly collected information.

Changelog

Breaking Changes

No

References

https://issues.redhat.com/browse/???
https://access.redhat.com/solutions/???

Summary by CodeRabbit

  • New Features
  • A new boolean configuration option disableRuntimeExtractor has been added, allowing operators to control runtime extraction behavior on a per-deployment basis. This option is configurable through standard configuration files as well as through dynamic configuration map overrides, enabling flexible management of runtime extraction across various environments and deployment configurations without code changes.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/config/configobserver/config_aggregator.go (1)

263-278: ⚠️ Potential issue | 🟠 Major

Add DisableRuntimeExtractor propagation from legacy config to InsightsConfiguration.

The legacyConfigToInsightsConfiguration() method omits DisableRuntimeExtractor when constructing the returned DataReporting struct. Although the field exists in config.Controller and is properly loaded from the legacy configuration source, this omission causes the value to be silently lost when converting to InsightsConfiguration. If a user sets disableRuntimeExtractor: true in the legacy config, it will not be reflected in the final merged configuration.

The field should be added to the returned struct:

DisableRuntimeExtractor: legacyConfig.DisableRuntimeExtractor,

Alternatively, if this omission is intentional (to allow only the config map to control this feature), add an explicit comment explaining the design decision.

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

In `@pkg/config/configobserver/config_aggregator.go` around lines 263 - 278, The
legacyConfigToInsightsConfiguration function is dropping the
DisableRuntimeExtractor flag when building the returned
config.InsightsConfiguration.DataReporting; update
legacyConfigToInsightsConfiguration to propagate DisableRuntimeExtractor by
setting DataReporting.DisableRuntimeExtractor =
legacyConfig.DisableRuntimeExtractor (referencing
legacyConfigToInsightsConfiguration, DataReporting and
legacyConfig.DisableRuntimeExtractor) or, if intentional, add a clear comment in
legacyConfigToInsightsConfiguration explaining why DisableRuntimeExtractor is
intentionally omitted and that only the config map controls it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@pkg/config/configobserver/config_aggregator.go`:
- Around line 263-278: The legacyConfigToInsightsConfiguration function is
dropping the DisableRuntimeExtractor flag when building the returned
config.InsightsConfiguration.DataReporting; update
legacyConfigToInsightsConfiguration to propagate DisableRuntimeExtractor by
setting DataReporting.DisableRuntimeExtractor =
legacyConfig.DisableRuntimeExtractor (referencing
legacyConfigToInsightsConfiguration, DataReporting and
legacyConfig.DisableRuntimeExtractor) or, if intentional, add a clear comment in
legacyConfigToInsightsConfiguration explaining why DisableRuntimeExtractor is
intentionally omitted and that only the config map controls it.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 735a0724-f1b3-4b0a-bcf6-5a357a591695

📥 Commits

Reviewing files that changed from the base of the PR and between a6b5cfd and f167a3c.

📒 Files selected for processing (6)
  • pkg/config/config.go
  • pkg/config/configobserver/config_aggregator.go
  • pkg/config/configobserver/config_aggregator_test.go
  • pkg/config/legacy_config.go
  • pkg/config/legacy_config_test.go
  • pkg/config/types.go

@BaiyangZhou

Copy link
Copy Markdown

/test insights-operator-e2e-tests

@BaiyangZhou

Copy link
Copy Markdown

/pj-rehearse pull-ci-openshift-insights-operator-master-insights-operator-slow-tests

@BaiyangZhou

Copy link
Copy Markdown

/test pull-ci-openshift-insights-operator-master-insights-operator-slow-tests

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

it looks good

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2026
@openshift-ci

openshift-ci Bot commented Mar 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncaak, opokornyy

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

@opokornyy

Copy link
Copy Markdown
Contributor Author

/verified by @opokornyy

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@opokornyy: This PR has been marked as verified by @opokornyy.

Details

In response to this:

/verified by @opokornyy

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.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@opokornyy

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Mar 23, 2026

Copy link
Copy Markdown

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

@openshift-merge-bot openshift-merge-bot Bot merged commit ae388f9 into openshift:master Mar 23, 2026
12 checks passed
@opokornyy

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

@openshift-cherrypick-robot

Copy link
Copy Markdown

@opokornyy: new pull request created: #1295

Details

In response to this:

/cherry-pick release-4.21

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.

@opokornyy

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.20

@openshift-cherrypick-robot

Copy link
Copy Markdown

@opokornyy: new pull request created: #1297

Details

In response to this:

/cherry-pick release-4.20

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants