SDKS-4919: Match iOS and change richText to content.#197
SDKS-4919: Match iOS and change richText to content.#197vibhorgoswami merged 2 commits intodevelopfrom
Conversation
📝 WalkthroughWalkthroughRenames RichContent.richText → RichContent.content and updates all callers, parsers, renderers, and tests to use the new field; LabelCollector now leaves richContent null when absent and BooleanCollector/fetchers pass content explicitly. ChangesRichContent Field Rename & Wiring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt (1)
2-2:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdjust copyright header to include 2026 for this modified file.
For an existing file updated in 2026, Line 2 should be a range (
2025-2026) instead of a single year.Based on learnings: existing modified Kotlin/Java files should use a year range from original creation year through current year (e.g., `2025-2026`).Suggested fix
- * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt` at line 2, Update the file header in LabelCollectorTest.kt: replace the single-year copyright "2025" with a year range "2025-2026" so modified Kotlin/Java files reflect original creation through current year (e.g., change the line containing "Copyright (c) 2025 Ping Identity Corporation. All rights reserved." to use "2025-2026").davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt (1)
2-2:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUpdate copyright year range for this modified existing file.
Line 2 should include the current year range (e.g.,
2025-2026) for a file modified in 2026.Based on learnings: existing modified Kotlin/Java files should use a year range from original creation year through current year (e.g., `2025-2026`).Suggested fix
- * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt` at line 2, Update the copyright year range in LabelCollector.kt to reflect the modification year span; replace the single year "2025" on the top copyright line with the range "2025-2026" so the file header shows the original creation year through the current year (e.g., change the line containing "Copyright (c) 2025 Ping Identity Corporation. All rights reserved." to "Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt`:
- Line 2: Update the copyright year range in LabelCollector.kt to reflect the
modification year span; replace the single year "2025" on the top copyright line
with the range "2025-2026" so the file header shows the original creation year
through the current year (e.g., change the line containing "Copyright (c) 2025
Ping Identity Corporation. All rights reserved." to "Copyright (c) 2025-2026
Ping Identity Corporation. All rights reserved.").
In `@davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt`:
- Line 2: Update the file header in LabelCollectorTest.kt: replace the
single-year copyright "2025" with a year range "2025-2026" so modified
Kotlin/Java files reflect original creation through current year (e.g., change
the line containing "Copyright (c) 2025 Ping Identity Corporation. All rights
reserved." to use "2025-2026").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3f715994-f54a-467c-bbb6-7b27dab4fa49
📒 Files selected for processing (8)
davinci/src/androidTest/kotlin/com/pingidentity/davinci/FormFieldsTest.ktdavinci/src/main/kotlin/com/pingidentity/davinci/RichContent.ktdavinci/src/main/kotlin/com/pingidentity/davinci/collector/BooleanCollector.ktdavinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.ktdavinci/src/test/kotlin/com/pingidentity/davinci/BooleanCollectorTest.ktdavinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.ktsamples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.ktsamples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/RichText.kt
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #197 +/- ##
=============================================
+ Coverage 44.27% 44.29% +0.01%
+ Complexity 1276 1275 -1
=============================================
Files 310 310
Lines 9334 9335 +1
Branches 1353 1354 +1
=============================================
+ Hits 4133 4135 +2
Misses 4637 4637
+ Partials 564 563 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6e734a5 to
663862e
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
samples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.kt (1)
69-72:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winKDoc in
buildRichTextLabelstill references the oldrichTextfield name.Both numbered points reference
richTextinstead ofcontent, which is a leftover from the rename.📝 Proposed fix
- * 1. **Token replacement** — `richText` contains `{{token}}` placeholders → + * 1. **Token replacement** — `content` contains `{{token}}` placeholders → * inline clickable links are substituted from [richContent]. - * 2. **HTML** — `richText` contains HTML tags → + * 2. **HTML** — `content` contains HTML tags →🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@samples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.kt` around lines 69 - 72, KDoc for buildRichTextLabel still mentions the old field name richText; update both numbered points to reference the renamed field content and ensure any inline code/backticks use `content` instead of `richText` so the documentation matches the current model and function parameters.davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt (2)
2-2:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winCopyright year must be updated to reflect modification in 2026.
Since
LabelCollector.ktwas originally created in 2025 (as shown by the existing header) and is being modified in this PR, the header must use the year-range format.🛠️ Proposed fix
-* Copyright (c) 2025 Ping Identity Corporation. All rights reserved. +* Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.Based on learnings: "For existing files that are being modified, use a year range from the original creation year through the current year (e.g., 'Copyright (c) 2025-2026 Ping Identity Corporation')."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt` at line 2, Update the file header in LabelCollector.kt to use a year range reflecting the original creation year through the current year; replace the single year "2025" with "2025-2026" in the top-of-file copyright comment (the file/class to locate is LabelCollector or the header comment at the top of LabelCollector.kt).
44-48:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winKDoc is now factually incorrect after the behavior change.
The comment "Falls back to
[content]if norichContentis present" no longer applies —richContentisnullwhen absent, and callers (e.g.,buildRichTextLabel) handle the fallback themselves. This could mislead consumers into assuming the field is always non-null or has an implicit default.📝 Proposed fix
- /** - * Rich content, potentially containing `{{tokenName}}` placeholders - * that should be substituted with entries from [RichContentReplacement]. - * Falls back to [content] if no `richContent` is present. - */ + /** + * Rich content, potentially containing `{{tokenName}}` placeholders + * that should be substituted with entries from [RichContentReplacement]. + * `null` when no `richContent` object is present in the JSON input; + * callers should use [content] as the fallback in that case. + */🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt` around lines 44 - 48, Update the KDoc on the richContent property in LabelCollector to remove the inaccurate "Falls back to [content] if no `richContent` is present" statement and instead document that richContent is nullable (may be null when absent) and that callers such as buildRichTextLabel are responsible for performing any fallback to content/other defaults; reference the property name richContent and the consumer method buildRichTextLabel in the updated comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt`:
- Line 2: Update the file header in LabelCollector.kt to use a year range
reflecting the original creation year through the current year; replace the
single year "2025" with "2025-2026" in the top-of-file copyright comment (the
file/class to locate is LabelCollector or the header comment at the top of
LabelCollector.kt).
- Around line 44-48: Update the KDoc on the richContent property in
LabelCollector to remove the inaccurate "Falls back to [content] if no
`richContent` is present" statement and instead document that richContent is
nullable (may be null when absent) and that callers such as buildRichTextLabel
are responsible for performing any fallback to content/other defaults; reference
the property name richContent and the consumer method buildRichTextLabel in the
updated comment.
In `@samples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.kt`:
- Around line 69-72: KDoc for buildRichTextLabel still mentions the old field
name richText; update both numbered points to reference the renamed field
content and ensure any inline code/backticks use `content` instead of `richText`
so the documentation matches the current model and function parameters.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 96792c94-1a53-4b66-aca1-64a85b3339ce
📒 Files selected for processing (6)
davinci/src/androidTest/kotlin/com/pingidentity/davinci/FormFieldsTest.ktdavinci/src/main/kotlin/com/pingidentity/davinci/collector/BooleanCollector.ktdavinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.ktdavinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.ktsamples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.ktsamples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/RichText.kt
✅ Files skipped from review due to trivial changes (1)
- davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt
🚧 Files skipped from review as they are similar to previous changes (2)
- davinci/src/androidTest/kotlin/com/pingidentity/davinci/FormFieldsTest.kt
- samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/RichText.kt
JIRA Ticket
(SDKS-4919)[https://pingidentity.atlassian.net/browse/SDKS-4919]
Description
Match iOS variable naming to keep
contentinstead ofrichTextas part of the json response parsing.Summary by CodeRabbit