Skip to content

ES-2822 - Added the upload-file method for esignet-signup#1963

Open
prathmeshj12 wants to merge 2 commits into
mosip:developfrom
prathmeshj12:develop
Open

ES-2822 - Added the upload-file method for esignet-signup#1963
prathmeshj12 wants to merge 2 commits into
mosip:developfrom
prathmeshj12:develop

Conversation

@prathmeshj12

@prathmeshj12 prathmeshj12 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for multipart form submissions that include transaction verification cookies.
    • Improved handling of file uploads and form fields in authenticated request flows.
    • Enhanced request logging behavior in debug mode for easier troubleshooting.

Signed-off-by: prathmeshj12 <prathmesh.j@cyberpwn.com>
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@prathmeshj12, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25fa502e-9157-4ec1-91c3-f720d2d9a247

📥 Commits

Reviewing files that changed from the base of the PR and between 400c477 and c957616.

📒 Files selected for processing (1)
  • apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/RestClient.java

Walkthrough

A new static method postWithMultiPartFileAndVerifiedTransactionCookie is added to RestClient. It builds a multipart POST request with XSRF_TOKEN and VERIFIED_TRANSACTION_ID_KEY cookies, attaches optional file parts and form fields, and conditionally logs the response when debug mode is enabled.

Changes

RestClient multipart POST helper

Layer / File(s) Summary
New multipart POST method with cookie and debug logging
apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/RestClient.java
Adds postWithMultiPartFileAndVerifiedTransactionCookie that sets XSRF_TOKEN and VERIFIED_TRANSACTION_ID_KEY cookies, attaches optional file and form-field multipart parts, posts to the URL-mapped endpoint, and conditionally logs response body and time via LogMaskingUtil when debug is enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A new path through the POST we've laid,
With cookies set and files conveyed,
The token verified, the form fields sent,
Debug logs masked, no detail bent,
Hop along — the request is made!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly matches the main change: adding an upload-file multipart method for esignet-signup.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/RestClient.java`:
- Around line 222-224: The multipart form field loop in RestClient should handle
a null map the same way files already do, instead of calling
multiPartFormFields.entrySet() unconditionally. Add a null check around the
multiPartFormFields iteration in the request-building path so requests with no
extra fields can still proceed. Keep the fix localized to the multipart handling
logic in RestClient.
🪄 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: edfa070f-b3c4-4cea-9af2-459d68a21d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 17d361a and 400c477.

📒 Files selected for processing (1)
  • apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/RestClient.java

Comment thread apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/RestClient.java Outdated
Signed-off-by: prathmeshj12 <prathmesh.j@cyberpwn.com>
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.

1 participant