Better centralise configuration reading across inputs#769
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
🤖 Augment PR SummarySummary: This PR centralizes configuration loading/caching so multiple call sites can share the same parsed configuration instance. Changes:
Technical Notes: The new structure keeps parsing/IO centralized while preserving schema-specific filtering at the higher-level API boundary. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/configuration.h">
<violation number="1" location="src/configuration.h:31">
P2: `load_configuration` does not wrap JSON parsing failures from `parse_json`, so malformed configuration files can now surface without consistent file-context error wrapping on the newly centralized call paths.
(Based on your team's feedback about reusing centralized wrapper errors.) [FEEDBACK_USED].</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| } | ||
|
|
||
| inline auto read_configuration( | ||
| inline auto load_configuration( |
There was a problem hiding this comment.
P2: load_configuration does not wrap JSON parsing failures from parse_json, so malformed configuration files can now surface without consistent file-context error wrapping on the newly centralized call paths.
(Based on your team's feedback about reusing centralized wrapper errors.) .
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/configuration.h, line 31:
<comment>`load_configuration` does not wrap JSON parsing failures from `parse_json`, so malformed configuration files can now surface without consistent file-context error wrapping on the newly centralized call paths.
(Based on your team's feedback about reusing centralized wrapper errors.) .</comment>
<file context>
@@ -28,22 +28,19 @@ inline auto find_configuration(const std::filesystem::path &path)
}
-inline auto read_configuration(
+inline auto load_configuration(
const sourcemeta::core::Options &options,
- const std::optional<std::filesystem::path> &configuration_path,
</file context>
Signed-off-by: Juan Cruz Viotti jv@jviotti.com