Skip to content

Added Branches support in entry variants#361

Draft
sunil-lakshman wants to merge 2 commits into
developmentfrom
enh/DX-7322
Draft

Added Branches support in entry variants#361
sunil-lakshman wants to merge 2 commits into
developmentfrom
enh/DX-7322

Conversation

@sunil-lakshman

Copy link
Copy Markdown
Contributor

No description provided.

@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

@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
99.45% (+0.13% 🔼)
901/906
🟢 Branches
97.68% (+0.45% 🔼)
295/302
🟢 Functions
97.95% (+0.01% 🔼)
191/195
🟢 Lines
99.54% (+0.13% 🔼)
857/861

Test suite run success

688 tests passing in 32 suites.

Report generated by 🧪jest coverage report action from a0d7d72

@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
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the Delivery SDK’s entry variant support to optionally include a branch name, allowing variant-scoped requests to also set the branch request header (while keeping existing variants(uid|uids) behavior backward compatible).

Changes:

  • Added buildVariantRequestHeaders() utility to centrally construct x-cs-variant-uid and optional branch headers.
  • Updated Entry, Entries, BaseQuery, and Query request flows to attach variant+branch headers when configured.
  • Added/expanded unit tests and introduced an API test suite covering variant+branch behavior; bumped version + changelog and updated the version-bump workflow to parse the changelog format.

Reviewed changes

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

Show a summary per file
File Description
test/unit/utils.spec.ts Adds unit coverage for buildVariantRequestHeaders().
test/unit/entry.spec.ts Adds unit coverage for Entry.variants(variant, branch) and fetch header behavior.
test/unit/entries.spec.ts Adds unit coverage for Entries.variants(..., branch) and query().find() header behavior.
test/unit/base-query.spec.ts Extends BaseQuery test harness to include variants branch and validates headers.
test/api/entry-variants-branch.spec.ts New API test suite for entry/entries variant+branch behavior and chaining scenarios.
src/query/query.ts Extends Query to carry variants branch state and apply headers during find().
src/query/base-query.ts Applies shared variant+branch header building in BaseQuery find().
src/entries/entry.ts Adds optional branch argument to Entry.variants() and applies headers during fetch().
src/entries/entries.ts Adds optional branch argument to Entries.variants(), propagates branch into query(), and applies headers during find().
src/common/utils.ts Introduces buildVariantRequestHeaders() helper.
package.json Bumps SDK version to 5.3.0.
package-lock.json Updates lockfile version metadata to 5.3.0.
CHANGELOG.md Adds 5.3.0 entry documenting variant+branch support.
.github/workflows/check-version-bump.yml Updates changelog parsing to support the current “### Version:” format.

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

Comment thread src/entries/entry.ts
Comment on lines 43 to +47
* @method variants
* @memberof Entry
* @description The variant header will be added to axios client
* @description The variant header will be added to axios client. Branch is optional.
* @param {string | string[]} variants - Variant UID or UIDs
* @param {string} [branchName] - Optional branch name sent as the `branch` header
Comment thread src/entries/entries.ts
Comment on lines 264 to +268
* @method variants
* @memberof Entries
* @description The variant header will be added to axios client
* @description The variant header will be added to axios client. Branch is optional.
* @param {string | string[]} variants - Variant UID or UIDs
* @param {string} [branchName] - Optional branch name sent as the `branch` header
Comment thread src/query/query.ts
Comment on lines +10 to +18
constructor(
client: AxiosInstance,
params: params,
queryParams: queryParams,
variants?: string,
uid?: string,
variantsBranchOrQueryObj?: string | { [key: string]: any },
queryObj?: { [key: string]: any }
) {
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.

5 participants