Skip to content

MOSIP-44737 Changed PARTNER_API_URL to use new api /admin-partner/v2 - #1641

Merged
dhanendra06 merged 32 commits into
mosip:developfrom
kameshsr:develop-MOSIP-44737.2
Jul 28, 2026
Merged

MOSIP-44737 Changed PARTNER_API_URL to use new api /admin-partner/v2#1641
dhanendra06 merged 32 commits into
mosip:developfrom
kameshsr:develop-MOSIP-44737.2

Conversation

@kameshsr

@kameshsr kameshsr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added richer partner details in partner responses, including certificate metadata, logos, and additional structured info.
    • Enhanced partner retrieval with paginated fetching and merged results.
    • Updated partner lookup flow used during credential request processing.
  • Bug Fixes

    • Improved partner matching and caching by using both partner ID and partner type.
    • Improved handling for empty/missing partner data and safer response shaping.
  • Tests

    • Added/updated coverage for v2-to-v1 field mapping, pagination behavior, and error handling.

Signed-off-by: kameshsr <kameshsr1338@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Partner-manager v2 integration expands partner metadata, updates endpoint configuration, adds cached issuer lookups, makes partner matching null-safe, and retrieves partner-type lists through paginated v2 responses transformed to the existing partner shape.

Changes

Partner API v2 integration

Layer / File(s) Summary
Partner response contract
resident/resident-service/src/main/java/io/mosip/resident/dto/PartnerResponseDto.java
PartnerResponseDto adds certificate, identity, logo, timestamp, and structured metadata fields while renaming existing properties.
Partner endpoint selection and issuer cache
resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java, resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java, resident/resident-service/src/main/java/io/mosip/resident/util/PartnerByIssuerCache.java, resident/resident-service/src/main/java/io/mosip/resident/util/Utility.java, resident/resident-service/src/main/resources/application-local.properties, resident/resident-service/src/test/resources/bootstrap.properties, resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentCredentialServiceTest.java
Partner endpoints move to admin-partners v2, credential requests use cached issuer-based lookup, and scheduled eviction clears the issuer cache.
Partner lookup and response handling
resident/resident-service/src/main/java/io/mosip/resident/constant/ResidentConstants.java, resident/resident-service/src/main/java/io/mosip/resident/service/impl/PartnerServiceImpl.java, resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
Partner constants support v2 and UI fields; list extraction, null handling, partner-type-aware cache keys, and partner matching are updated.
Paginated partner retrieval and transformation
resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java, resident/resident-service/src/test/java/io/mosip/resident/util/PartnersByPartnerTypeTest.java, resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java
Partner pages are merged and converted to the expected partner shape, with coverage for pagination, mappings, query parameters, empty responses, and errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Poem

Pages hop through v2 light,
Fields bloom in richer flight.
Issuers find a cached way,
Old endpoints drift away.
Merged partners land in line,
Tests keep every map in time.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.42% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches a real part of the PR, but it understates the broader partner API refactor beyond the URL change.
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.
✨ 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.

kameshsr added 2 commits June 30, 2026 14:35
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

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

Inline comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java`:
- Line 175: The partner URL lookup in ResidentCredentialServiceImpl now depends
on ApiName.PARTNER_API_URL_V2, so update the checked-in runtime profile
configuration to define PARTNER_API_URL_V2 alongside the existing partner URL
entries. Make sure the new property is present in the committed profile files
used at runtime so env.getProperty(ApiName.PARTNER_API_URL_V2.name()) resolves
correctly before concatenating with dto.getIssuer().

In
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java`:
- Around line 39-40: Validate the configured resident.partner.list.page.size
before it is used in PartnersByPartnerType, since a zero or negative pageSize
can be passed through to the partner-manager request and break pagination. Add a
guard in the flow that builds the query params (including the code paths around
the current pageSize usage and the related logic at the later referenced lines)
to ensure pageSize is positive, and fall back to a safe default or fail fast
with a clear error before calling the partner-manager API.
- Around line 80-90: Update testGetPartnersByPartnerTypeV2 in
ProxyPartnerManagementServiceTest to return a paginated Map<String, Object>
matching PartnersByPartnerType.getPartnersByPartnerType() expectations,
including totalResults and data, instead of a plain "Response" string. Make sure
the mocked responseWrapper.getResponse() now aligns with the new casting logic
in PartnersByPartnerType so the test exercises the map-based contract without
failing on the cast.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c4115674-0020-4fae-aa9e-b0deac9482aa

