Skip to content

feat: Add support for variant branches in Entry and Query classes#175

Merged
naman-contentstack merged 3 commits into
developmentfrom
enhc/DX-7326
Jul 20, 2026
Merged

feat: Add support for variant branches in Entry and Query classes#175
naman-contentstack merged 3 commits into
developmentfrom
enhc/DX-7326

Conversation

@OMpawar-21

Copy link
Copy Markdown
Contributor

No description provided.

… support for variant branches in Entry and Query classes

- Entry Variants Branch Support
  - Added support for passing an optional `branch` parameter to the `.Variant()` method in both `Entry` and `Query` classes.
  - If the branch parameter is null or empty, it automatically falls back to the Stack's configured branch or "main".
  - Added comprehensive unit and integration tests for Entry and Query variant branch logic.
@OMpawar-21
OMpawar-21 requested a review from a team as a code owner May 15, 2026 09:38
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@sunil-lakshman
sunil-lakshman marked this pull request as draft May 15, 2026 11:04
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

… utilities

- Extract duplicated branch-resolution logic into a private ResolveBranch()
  method in both Entry and Query, eliminating inline ternary repetition
- Add DefaultBranch = "main" constant shared across Variant overloads
- Promote Query._Headers to internal visibility to remove reflection in unit tests
- Introduce UnitTestHelpers.GetMockClient() shared helper, removing duplicate
  private factory methods from EntryUnitTests and QueryUnitTests
- Strengthen integration test assertions: use ThrowsAnyAsync and assert that
  exception message contains "branch" rather than just checking non-null
- Replace hard-coded "development" branch strings with TestDataHelper.BranchUid
- Bump contentstack.utils dependency from 2.0.0 to 2.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@OMpawar-21 OMpawar-21 self-assigned this Jul 20, 2026
@cs-raj
cs-raj marked this pull request as ready for review July 20, 2026 08:59
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@naman-contentstack
naman-contentstack merged commit dc2180d into development Jul 20, 2026
11 of 15 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.

6 participants