Skip to content

SDKS-4927 Rename AgreementCollector to ReadOnlyTextCollector to align with the DaVinci READ_ONLY_TEXT input type#195

Open
witrisna wants to merge 1 commit intodevelopfrom
SDKS-4927-2
Open

SDKS-4927 Rename AgreementCollector to ReadOnlyTextCollector to align with the DaVinci READ_ONLY_TEXT input type#195
witrisna wants to merge 1 commit intodevelopfrom
SDKS-4927-2

Conversation

@witrisna
Copy link
Copy Markdown
Contributor

@witrisna witrisna commented May 4, 2026

JIRA Ticket

SDKS-4927

Description

  • Rename AgreementCollector to ReadOnlyTextCollector across the library and sample applications to better represent its function of displaying read-only content.
  • Update CollectorRegistry to map the READ_ONLY_TEXT factory key to the renamed ReadOnlyTextCollector.
  • Rename the Agreement Compose UI component to ReadOnlyText and update its references in both sample apps.
  • Update ContinueNode in sample applications to handle the ReadOnlyTextCollector type.
  • Migrate and rename unit tests from AgreementCollectorTest.kt to ReadOnlyTextCollectorTest.kt.
  • Update documentation in davinci/README.md to list ReadOnlyTextCollector as an available collector.

Summary by CodeRabbit

  • Refactor

    • Renamed the agreement-style collector to "ReadOnlyText" across the SDK and sample apps; UI components and runtime dispatch now use the new collector.
  • Documentation

    • README updated to list ReadOnlyText in available collectors.
  • Tests

    • Test suite updated to target and validate the renamed ReadOnlyText collector.

@witrisna witrisna requested a review from forgerock-chris May 4, 2026 16:59
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 399ced29-ae58-42f5-a4db-0ecc75ca395c

📥 Commits

Reviewing files that changed from the base of the PR and between 5bfefbd and 5db6121.

📒 Files selected for processing (8)
  • davinci/README.md
  • davinci/src/main/kotlin/com/pingidentity/davinci/CollectorRegistry.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/ReadOnlyTextCollector.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/ReadOnlyTextCollectorTest.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/collector/ContinueNode.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/collector/ReadOnlyText.kt
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/ReadOnlyText.kt
✅ Files skipped from review due to trivial changes (3)
  • davinci/README.md
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/collector/ReadOnlyText.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/ReadOnlyTextCollectorTest.kt
🚧 Files skipped from review as they are similar to previous changes (3)
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/CollectorRegistry.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/ReadOnlyTextCollector.kt

📝 Walkthrough

Walkthrough

Renames AgreementCollector → ReadOnlyTextCollector and updates all bindings, imports, sample composables, tests, and README references to use ReadOnlyTextCollector and READ_ONLY_TEXT factory registration.

Changes

Collector Rename and Integration

Layer / File(s) Summary
Core Collector Class
davinci/src/main/kotlin/.../collector/ReadOnlyTextCollector.kt
Class renamed from AgreementCollector to ReadOnlyTextCollector; KDoc updated and init() now returns ReadOnlyTextCollector; properties (content, title, titleEnabled, nested agreement fields) and JSON parsing unchanged.
Registry Binding
davinci/src/main/kotlin/.../CollectorRegistry.kt
Import updated and CollectorFactory.register("READ_ONLY_TEXT", ::ReadOnlyTextCollector) replaces the previous AgreementCollector registration.
Tests
davinci/src/test/kotlin/.../ReadOnlyTextCollectorTest.kt
Test class and imports renamed; tests now instantiate and assert against ReadOnlyTextCollector with the same test cases and expectations.
Sample UI Components
samples/.../collector/ReadOnlyText.kt, samples/pingsampleapp/.../collector/ReadOnlyText.kt
Composable renamed from Agreement(field: AgreementCollector) to ReadOnlyText(field: ReadOnlyTextCollector); rendering (title conditional, scrollable content) remains the same, parameter type updated.
Collector Dispatch (Wiring)
samples/app/.../collector/ContinueNode.kt, samples/pingsampleapp/.../collector/DaVinciContinueNode.kt
Dispatch branches updated: removed AgreementCollector case and added ReadOnlyTextCollector case calling ReadOnlyText(it); imports adjusted.
Documentation
davinci/README.md
Updated “currently available collectors” list: ReadOnlyTextCollector added and AgreementCollector removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ForgeRock/ping-android-sdk#182: Modifies the same READ_ONLY_TEXT collector registration and replaces AgreementCollector with ReadOnlyTextCollector in code and samples.

Suggested reviewers

  • spetrov
  • vibhorgoswami
  • vahancouver

Poem

🐰 I hopped through code in morning light,
Swapped an Agreement for ReadOnlyText so bright,
Imports and tests all hopped in line,
Registry and UI now tidy and fine,
A small clean change — a carrot-coded delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 and specifically describes the main change: renaming AgreementCollector to ReadOnlyTextCollector to align with the DaVinci READ_ONLY_TEXT input type, which matches the changeset across all modified files.
Description check ✅ Passed The description follows the template with a linked JIRA ticket and comprehensive description of all changes made, including renaming the collector class, updating registry, renaming UI components, updating tests, and documentation.
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-4927-2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@witrisna witrisna requested review from spetrov and vibhorgoswami and removed request for forgerock-chris May 4, 2026 16:59
@coderabbitai coderabbitai Bot temporarily deployed to github-pages May 4, 2026 17:02 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 (1)
samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt (1)

1-6: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Copyright header should use the year range 2025-2026 for new source files.

The copyright header must include both 2025 and 2026 per the coding guidelines for new source files (.kt). Update the header from Copyright (c) 2026 to Copyright (c) 2025-2026 Ping Identity Corporation.

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

