Skip to content

[R4_4] Allow Persist only when debug / persist flag is enabled#2143

Open
nxtum wants to merge 4 commits into
rdkcentral:R4_4from
nxtum:EnablePersistFlag
Open

[R4_4] Allow Persist only when debug / persist flag is enabled#2143
nxtum wants to merge 4 commits into
rdkcentral:R4_4from
nxtum:EnablePersistFlag

Conversation

@nxtum
Copy link
Copy Markdown
Contributor

@nxtum nxtum commented Jun 2, 2026

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 10:55
@github-advanced-security
Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restricts runtime persistence of configuration overrides so that storing overrides is only possible in debug builds or when an explicit build flag is enabled, reducing the risk of unintended persistent configuration changes in production builds.

Changes:

  • Adds a new CMake option (ENABLE_PERSIST) that defines __ENABLE_PERSIST__ to allow persistence in non-debug builds.
  • Wraps persistence entrypoints behind #if defined(__DEBUG__) || defined(__ENABLE_PERSIST__) and returns “unavailable/disabled” otherwise.
  • Adds additional SYSLOG startup messages for persist/load operations and a success log when plugin override configuration is updated.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Source/WPEFramework/PluginServer.h Adds logging and compile-time gating for persisting the override file.
Source/WPEFramework/Controller.h Compile-time gating for the Storeconfig handler used by configuration persistence.
Source/WPEFramework/Controller.cpp Adds warning-suppression around deprecated configuration interface include; gates persistence and adds logs/HTTP messaging.
Source/plugins/IController.h Marks IConfiguration::Persist() as deprecated.
Source/CMakeLists.txt Introduces ENABLE_PERSIST option and defines __ENABLE_PERSIST__ when enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Source/WPEFramework/Controller.cpp Outdated
@nxtum nxtum requested a review from sebaszm June 2, 2026 11:05
Comment thread Source/WPEFramework/Controller.cpp Outdated
Comment thread Source/WPEFramework/Controller.cpp Outdated
Comment thread Source/WPEFramework/PluginServer.h Outdated
Comment thread Source/WPEFramework/Controller.cpp
Comment thread Source/WPEFramework/Controller.cpp Outdated
Copilot AI review requested due to automatic review settings June 2, 2026 15:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment on lines 2287 to 2289
if ((storage.Exists() == true) && (storage.Open(true) == true)) {
CC_SYSLOG("Loading persistent configuration override from [%s]", _fileName.c_str());

Comment on lines +4747 to +4751
#if defined(__DEBUG__) || defined(__ENABLE_PERSIST__)
const string fileName(Configuration().PersistentPath() + PluginOverrideFile);
CC_SYSLOG("Persisting configuration override to [%s]", fileName.c_str());

Override infoBlob(_config, _services, fileName);
Comment on lines +4753 to +4755
#else
CC_SYSLOG("Persist requested, but persistent configuration is disabled");
return (Core::ERROR_UNAVAILABLE);
Comment thread Source/WPEFramework/PluginServer.h Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 2, 2026 15:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Core::File storage(_fileName);

if ((storage.Exists() == true) && (storage.Open(true) == true)) {
CC_SYSLOG("Loading persistent configuration override from [%s]", _fileName.c_str());
Comment on lines +4748 to +4751
const string fileName(Configuration().PersistentPath() + PluginOverrideFile);
CC_SYSLOG("Persisting configuration override to [%s]", fileName.c_str());

Override infoBlob(_config, _services, fileName);
Comment on lines +4754 to +4755
CC_SYSLOG("Persist requested, but persistent configuration is disabled");
return (Core::ERROR_UNAVAILABLE);
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.

4 participants