Skip to content

feat(DataMapper): Members of collection choice inherit collection sem…#3215

Open
mmelko wants to merge 1 commit into
KaotoIO:mainfrom
mmelko:fix/3167-collection-choice-members
Open

feat(DataMapper): Members of collection choice inherit collection sem…#3215
mmelko wants to merge 1 commit into
KaotoIO:mainfrom
mmelko:fix/3167-collection-choice-members

Conversation

@mmelko
Copy link
Copy Markdown
Contributor

@mmelko mmelko commented May 14, 2026

…antics (#3167)

  • Add isFieldInsideCollectionChoiceWrapper() helper to check if field is inside collection choice
  • Update DocumentService.isCollectionField() to consider collection choice inheritance
  • Update VisualizationUtilService.isCollectionField() documentation
  • Add comprehensive tests for collection choice inheritance
  • Add tests using TestDocument.xsd CollectionChoiceElement
  • Verify non-collection choice members are unaffected (no regression)

Fixes #3167

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Warning

Rate limit exceeded

@mmelko has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 13 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e4801c1-1ecb-435b-bfe2-e98b818079e1

📥 Commits

Reviewing files that changed from the base of the PR and between 053fe3f and 47504d3.

📒 Files selected for processing (3)
  • packages/ui/src/services/document/document.service.test.ts
  • packages/ui/src/services/document/document.service.ts
  • packages/ui/src/services/visualization/visualization-util.service.ts
✨ 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 and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (053fe3f) to head (47504d3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3215   +/-   ##
=======================================
  Coverage   92.25%   92.26%           
=======================================
  Files         636      636           
  Lines       24633    24641    +8     
  Branches     5843     5848    +5     
=======================================
+ Hits        22726    22734    +8     
  Misses       1797     1797           
  Partials      110      110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmelko mmelko force-pushed the fix/3167-collection-choice-members branch from 5403ad5 to f9941ba Compare May 14, 2026 13:11
@mmelko
Copy link
Copy Markdown
Contributor Author

mmelko commented May 14, 2026

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 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.

…antics (KaotoIO#3167)

- Add isFieldInsideCollectionChoiceWrapper() helper to check if field is inside collection choice
- Update DocumentService.isCollectionField() to consider collection choice inheritance
- Update VisualizationUtilService.isCollectionField() documentation
- Add comprehensive tests for collection choice inheritance
- Add tests using TestDocument.xsd CollectionChoiceElement
- Verify non-collection choice members are unaffected (no regression)

Fixes KaotoIO#3167
@mmelko mmelko force-pushed the fix/3167-collection-choice-members branch from f9941ba to 47504d3 Compare May 14, 2026 14:15
@mmelko mmelko marked this pull request as ready for review May 14, 2026 14:15
@sonarqubecloud
Copy link
Copy Markdown

@mmelko mmelko requested a review from a team May 14, 2026 18:17
Copy link
Copy Markdown
Member

@igarashitm igarashitm left a comment

Choose a reason for hiding this comment

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

Just one test stub organization, otherwise LGTM 👍

it('should identify members of collection choice as collection fields', async () => {
const mockApi = {
getResourceContent: jest.fn().mockResolvedValue(`
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="test" xmlns:ns0="test">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you use existing TestDocument.xsd or create a new stub XSD file in src/stubs/datamapper/xml so that it could be used to reproduce it manually? It would be better if one XSD file can serve all test cases added here.

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.

xs:choice: Members of collection choice inherit collection

2 participants