Skip to content

feat(branches): add optional environments list to branch create (DX-31563) - #194

Merged
cs-raj merged 1 commit into
epic/DX-31560-branch-create-environmentsfrom
claude/feat/DX-31563-py-branch-create-environments
Oct 28, 2026
Merged

cs-raj merged 1 commit into
epic/DX-31560-branch-create-environmentsfrom
claude/feat/DX-31563-py-branch-create-environments

Conversation

@cs-raj

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

Copy link
Copy Markdown
Contributor

🤖 Opened by deveco-developer-agent (Claude). Replies from this account are the AI agent too. Review stays human. Merge: this agent merges into the epic branch after a passing reviewer verdict and green CI (MERGE=epic-branch); the final epic-to-development PR is merged by a person.

DX-31563 · Epic DX-31560

Changes

branches().create() already posts the caller's data unchanged, so an optional publish_config.environments list passes through: two names clone only those, [] clones none, omitting it sends today's body, and the API's 422 comes back unchanged. No runtime change: the create docstring documents the three behaviours with an example, plus unit and integration tests. Version 1.12.0 and changelog.

Testing Plan

6 new mocked unit tests pass (a mutation check that strips publish_config makes them fail); pylint on branches.py unchanged from base. Not run: integration tests (no credentials); the other unit tests fail identically on base (live network blocked). QA: needs a person: test DX-31563 live (QA story DX-31568).

Known Gaps

  • The unit tests are characterisation tests (create already passes the body through), so they pin that behaviour rather than prove a new code path.
  • 330 unit tests fail with and without this change (sandbox blocks api.contentstack.io).
  • The 150-name case is a pass-through check; the API's own limit is not tested live.

Review: reviewer verdict pass on 80a1a84; security pass clean. Merge order: independent of other repos' PRs.



Generated by Claude Code

Branch create accepts an optional branch.publish_config.environments list of environment
names so a caller can clone only the environments it needs. An empty list clones none.
Omitting publish_config sends the same body as before and clones all environments. The
SDK passes the list through unvalidated and adds no length limit; an unknown name or a
mix returns the API's 422 response unchanged and no branch is created.

Documents the field and its three behaviors in the create docstring with an example.
Adds mocked unit tests for the posted body (two names, [], duplicates, a 150-name list,
mixed case, omitted, publish_config {}) and for a 422 returned unchanged, plus sanity
integration tests for create with two names, [], an unknown name and a mix (not run
here). Bumps the minor version to 1.12.0 and adds a changelog entry.

Refs: DX-31563

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

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@cs-raj
cs-raj marked this pull request as ready for review October 28, 2026 11:09
@cs-raj
cs-raj requested a review from a team as a code owner October 28, 2026 11:09
@cs-raj
cs-raj merged commit 12f76cf into epic/DX-31560-branch-create-environments Oct 28, 2026
9 checks passed
@cs-raj
cs-raj deleted the claude/feat/DX-31563-py-branch-create-environments branch October 28, 2026 11:09
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