📥 Commits

Reviewing files that changed from the base of the PR and between 02a1ea7 and d36ab65.

📒 Files selected for processing (3)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java

kameshsr added 2 commits June 30, 2026 17:42
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java (1)

134-153: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a real multi-page merge case here.

This stub only returns one page, so it won't catch regressions in the new pagination loop. Please chain two getApi(...) responses and assert that both partners are present in the merged data list.

🤖 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
`@resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java`
around lines 134 - 153, The current test for ProxyPartnerManagementServiceTest
only mocks a single page, so it does not exercise the pagination merge logic in
getPartnersByPartnerType. Update the test to stub
residentServiceRestClient.getApi(...) with two sequential ResponseWrapper
responses representing separate pages, then verify the merged ResponseWrapper<?>
contains both partner entries in the final response data list. Use the existing
partnerByPartnerType setup and the getPartnersByPartnerType method to keep the
test aligned with the new pagination loop.
🤖 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.

Inline comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java`:
- Around line 47-58: The partner lookup in ProxyPartnerManagementServiceImpl
currently caches results without accounting for partnerType, which can return
stale or incorrect partner details across types. Update the cache key used by
the method that calls partnersByPartnerTypeCache.getPartnersByPartnerType so it
includes both partnerId and partnerType, and make sure any cache lookup/build
logic in this path uses the same combined key consistently.

---

Nitpick comments:
In
`@resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java`:
- Around line 134-153: The current test for ProxyPartnerManagementServiceTest
only mocks a single page, so it does not exercise the pagination merge logic in
getPartnersByPartnerType. Update the test to stub
residentServiceRestClient.getApi(...) with two sequential ResponseWrapper
responses representing separate pages, then verify the merged ResponseWrapper<?>
contains both partner entries in the final response data list. Use the existing
partnerByPartnerType setup and the getPartnersByPartnerType method to keep the
test aligned with the new pagination loop.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d839079-e463-4479-b263-76abd07406b0

📥 Commits

Reviewing files that changed from the base of the PR and between d36ab65 and b84733e.

📒 Files selected for processing (5)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ResidentConstants.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/PartnerServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
  • resident/resident-service/src/test/java/io/mosip/resident/service/impl/PartnerServiceImplTest.java
  • resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java

kameshsr added 2 commits June 30, 2026 18:24
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
resident/resident-service/src/main/resources/application-local.properties (1)

258-260: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Inverted naming convention between PARTNER_API_URL and PARTNER_API_URL_V2.

PARTNER_API_URL now points to the v2 admin-partners endpoint (list/paginated), while PARTNER_API_URL_V2 points to the v1 partners endpoint (single-partner lookup). This is semantically inverted: the "V2" suffix denotes the older API version for single lookups, while the non-suffixed name denotes the newer v2 API. This naming mismatch is confusing and may lead to future maintenance errors.

Consider renaming to align with semantic meaning, e.g.:

  • PARTNER_API_URLPARTNER_ADMIN_API_URL or PARTNER_LIST_API_URL
  • PARTNER_API_URL_V2PARTNER_DETAIL_API_URL or keep as PARTNER_API_URL_V2 but swap which endpoint each points to

At minimum, ensure the comment on Line 259-260 clearly explains this inversion so future maintainers don't misroute calls.

🤖 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 `@resident/resident-service/src/main/resources/application-local.properties`
around lines 258 - 260, The partner API properties are semantically inverted:
PARTNER_API_URL points to the admin-partners v2 endpoint while
PARTNER_API_URL_V2 points to the single-partner v1 endpoint used by
ResidentCredentialServiceImpl. Update the naming to match the actual usage, or
swap the assignments so the suffixes align with the endpoint versions; if you
keep the current names, clarify this inversion in the inline comment near
PARTNER_API_URL_V2 so future changes in ResidentCredentialServiceImpl and
related config references don’t misroute calls.
🤖 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.

Nitpick comments:
In `@resident/resident-service/src/main/resources/application-local.properties`:
- Around line 258-260: The partner API properties are semantically inverted:
PARTNER_API_URL points to the admin-partners v2 endpoint while
PARTNER_API_URL_V2 points to the single-partner v1 endpoint used by
ResidentCredentialServiceImpl. Update the naming to match the actual usage, or
swap the assignments so the suffixes align with the endpoint versions; if you
keep the current names, clarify this inversion in the inline comment near
PARTNER_API_URL_V2 so future changes in ResidentCredentialServiceImpl and
related config references don’t misroute calls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c98c2cc-7d57-4db5-88d8-71bbaf638f86

📥 Commits

Reviewing files that changed from the base of the PR and between b84733e and 62db2d6.

📒 Files selected for processing (5)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java
  • resident/resident-service/src/main/resources/application-local.properties
  • resident/resident-service/src/test/resources/bootstrap.properties
💤 Files with no reviewable changes (1)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java

@kameshsr
kameshsr changed the base branch from develop to MOSIP-44737-develop July 1, 2026 10:03
@kameshsr
kameshsr changed the base branch from MOSIP-44737-develop to develop July 13, 2026 07:13
Signed-off-by: kameshsr <kameshsr1338@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java (1)

96-109: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add a fallback termination condition to prevent silent data truncation.

If totalResults is not a Number (e.g., returned as a String or missing), it stays at the initial value of 0. The loop condition mergedData.size() < totalResults then evaluates to mergedData.size() < 0, which is always false, so the loop terminates after the first page — silently returning incomplete partner data.

Adding a pageData.size() < effectivePageSize break detects the last page independently of totalResults.

🛡️ Proposed fix
                mergedData.addAll(pageData);
+               if (pageData.size() < effectivePageSize) {
+                   // Last page reached; don't rely solely on totalResults.
+                   break;
+               }
                pageNo++;
            } while (mergedData.size() < totalResults);
🤖 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
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java`
around lines 96 - 109, Update the pagination loop in PartnersByPartnerType
around totalResults, pageData, and mergedData so it also terminates when
pageData.size() is smaller than the effective page size, regardless of
totalResults validity. Preserve the existing empty-page break and ensure valid
totalResults pagination continues while incomplete final pages stop without
truncating data.
🧹 Nitpick comments (1)
resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java (1)

132-162: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a multi-page pagination test.

testGetPartnersByPartnerTypeV2 only covers a single-page scenario (totalResults=1). The core pagination loop — page accumulation, loop termination via totalResults, and multi-page merging — is untested. A test with totalResults > pageSize that mocks multiple API responses and verifies all partners are merged would exercise this critical path.

🤖 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
`@resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java`
around lines 132 - 162, The testGetPartnersByPartnerTypeV2 test only validates
one response page; extend it to cover pagination by setting totalResults beyond
the configured page size, mocking successive residentServiceRestClient.getApi
responses for multiple pages, and verifying all partners are merged into the
result. Also verify the client is invoked once per page and pagination
terminates when the accumulated results reach totalResults.
🤖 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.

Inline comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/service/impl/PartnerServiceImpl.java`:
- Around line 41-46: Update the partner ID handling in toV1Partners to retrieve
PMS_PARTNER_ID safely, check for null before converting it to a string, and skip
malformed partner records without adding an ID or aborting the entire list
retrieval.

---

Outside diff comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java`:
- Around line 96-109: Update the pagination loop in PartnersByPartnerType around
totalResults, pageData, and mergedData so it also terminates when
pageData.size() is smaller than the effective page size, regardless of
totalResults validity. Preserve the existing empty-page break and ensure valid
totalResults pagination continues while incomplete final pages stop without
truncating data.

---

Nitpick comments:
In
`@resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java`:
- Around line 132-162: The testGetPartnersByPartnerTypeV2 test only validates
one response page; extend it to cover pagination by setting totalResults beyond
the configured page size, mocking successive residentServiceRestClient.getApi
responses for multiple pages, and verifying all partners are merged into the
result. Also verify the client is invoked once per page and pagination
terminates when the accumulated results reach totalResults.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f7b7e143-55be-42cf-acf3-f41196c9b12e

📥 Commits

Reviewing files that changed from the base of the PR and between 62db2d6 and 5d6b634.

📒 Files selected for processing (5)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ResidentConstants.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/PartnerServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java
  • resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java

