Skip to content

SDKS-4919: Match iOS and change richText to content.#197

Merged
vibhorgoswami merged 2 commits intodevelopfrom
SDKS-4919-UpdateRichContentVariable
May 5, 2026
Merged

SDKS-4919: Match iOS and change richText to content.#197
vibhorgoswami merged 2 commits intodevelopfrom
SDKS-4919-UpdateRichContentVariable

Conversation

@vibhorgoswami
Copy link
Copy Markdown
Contributor

@vibhorgoswami vibhorgoswami commented May 5, 2026

JIRA Ticket

(SDKS-4919)[https://pingidentity.atlassian.net/browse/SDKS-4919]

Description

Match iOS variable naming to keep content instead of richText as part of the json response parsing.

Summary by CodeRabbit

  • Refactor
    • Unified rich-text handling across the SDK and samples for more consistent label and token rendering.
  • Bug Fixes
    • Token placeholders and HTML in labels now render consistently, including correct trailing text and link placeholders.
    • When rich content is missing, fallback label content will render as HTML if it contains HTML tags.
  • Tests
    • Updated tests to align with the revised rich-text behavior.

@vibhorgoswami vibhorgoswami self-assigned this May 5, 2026
@vibhorgoswami vibhorgoswami requested a review from spetrov May 5, 2026 17:21
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

Renames 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.

Changes

RichContent Field Rename & Wiring

Layer / File(s) Summary
Data Shape
davinci/src/main/kotlin/com/pingidentity/davinci/RichContent.kt
Rename constructor property richText: Stringcontent: String; update KDoc to describe content and replacements.
Parsing / Model Construction
davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt, davinci/src/main/kotlin/com/pingidentity/davinci/collector/BooleanCollector.kt
Collectors construct RichContent(content = ...) from JSON. LabelCollector only initializes richContent when richContent JSON exists (otherwise leaves it null); BooleanCollector uses content = ... and falls back to empty string.
Rendering / Tokenization
samples/app/src/main/java/.../davinci/RichText.kt, samples/pingsampleapp/src/main/java/.../davinci/RichText.kt
Token scanning, substring appends, and HTML detection now read from richContent.content. When richContent == null, fallbackContent may be parsed as HTML if it contains tags.
Tests / Validation
davinci/src/androidTest/kotlin/.../FormFieldsTest.kt, davinci/src/test/kotlin/.../BooleanCollectorTest.kt, davinci/src/test/kotlin/.../LabelCollectorTest.kt
Assertions updated to assert richContent.content (or richContent == null where applicable) instead of richContent.richText; imports updated to support null assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • spetrov
  • vahancouver
  • witrisna

Poem

🐇 A little rename hops through the tree,
richText becomes content — clear as can be.
Collectors and renderers follow the trail,
Tests nod and the samples set sail.
A rabbit applauds the tidy new key.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the JIRA ticket (SDKS-4919) and accurately summarizes the main change: renaming the richText field to content to match iOS naming conventions.
Description check ✅ Passed The description includes the required JIRA ticket link and a brief explanation of the change. It covers the main purpose of aligning with iOS variable naming for the content field.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-4919-UpdateRichContentVariable

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.

Copy link
Copy Markdown
Contributor

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

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 win

Adjust 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.

Suggested fix
- * Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
+ * Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.
Based on learnings: existing modified Kotlin/Java files should use a year range from original creation year through current year (e.g., `2025-2026`).
🤖 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 win

Update 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.

Suggested fix
- * Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
+ * Copyright (c) 2025-2026 Ping Identity Corporation. All rights reserved.
Based on learnings: existing modified Kotlin/Java files should use a year range from original creation year through current year (e.g., `2025-2026`).
🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between b6b9773 and 6b62ad5.

📒 Files selected for processing (8)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/FormFieldsTest.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/RichContent.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/BooleanCollector.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/BooleanCollectorTest.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.kt
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/RichText.kt

@coderabbitai coderabbitai Bot temporarily deployed to github-pages May 5, 2026 17:25 Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.29%. Comparing base (b6b9773) to head (663862e).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...m/pingidentity/davinci/collector/LabelCollector.kt 50.00% 0 Missing and 6 partials ⚠️
...pingidentity/davinci/collector/BooleanCollector.kt 0.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
integration-tests 28.71% <50.00%> (+0.02%) ⬆️
unit-tests 25.49% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@vibhorgoswami vibhorgoswami force-pushed the SDKS-4919-UpdateRichContentVariable branch from 6e734a5 to 663862e Compare May 5, 2026 18:28
Copy link
Copy Markdown

@vahancouver vahancouver left a comment

Choose a reason for hiding this comment

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

LGTM

@coderabbitai coderabbitai Bot temporarily deployed to github-pages May 5, 2026 18:32 Inactive
Copy link
Copy Markdown
Contributor

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

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 win

KDoc in buildRichTextLabel still references the old richText field name.

Both numbered points reference richText instead of content, 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 win

Copyright year must be updated to reflect modification in 2026.

Since LabelCollector.kt was 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 win

KDoc is now factually incorrect after the behavior change.

The comment "Falls back to [content] if no richContent is present" no longer applies — richContent is null when 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b62ad5 and 663862e.

📒 Files selected for processing (6)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/FormFieldsTest.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/BooleanCollector.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/LabelCollector.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/LabelCollectorTest.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/RichText.kt
  • samples/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

@vibhorgoswami vibhorgoswami merged commit 0985fc1 into develop May 5, 2026
51 of 55 checks passed
@vibhorgoswami vibhorgoswami deleted the SDKS-4919-UpdateRichContentVariable branch May 5, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants