Skip to content

refactor: implement properties file strategies for Forage configuration management - #482

Open
matheusandre1 wants to merge 1 commit into
KaotoIO:mainfrom
matheusandre1:issue157
Open

refactor: implement properties file strategies for Forage configuration management#482
matheusandre1 wants to merge 1 commit into
KaotoIO:mainfrom
matheusandre1:issue157

Conversation

@matheusandre1

@matheusandre1 matheusandre1 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Closes: #157

Summary by CodeRabbit

  • New Features
    • Added configurable properties-file strategies for Forage configuration.
    • Supports consolidating configuration in application.properties.
    • Supports separate factory-specific forage-*.properties files.
    • Configuration read, write, and delete operations now discover and manage files according to the selected strategy.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 683b713f-e6c8-4fcb-9956-3c4aca67926d

📥 Commits

Reviewing files that changed from the base of the PR and between 1927d54 and 618ea75.

📒 Files selected for processing (5)
  • tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ApplicationPropertiesStrategy.java
  • tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ConfigReadCommand.java
  • tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ConfigWriteCommand.java
  • tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ForageMultiFileStrategy.java
  • tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/PropertiesFileStrategy.java

📝 Walkthrough

Walkthrough

Configuration read and write commands now use a strategy abstraction to select, match, resolve, and scan properties files. Application-wide and catalog-driven multi-file strategies provide the concrete behavior.

Changes

Configuration strategy resolution

Layer / File(s) Summary
Strategy contracts and implementations
tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/PropertiesFileStrategy.java, .../ApplicationPropertiesStrategy.java, .../ForageMultiFileStrategy.java
Defines the strategy contract and implements application-wide and catalog-derived properties-file behavior.
Read command strategy integration
tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ConfigReadCommand.java
Initializes the selected strategy and delegates target filename and wildcard matching during file discovery.
Write command strategy integration
tooling/camel-jbang-plugin-forage/src/main/java/io/kaoto/forage/plugin/config/ConfigWriteCommand.java
Delegates output filename resolution and deletable properties-file scanning to the selected strategy.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: croway

Poem

A rabbit hops through files with care,
One path here, many paths there.
Strategies choose the names just right,
Then guide the reader, writer’s flight.
Configuration blooms tonight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: refactoring Forage configuration management to use property-file strategies.
Linked Issues check ✅ Passed The PR implements the requested strategy pattern by replacing conditional config file logic with strategy-based read/write resolution.
Out of Scope Changes check ✅ Passed The changes stay focused on configuration read/write strategy refactoring and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

TODO: use a strategy pattern for the config readers/writers

1 participant