kameshsr added 9 commits July 13, 2026 12:57
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
@kameshsr

Copy link
Copy Markdown
Contributor Author

@CodeRabbit please review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@kameshsr I’ll review the changes in #1641, with particular attention to downstream API compatibility, pagination/error handling, caching, and sensitive partner data handling.

✅ Action performed

Review finished.

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 coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java (1)

48-124: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Add an iteration cap to the pagination loop.

The loop is bounded by pageData emptiness, so it isn't truly infinite, but a corrupted/oversized totalResults from partner-manager v2 combined with many non-empty pages could drive a long chain of blocking synchronous REST calls on the caller's thread with no upper bound. A small safety cap protects this resident-facing path from a slow/hanging request.

♻️ Proposed fix
+        final int maxIterations = 1000; // safety cap; a legitimate partner list should never need this many pages
+        int iterations = 0;
         try {
             do {
+                if (++iterations > maxIterations) {
+                    logger.error("Aborting partner list pagination after {} pages - possible corrupt totalResults", maxIterations);
+                    break;
+                }
                 List<String> pathsegements = null;
🤖 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
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java`
around lines 48 - 124, Update getPartnersByPartnerType pagination to enforce a
small maximum page-iteration cap in addition to the existing totalResults and
empty-page conditions. Track iterations using the existing pageNo or a dedicated
counter, stop requesting further pages once the cap is reached, and preserve the
current merge and response behavior for pages processed within the limit.
🤖 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.

Inline comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnerByIssuerCache.java`:
- Around line 31-37: Update the `@Cacheable` configuration on getPartnerByIssuer
so unsuccessful or empty partner lookups are excluded from partnerByIssuerCache.
Use an unless condition that checks the returned ResponseWrapper and prevents
caching when it is null or its response payload (getResponse()) is null, while
preserving caching for valid partner responses.

In
`@resident/resident-service/src/test/java/io/mosip/resident/util/PartnersByPartnerTypeTest.java`:
- Around line 108-366: Rename every test method in PartnersByPartnerTypeTest to
follow the should_<expectedBehavior>_when_<condition> convention, including
testV2FieldsMappedToV1Aliases, testAllPagesAreFetchedAndMerged, and
testInvalidPageSizeFallsBackToDefault. Preserve each test’s behavior and use
descriptive expected-behavior and condition segments for all mapping,
pagination, query-parameter, empty-response, and error-path cases.

---

Outside diff comments:
In
`@resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java`:
- Around line 48-124: Update getPartnersByPartnerType pagination to enforce a
small maximum page-iteration cap in addition to the existing totalResults and
empty-page conditions. Track iterations using the existing pageNo or a dedicated
counter, stop requesting further pages once the cap is reached, and preserve the
current merge and response behavior for pages processed within the limit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 841b6b0d-1424-4ff1-8d24-d5bf25f93f2a

📥 Commits

Reviewing files that changed from the base of the PR and between 62db2d6 and 4e206d5.

📒 Files selected for processing (13)
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ResidentConstants.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/PartnerServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnerByIssuerCache.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/PartnersByPartnerType.java
  • resident/resident-service/src/main/java/io/mosip/resident/util/Utility.java
  • resident/resident-service/src/main/resources/application-local.properties
  • resident/resident-service/src/test/java/io/mosip/resident/service/impl/ProxyPartnerManagementServiceTest.java
  • resident/resident-service/src/test/java/io/mosip/resident/service/impl/ResidentCredentialServiceTest.java
  • resident/resident-service/src/test/java/io/mosip/resident/util/PartnersByPartnerTypeTest.java
  • resident/resident-service/src/test/resources/bootstrap.properties
💤 Files with no reviewable changes (2)
  • resident/resident-service/src/test/resources/bootstrap.properties
  • resident/resident-service/src/main/java/io/mosip/resident/constant/ApiName.java

kameshsr added 3 commits July 23, 2026 16:08
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
kameshsr added 10 commits July 23, 2026 17:33
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
@kameshsr
kameshsr requested a review from ashok-ksharma July 28, 2026 10:52
Signed-off-by: kameshsr <kameshsr1338@gmail.com>
@dhanendra06
dhanendra06 merged commit 5f346ef into mosip:develop Jul 28, 2026
13 checks passed
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.

3 participants