Repository navigation
feat(branch): optional environment list on branch create (DX-31560) - #276
Merged
reeshika-h merged 6 commits intoOct 28, 2026
Merged
Conversation
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 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
✅ BUILD PASSED - All security checks passed |
cs-raj
marked this pull request as ready for review
October 28, 2026 12:28
reeshika-h
previously approved these changes
Oct 28, 2026
…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)
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
reeshika-h
approved these changes
Oct 28, 2026
aniket-shikhare-cstk
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Opened by
deveco-dev(Claude). Review and merge stay with a person (MERGE=deniedfor 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:
BranchUnitTest28 passing, 0 failing, run in a patched scratch copy (see gap 1). Full unit run: 79 failures in 16 unrelated classes, identical todevelopment(819 vs 827 tests, +8 new passing). Live tests not run; QA story DX-31569.Known Gaps:
skipTestshard-coded, surefire M5 picks JUnit4, tests need a classpath.env); also true ondevelopment. Needs a separate ticket.Merge order: independent of the other three SDK PRs.
Generated by Claude Code