Skip to content

feat: Added branch support in entry variants#207

Draft
OMpawar-21 wants to merge 6 commits into
enhc/betafrom
enhc/9430
Draft

feat: Added branch support in entry variants#207
OMpawar-21 wants to merge 6 commits into
enhc/betafrom
enhc/9430

Conversation

@OMpawar-21

Copy link
Copy Markdown
Contributor
  • New
    • Branch override for Entry Variants: Entry.Variant(uid?, branchUid?) accepts an optional branchUid so a single variant call (Find, Create, Update, Fetch, Delete) can target a branch other than the Stack's configured one, by overriding the branch request header. Passing null/whitespace falls back to the Stack's own branch.
    • Publish/Unpublish for Entry Variants: EntryVariant.Publish/PublishAsync and EntryVariant.Unpublish/UnpublishAsync, matching the same PublishUnpublishDetails contract as Entry.Publish/Unpublish, and respecting the same branch override.

 - **New**
   - **Branch override for Entry Variants**: `Entry.Variant(uid?, branchUid?)` accepts an optional `branchUid` so a single variant call (`Find`, `Create`, `Update`, `Fetch`, `Delete`) can target a branch other than the `Stack`'s configured one, by overriding the `branch` request header. Passing `null`/whitespace falls back to the Stack's own branch.
   - **Publish/Unpublish for Entry Variants**: `EntryVariant.Publish`/`PublishAsync` and `EntryVariant.Unpublish`/`UnpublishAsync`, matching the same `PublishUnpublishDetails` contract as `Entry.Publish`/`Unpublish`, and respecting the same branch override.
@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

Copilot AI 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.

Pull request overview

Adds branch-targeting support and publish/unpublish capabilities to Entry Variants in the Contentstack Management .NET SDK, enabling variant operations to override the Stack’s configured branch via the branch request header.

Changes:

  • Extended Entry.Variant(uid?, branchUid?) and EntryVariant requests to optionally override the branch header per call.
  • Added EntryVariant.Publish/Unpublish (sync + async) using the existing PublishUnpublishDetails contract.
  • Updated unit/integration tests and bumped package version + changelog for the release.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Directory.Build.props Bumps SDK version to 1.1.0.
Contentstack.Management.Core/Models/EntryVariant.cs Stores branch override and applies it to variant CRUD + adds publish/unpublish support.
Contentstack.Management.Core/Models/Entry.cs Adds optional branchUid parameter to Variant(...).
Contentstack.Management.Core.Unit.Tests/Mokes/MockHttpHandler.cs Captures last request headers for branch override assertions.
Contentstack.Management.Core.Unit.Tests/Models/EntryVariantTest.cs Adds unit tests covering branch header override + publish/unpublish behavior.
Contentstack.Management.Core.Tests/IntegrationTest/Contentstack021_EntryVariantTest.cs Adds branch override integration scenarios (branch creation, fetch, fallback, publish).
CHANGELOG.md Documents new 1.1.0 features for entry variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Contentstack.Management.Core/Models/Entry.cs Outdated
Comment thread Contentstack.Management.Core/Models/EntryVariant.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@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

OMpawar-21 and others added 2 commits July 14, 2026 11:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@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

1 similar comment
@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

Copilot AI 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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread Contentstack.Management.Core/Models/EntryVariant.cs Outdated
Comment on lines 55 to 61
var httpRequest = executionContext.RequestContext.service.CreateHttpRequest(
null,
executionContext.RequestContext.config
);
LastRequestUri = httpRequest.RequestUri;
LastRequestHeaders = executionContext.RequestContext.service.Headers;
}
Comment on lines 84 to 90
var httpRequest = executionContext.RequestContext.service.CreateHttpRequest(
null,
executionContext.RequestContext.config
);
LastRequestUri = httpRequest.RequestUri;
LastRequestHeaders = executionContext.RequestContext.service.Headers;
}
Comment thread Contentstack.Management.Core.Unit.Tests/Models/EntryVariantTest.cs Outdated
Comment on lines +3542 to +3545
AssertLogger.IsTrue(
response.IsSuccessStatusCode || (int)response.StatusCode >= 400,
"Expected the SDK to return a well-formed HTTP response for the branch-scoped request",
"FetchVariantOnExplicitBranch");
Comment on lines +3569 to +3572
AssertLogger.IsTrue(
response.IsSuccessStatusCode || (int)response.StatusCode >= 400,
"Expected the SDK to return a well-formed HTTP response for the branch-scoped request",
"FetchVariantOnExplicitBranchAsync");
OMpawar-21 and others added 2 commits July 14, 2026 11:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@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

1 similar comment
@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

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.

2 participants