Skip to content

Better centralise configuration reading across inputs#769

Merged
jviotti merged 1 commit into
mainfrom
centralise-config
Jun 4, 2026
Merged

Better centralise configuration reading across inputs#769
jviotti merged 1 commit into
mainfrom
centralise-config

Conversation

@jviotti

@jviotti jviotti commented Jun 4, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Jun 4, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR centralizes configuration loading/caching so multiple call sites can share the same parsed configuration instance.

Changes:

  • Extracted a cached load_configuration helper from read_configuration (keyed by optional configuration path).
  • Moved the schema applicability check (applies_to) into a thin read_configuration wrapper that can return an empty configuration when extensions don’t match.
  • Updated input processing to reuse load_configuration when merging ignore rules and when iterating over explicit inputs.

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 👎

@augmentcode augmentcode 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.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@cubic-dev-ai cubic-dev-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.

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

Comment thread src/configuration.h
}

inline auto read_configuration(
inline auto load_configuration(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>

@jviotti jviotti merged commit e48f4de into main Jun 4, 2026
15 checks passed
@jviotti jviotti deleted the centralise-config branch June 4, 2026 15:59
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.

1 participant