Skip to content

RHINENG-25948: add ff for refreshing advisory cache - #2167

Merged
TenSt merged 1 commit into
RedHatInsights:masterfrom
TenSt:stepan/RHINENG-25948-create-feature-flag-for-refreshing-advisory-caches-in-vmaas-sync
Apr 22, 2026
Merged

TenSt merged 1 commit into
RedHatInsights:masterfrom
TenSt:stepan/RHINENG-25948-create-feature-flag-for-refreshing-advisory-caches-in-vmaas-sync

Conversation

@TenSt

@TenSt TenSt commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

This PR creates a feature flag to enable/disable refreshing of advisory caches in vmaas sync task. Defaults to enabled.

Summary by Sourcery

Enhancements:

  • Introduce a configurable feature flag to enable or disable advisory cache refresh during vmaas sync, with logging when the refresh is disabled.

@TenSt
TenSt requested a review from a team as a code owner April 21, 2026 14:05
@sourcery-ai

sourcery-ai Bot commented Apr 21, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a feature-flag-controlled gate around advisory cache refresh in the vmaas sync task, defaulting to enabled via pod configuration.

File-Level Changes

Change Details Files
Gate advisory cache refresh in the vmaas sync flow behind a feature flag.
  • Wrap the advisory cache refresh call in a conditional check against a new feature flag
  • Log an informational message when advisory cache refresh is disabled instead of performing the refresh
tasks/vmaas_sync/vmaas_sync.go
Introduce pod-config-backed feature flag for advisory cache refresh with a default of true.
  • Define a new EnableAdvisoryCacheRefresh configuration variable sourced from PodConfig
  • Document that this flag controls advisory cache refresh behavior in vmaas_sync
tasks/config.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tasks/vmaas_sync/vmaas_sync.go" line_range="115-122" />
<code_context>

 	// refresh caches
-	caches.RefreshAdvisoryCaches()
+	if tasks.EnableAdvisoryCacheRefresh {
+		caches.RefreshAdvisoryCaches()
+	} else {
+		utils.LogInfo("Advisory cache refresh is disabled")
+	}

</code_context>
<issue_to_address>
**suggestion:** Consider lowering the log level or throttling the "cache refresh disabled" message to avoid log noise.

Because `SyncData` may be called frequently, this `LogInfo` will be emitted on every call while advisory refresh is disabled, creating excessive log noise. Consider downgrading to debug level or logging this only once (e.g., on first evaluation of the flag) instead of on every invocation.

```suggestion
	// refresh caches
	if tasks.EnableAdvisoryCacheRefresh {
		caches.RefreshAdvisoryCaches()
	} else {
		utils.LogDebug("Advisory cache refresh is disabled")
	}

	utils.LogInfo("Data sync finished successfully")
```
</issue_to_address>

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.

Comment thread tasks/vmaas_sync/vmaas_sync.go
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.10%. Comparing base (6b850ba) to head (a76274e).

Files with missing lines Patch % Lines
tasks/vmaas_sync/vmaas_sync.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2167      +/-   ##
==========================================
- Coverage   59.11%   59.10%   -0.01%     
==========================================
  Files         134      134              
  Lines        8741     8744       +3     
==========================================
+ Hits         5167     5168       +1     
- Misses       3031     3032       +1     
- Partials      543      544       +1     
Flag Coverage Δ
unittests 59.10% <50.00%> (-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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TenSt
TenSt merged commit d62ef60 into RedHatInsights:master Apr 22, 2026
8 checks passed
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