Add support for variant branches in Entry and Query classes#108
Add support for variant branches in Entry and Query classes#108reeshika-h wants to merge 4 commits into
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
Pull request overview
Adds variant-branch scoping support to the Android Delivery SDK’s request builders by extending Entry and Query with new variants(..., branch) overloads, and updates tests/config to exercise the new behavior.
Changes:
- Added
variants(String variantUid, String branch)andvariants(String[] variantUids, String branch)overloads toQueryandEntrythat setx-cs-variant-uidandbranchheaders. - Added/expanded unit tests to validate header-setting behavior for variants with and without branch.
- Added new Android instrumentation test cases and a
BuildConfigfield (variantBranch) to drive integration tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| contentstack/src/main/java/com/contentstack/sdk/Query.java | Adds variants(..., branch) overloads that populate x-cs-variant-uid and branch headers. |
| contentstack/src/main/java/com/contentstack/sdk/Entry.java | Adds variants(..., branch) overloads for entries to set variant + branch headers. |
| contentstack/src/test/java/com/contentstack/sdk/TestQuery.java | Adds Robolectric unit tests for Query.variants(...) header behavior, including branch handling. |
| contentstack/src/test/java/com/contentstack/sdk/TestEntryComprehensive.java | Adds Robolectric unit tests for Entry.variants(..., branch) header behavior. |
| contentstack/src/androidTest/java/com/contentstack/sdk/QueryTestCase.java | Adds instrumentation coverage calling Query.variants(...) before find(). |
| contentstack/src/androidTest/java/com/contentstack/sdk/EntryTestCase.java | Adds instrumentation coverage calling Entry.variants(..., branch) before fetch(). |
| contentstack/build.gradle | Introduces BuildConfig.variantBranch for debug builds to support new instrumentation tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…assumptions and assertions for better validation
🔒 Security Scan Results
⏱️ SLA Breach Summary
🟠 High Severity - SLA Breached Issues (with fixes)Showing 2 issue(s) that have exceeded the 30-day SLA threshold:
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
❌ BUILD FAILED - Security checks failed Please review and fix the security vulnerabilities before merging. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
🟠 High Severity - SLA Breached Issues (with fixes)Showing 2 issue(s) that have exceeded the 30-day SLA threshold:
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
❌ BUILD FAILED - Security checks failed Please review and fix the security vulnerabilities before merging. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Introduce functionality to handle variant branches in the Entry and Query classes, enhancing the ability to scope requests to specific branches. Update tests to validate the new behavior.