Skip to content

feat(branch): optional environment list on branch create (DX-31560) - #276

Merged
reeshika-h merged 6 commits into
developmentfrom
epic/DX-31560-branch-create-environments
Oct 28, 2026
Merged

reeshika-h merged 6 commits into
developmentfrom
epic/DX-31560-branch-create-environments

Conversation

@cs-raj

@cs-raj cs-raj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

🤖 Opened by deveco-dev (Claude). Review and merge stay with a person (MERGE=denied for this PR).

Changes: Branch create documents and tests the API's publish_config.environments (all by default, none, or a list). Javadoc and tests only; no runtime change. Epic DX-31560 (PR #275 merged into this branch). Version 1.16.0.

Testing Plan: BranchUnitTest 28 passing, 0 failing, run in a patched scratch copy (see gap 1). Full unit run: 79 failures in 16 unrelated classes, identical to development (819 vs 827 tests, +8 new passing). Live tests not run; QA story DX-31569.

Known Gaps:

  • The pom as shipped runs zero tests (skipTests hard-coded, surefire M5 picks JUnit4, tests need a classpath .env); also true on development. Needs a separate ticket.
  • 79 pre-existing unit failures, cause not investigated.

Merge order: independent of the other three SDK PRs.


Generated by Claude Code

claude and others added 4 commits October 28, 2026 10:58
Branch create accepts an optional branch.publish_config.environments list of
environment names. The runtime already passes the body through unchanged, so
this change adds the Javadoc for the three behaviors (a list, [], and omitted),
unit tests that pin the request body and the mocked 422 and fetch paths, and
a live BranchAPITest that creates, fetches and deletes branches against a real
stack (it skips without credentials). The SDK adds no validation or length
limit; the API's error body is returned unchanged. Bumps the version to 1.16.0
and adds a changelog entry.

Refs: DX-31564

Co-authored-by: Raj Pandey <raj.pandey@contentstack.com>
Co-authored-by: Reeshika Hosmani <reeshika.hosmani@contentstack.com>
Co-authored-by: Aniket Shikhare <aniket.shikhare@contentstack.com>
Co-authored-by: Claude <noreply@anthropic.com>
Branch UIDs allow 15 lowercase letters and digits; the long run-id UIDs
would have made the create calls fail for the wrong reason. Also assert the
422 body names publish_config.environments and register created UIDs for
cleanup before asserting.

Refs: DX-31564

Co-authored-by: Raj Pandey <raj.pandey@contentstack.com>
Co-authored-by: Reeshika Hosmani <reeshika.hosmani@contentstack.com>
Co-authored-by: Aniket Shikhare <aniket.shikhare@contentstack.com>
Co-authored-by: Claude <noreply@anthropic.com>

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XifDUX2vy4ahCznNWQ2P3S
Refs: DX-31564

Co-authored-by: Raj Pandey <raj.pandey@contentstack.com>
Co-authored-by: Reeshika Hosmani <reeshika.hosmani@contentstack.com>
Co-authored-by: Aniket Shikhare <aniket.shikhare@contentstack.com>
Co-authored-by: Claude <noreply@anthropic.com>
…ranch-create-environments

feat(branch): environment list on branch create (DX-31564)
@snyk-io

snyk-io Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@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

@cs-raj
cs-raj marked this pull request as ready for review October 28, 2026 12:28
@cs-raj
cs-raj requested a review from a team as a code owner October 28, 2026 12:28
reeshika-h
reeshika-h previously approved these changes Oct 28, 2026
claude and others added 2 commits October 28, 2026 13:45
…in BranchAPITest

BranchAPITest used TestClient.getStack(), which sends the management token.
Branch create answered 401 (error 161) with it, and the test assumed the
'development' and 'production' environments exist on the stack.

The class now:
- logs in with EMAIL / PASSWORD and uses the apiKey header only;
- creates two environments whose names are unique to the run, and deletes
  them, with every created branch (force=true), and logs out in @afterall;
- polls fetch until a created branch is ready (bounded, 60s, 2s steps);
- treats a rejected create as no branch when fetch answers 422 with
  error_code 905, the same answer as a missing branch;
- adds TC-23 (create without publish_config) and TC-24 (environment name in
  a different case gets 422).

Without EMAIL, PASSWORD or apiKey in .env the class is skipped with a
"not run" message. TestClient gains public EMAIL and PASSWORD constants and
isApiKeyConfigured().

Refs: DX-31579

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ef6P4M5YRs6tDbdFqkvmZc
…api-test-login

fix(branch): log in with EMAIL/PASSWORD and manage own environments in BranchAPITest (DX-31579)
@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

@reeshika-h
reeshika-h merged commit a2eaf9c into development Oct 28, 2026
9 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.

4 participants