Repository navigation
feat(branches): optional environment list on branch create (DX-31560) - #195
Conversation
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>
…nch-create-environments feat(branches): add optional environments list to branch create (DX-31563)
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
The live cases added for publish_config.environments failed on dev11:
generate_valid_uid("branch_env") gives 16 characters (the API caps branch
uids at 15), and a fetch of a branch that does not exist returns 422
(error_code 905), not 404. Use a shorter prefix and compare a rejected
create's fetch with the response for a nonexistent branch (TC-16/TC-17).
Also, per the test cases page: create three class environments so two is
a strict subset (TC-13), add the one-name, no-list (TC-15) and
case-variant cases, and delete every branch and environment created.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XifDUYYvn7GfSpLcKarg5S
…e-branch-envs test(branches): fix live environment-list cases for dev11 (DX-31568)
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ 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:
✅ BUILD PASSED - All security checks passed |
|
The Generated by Claude Code |
|
The re-run of Generated by Claude Code |
🤖 Opened by
deveco-dev(Claude). Review and merge stay with a person (MERGE=deniedfor this PR).Changes: Branch create documents and passes through the API's
publish_config.environments(all by default, none, or a list). Omitted list leaves the request body unchanged; the 422 is returned as is. Epic DX-31560 (PR #194 merged into this branch). Version 1.12.0.Testing Plan: 6 new
BranchCreateEnvironmentsUnitTestspass. The legacytests/unitsetUp logs in live, so 286 other tests fail in the sandbox (proxy 403); not compared to a baseline run. No new pylint warnings inbranches.py. Live tests not run; QA story DX-31568.Known Gaps:
skills/contentstack-management/SKILL.mdmay need a branch-create note.Merge order: independent of the other three SDK PRs.
Generated by Claude Code