Skip to content

Comments

chore(SchemaPropertyFilter): upd deprecated fun + added tests#81

Merged
PVinaches merged 1 commit intoKaotoIO:mainfrom
PVinaches:schemaPropertyFilter
Feb 20, 2026
Merged

chore(SchemaPropertyFilter): upd deprecated fun + added tests#81
PVinaches merged 1 commit intoKaotoIO:mainfrom
PVinaches:schemaPropertyFilter

Conversation

@PVinaches
Copy link
Member

@PVinaches PVinaches commented Feb 16, 2026

Updated deprecated fields() and added tests for SchemaPropertyFilter

fix: KaotoIO/kaoto#2968

Summary by CodeRabbit

  • Tests

    • Added unit tests covering schema property filtering: removal of blocklisted properties and correct handling inside nested option arrays.
  • Refactor

    • Aligned iteration with current library usage, added a brief documentation comment, and applied minor formatting improvements.

@PVinaches PVinaches force-pushed the schemaPropertyFilter branch 2 times, most recently from 01ec409 to 453c6a8 Compare February 17, 2026 11:09
@PVinaches PVinaches marked this pull request as ready for review February 17, 2026 11:09
@PVinaches PVinaches requested a review from a team February 17, 2026 11:09
@igarashitm
Copy link
Member

Looks like a file is missing from the commit (catalog/index.json), maybe a generated file from the build

Run if [[ -n $(git status --porcelain) ]]; then
❌ Uncommitted changes detected after building the catalog.

🔧 It looks like the catalog generator has been modified, but the generated files in the 'catalog/' folder were not committed.

✅ To fix this:
   1. Run 'yarn build' (this builds the catalog and copies it to the root 'catalog/' folder).
   2. Commit the updated files using:
      git add catalog && git commit -m "Update generated catalog"

🔁 This ensures that the repository always reflects the current state of the generator.

HEAD detached at pull/81/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   catalog/index.json

no changes added to commit (use "git add" and/or "git commit -a")
Error: Process completed with exit code 1.

@lhein
Copy link

lhein commented Feb 18, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

Replaced iteration over JSON properties in SchemaPropertyFilter to use Jackson's properties().forEach, added a JavaDoc for the constructor, and added unit tests validating removal of blocklisted properties (including inside oneOf/anyOf) and no-op behavior for non-blocklisted EIPs.

Changes

Cohort / File(s) Summary
SchemaPropertyFilter Implementation
src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java
Added constructor JavaDoc; changed iteration from properties().forEachRemaining(...) to properties().forEach(...); minor formatting tweaks.
SchemaPropertyFilter Tests
src/test/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilterTest.java
New unit test class covering removal of blocklisted properties (when, otherwise) at top-level and inside oneOf/anyOf, plus a test ensuring no filtering when EIP isn't blocklisted.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 I nibbled through nodes both near and far,
Removed the bits that tangled up the jar,
Swapped a loop for a kinder dance,
Wrote tests to catch each chance,
A tiny hop toward schema clarity.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes do not directly implement the linked issue #2968 objective of enhancing the generic 'parameters' schema property with title and description fields; instead, only updates deprecated API usage and adds tests for filtering logic. Implement the schema enhancement for the 'parameters' property to include 'title' and 'description' fields as specified in issue #2968, or clarify if this PR is preparatory work for that implementation.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions updating deprecated functions and adding tests, which aligns with the code changes showing replacement of forEachRemaining with forEach and new test class additions.
Out of Scope Changes check ✅ Passed The changes to SchemaPropertyFilter (JavaDoc addition and API modernization) and new comprehensive tests are directly related to maintaining and improving the filtering functionality, which is within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java (1)

14-19: Tighten Javadoc wording for clarity.

Consider using present tense and a shorter phrasing (e.g., “Deletes properties from the schema so form construction doesn’t create extra containers such as ‘steps’.”).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java`
around lines 14 - 19, Update the Javadoc on SchemaPropertyFilter to use present
tense and a shorter, clearer phrasing; replace the existing long paragraph with
something like: "Deletes properties from the schema so form construction doesn’t
create extra containers such as 'steps'." Ensure this comment is applied to the
SchemaPropertyFilter class (or its constructor) declaration so the purpose is
concise and immediately clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java`:
- Around line 14-19: Update the Javadoc on SchemaPropertyFilter to use present
tense and a shorter, clearer phrasing; replace the existing long paragraph with
something like: "Deletes properties from the schema so form construction doesn’t
create extra containers such as 'steps'." Ensure this comment is applied to the
SchemaPropertyFilter class (or its constructor) declaration so the purpose is
concise and immediately clear.

  added tests

Apply spacing suggestion from @lordrip

Co-authored-by: Ricardo M. <lordrip@gmail.com>
@PVinaches PVinaches force-pushed the schemaPropertyFilter branch from b0919b0 to e416a56 Compare February 20, 2026 09:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java (1)

14-19: Tighten the constructor JavaDoc for clarity.
The intent is good, but the wording is hard to parse. A shorter statement will be clearer.

✍️ Suggested wording
-    /** 
-     * Deleted properties from the schema so that in the construction
-     * of the forms they don't influence the creation of container
-     * i.e. adding an extra component or extra container named steps
-     * as steps include inside the components and EIPs
-     */
+    /**
+     * Removes schema properties so form construction does not create
+     * extra containers/components (e.g., an unintended "steps" container).
+     */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java`
around lines 14 - 19, Update the constructor JavaDoc of SchemaPropertyFilter to
a concise, clearer sentence stating that certain schema properties are removed
so they don't affect form construction (preventing creation of extra components
or extra "steps" containers), e.g., "Remove schema properties that would
otherwise introduce extra components or 'steps' containers during form
construction." Edit the JavaDoc immediately above the SchemaPropertyFilter
constructor to replace the existing paragraph with this tightened wording.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/java/io/kaoto/camelcatalog/generators/SchemaPropertyFilter.java`:
- Around line 14-19: Update the constructor JavaDoc of SchemaPropertyFilter to a
concise, clearer sentence stating that certain schema properties are removed so
they don't affect form construction (preventing creation of extra components or
extra "steps" containers), e.g., "Remove schema properties that would otherwise
introduce extra components or 'steps' containers during form construction." Edit
the JavaDoc immediately above the SchemaPropertyFilter constructor to replace
the existing paragraph with this tightened wording.

@PVinaches PVinaches merged commit 345533f into KaotoIO:main Feb 20, 2026
2 checks passed
@PVinaches PVinaches deleted the schemaPropertyFilter branch February 20, 2026 10:19
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.

Show generic key/value component for schemaless Camel components

4 participants