In
`@samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt`
around lines 1 - 6, Update the file header in DaVinciContinueNode.kt to use the
required year range; replace the single-year copyright line "Copyright (c) 2026
Ping Identity Corporation" with "Copyright (c) 2025-2026 Ping Identity
Corporation" so the top-of-file comment conforms to the new-source-file
guideline.
🧹 Nitpick comments (1)
davinci/README.md (1)

107-109: ⚡ Quick win

ReadOnlyTextCollector is listed but lacks a dedicated API documentation section.

Every other collector in the README has a #### section describing its accessible properties (e.g., #### LabelCollector (LABEL), #### SingleSelectCollector (DROPDOWN, RADIO)). ReadOnlyTextCollector is only mentioned in the summary sentence, leaving its API undocumented for SDK consumers.

📝 Suggested documentation section to add after the `SingleSelectCollector` block
+#### ReadOnlyTextCollector (READ_ONLY_TEXT)
+
+```kotlin
+readOnlyTextCollector.key                 // The form field key
+readOnlyTextCollector.type                // The type value from the server (e.g., "AGREEMENT")
+readOnlyTextCollector.content             // The read-only text content to display
+readOnlyTextCollector.title               // The optional title
+readOnlyTextCollector.titleEnabled        // Whether the title is shown
+readOnlyTextCollector.enabled             // Whether this collector is active
+readOnlyTextCollector.agreementId         // The associated agreement definition ID
+readOnlyTextCollector.useDynamicAgreement // Whether content is loaded dynamically
+```

Would you like me to open a new issue to track adding documentation sections for any other undocumented collectors?

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

In `@davinci/README.md` around lines 107 - 109, Add a dedicated API docs section
for ReadOnlyTextCollector in the README mirroring other collectors: create a
"#### ReadOnlyTextCollector (READ_ONLY_TEXT)" block after the
SingleSelectCollector section and document its accessible properties (e.g.,
readOnlyTextCollector.key, readOnlyTextCollector.type,
readOnlyTextCollector.content, readOnlyTextCollector.title,
readOnlyTextCollector.titleEnabled, readOnlyTextCollector.enabled,
readOnlyTextCollector.agreementId, readOnlyTextCollector.useDynamicAgreement)
with brief one-line descriptions for each to match the style used by
LabelCollector and SingleSelectCollector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt`:
- Around line 1-6: Update the file header in DaVinciContinueNode.kt to use the
required year range; replace the single-year copyright line "Copyright (c) 2026
Ping Identity Corporation" with "Copyright (c) 2025-2026 Ping Identity
Corporation" so the top-of-file comment conforms to the new-source-file
guideline.

---

Nitpick comments:
In `@davinci/README.md`:
- Around line 107-109: Add a dedicated API docs section for
ReadOnlyTextCollector in the README mirroring other collectors: create a "####
ReadOnlyTextCollector (READ_ONLY_TEXT)" block after the SingleSelectCollector
section and document its accessible properties (e.g., readOnlyTextCollector.key,
readOnlyTextCollector.type, readOnlyTextCollector.content,
readOnlyTextCollector.title, readOnlyTextCollector.titleEnabled,
readOnlyTextCollector.enabled, readOnlyTextCollector.agreementId,
readOnlyTextCollector.useDynamicAgreement) with brief one-line descriptions for
each to match the style used by LabelCollector and SingleSelectCollector.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4c31c87f-facd-42ea-8bfb-0c8bd64bd611

📥 Commits

Reviewing files that changed from the base of the PR and between 19ae5fa and 5bfefbd.

📒 Files selected for processing (8)
  • davinci/README.md
  • davinci/src/main/kotlin/com/pingidentity/davinci/CollectorRegistry.kt
  • davinci/src/main/kotlin/com/pingidentity/davinci/collector/ReadOnlyTextCollector.kt
  • davinci/src/test/kotlin/com/pingidentity/davinci/ReadOnlyTextCollectorTest.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/collector/ContinueNode.kt
  • samples/app/src/main/java/com/pingidentity/samples/app/davinci/collector/ReadOnlyText.kt
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/DaVinciContinueNode.kt
  • samples/pingsampleapp/src/main/java/com/pingidentity/samples/pingsampleapp/davinci/collector/ReadOnlyText.kt

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.28%. Comparing base (b6b9773) to head (5db6121).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #195      +/-   ##
=============================================
+ Coverage      44.27%   44.28%   +0.01%     
  Complexity      1276     1276              
=============================================
  Files            310      310              
  Lines           9334     9334              
  Branches        1353     1353              
=============================================
+ Hits            4133     4134       +1     
  Misses          4637     4637              
+ Partials         564      563       -1     
Flag Coverage Δ
integration-tests 28.71% <50.00%> (+0.02%) ⬆️
unit-tests 25.47% <100.00%> (-0.02%) ⬇️

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.

Copy link
Copy Markdown
Contributor

@vibhorgoswami vibhorgoswami left a comment

Choose a reason for hiding this comment

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

LGTM!

…lign with the DaVinci `READ_ONLY_TEXT` input type

- Rename `AgreementCollector` to `ReadOnlyTextCollector` across the library and sample applications to better represent its function of displaying read-only content.
- Update `CollectorRegistry` to map the `READ_ONLY_TEXT` factory key to the renamed `ReadOnlyTextCollector`.
- Rename the `Agreement` Compose UI component to `ReadOnlyText` and update its references in both sample apps.
- Update `ContinueNode` in sample applications to handle the `ReadOnlyTextCollector` type.
- Migrate and rename unit tests from `AgreementCollectorTest.kt` to `ReadOnlyTextCollectorTest.kt`.
- Update documentation in `davinci/README.md` to list `ReadOnlyTextCollector` as an available collector.
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.

2 participants