[R4_4] Allow Persist only when debug / persist flag is enabled#2143
Open
nxtum wants to merge 4 commits into
Open
[R4_4] Allow Persist only when debug / persist flag is enabled#2143nxtum wants to merge 4 commits into
nxtum wants to merge 4 commits into
Conversation
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:
For more information about GitHub Code Scanning, check out the documentation. |
Contributor
There was a problem hiding this comment.
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.
sebaszm
requested changes
Jun 2, 2026
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); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.