Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
76a960c
Merge pull request #268 from contentstack/master
OMpawar-21 Aug 24, 2026
bd48544
Merge development into back-merge/DX-20927
reeshika-h Sep 28, 2026
112118f
Merge pull request #271 from contentstack/back-merge/DX-20927
reeshika-h Sep 29, 2026
f483430
feat: add opt-in Builder.setSerializeNulls to send explicit nulls (DX…
reeshika-h Oct 21, 2026
8d00706
Merge pull request #272 from contentstack/fix/DX-29683-serialize-nulls
reeshika-h Oct 26, 2026
039b1b2
feat(branch): document and test the environment list on branch create
claude Oct 28, 2026
c370292
fix(branch): keep live test branch UIDs within the 15-char limit
claude Oct 28, 2026
75dd982
test(branch): clean up rejected-create UIDs too
claude Oct 28, 2026
01ea18f
Merge pull request #275 from contentstack/claude/feat/DX-31564-java-b…
cs-raj Oct 28, 2026
289556e
test(branch): log in with EMAIL/PASSWORD and manage own environments …
claude Oct 28, 2026
6a5e5d2
Merge pull request #277 from contentstack/claude/fix/DX-31579-branch-…
reeshika-h Oct 28, 2026
a2eaf9c
Merge pull request #276 from contentstack/epic/DX-31560-branch-create…
reeshika-h Oct 28, 2026
6ed0e69
Merge master into development (back-merge of 1.15.0 Snyk fixes)
reeshika-h Nov 2, 2026
b8e961c
Merge pull request #280 from contentstack/backmerge/master-into-devel…
reeshika-h Nov 3, 2026
76fbfd1
test(branch): log in with MFA_SECRET when the test account has two-fa…
reeshika-h Nov 12, 2026
6c8fca3
chore(release): set v1.16.0 release date to 2026-11-12 (DX-31560)
reeshika-h Nov 12, 2026
f45afb2
Merge pull request #281 from contentstack/test/DX-31560-branch-api-te…
reeshika-h Nov 12, 2026
e9c26d7
Merge branch 'development' into chore/DX-31560-release-date
reeshika-h Nov 12, 2026
999f031
Merge pull request #282 from contentstack/chore/DX-31560-release-date
reeshika-h Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.16.0

### Nov 12, 2026

- Feat: Branch create accepts an optional `branch.publish_config.environments` list of environment names, so a branch can clone only the environments it needs. `[]` clones none; omitting `publish_config` clones all environments, as before. The list is sent unchanged, the SDK adds no length limit, and an unknown name (or a mix) returns the API's 422 error body unchanged with no branch created.

## v1.15.0

### Nov 02, 2026
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<artifactId>cms</artifactId>
<packaging>jar</packaging>
<name>contentstack-management-java</name>
<version>1.15.0</version>
<version>1.16.0</version>
<description>Contentstack Java Management SDK for Content Management API, Contentstack is a headless CMS with an
API-first approach
</description>
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/contentstack/cms/stack/Branch.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,32 @@ public Call<ResponseBody> fetch() {
/**
* The Create a branch request creates a new branch in a particular stack of
* your organization.
* <p>
* Optionally set {@code branch.publish_config.environments} to a list of
* environment <b>names</b> (not UIDs) to choose which environments the branch
* clones:
* <ul>
* <li>a list of names clones only those environments;</li>
* <li>an empty list {@code []} clones none;</li>
* <li>omitting {@code publish_config} clones all environments, as before.</li>
* </ul>
* The list is sent unchanged. The SDK does not validate the names or limit the
* list length. An unknown name, or a mix of known and unknown names, is
* rejected by the API with a 422; the API's error body is returned unchanged
* and no branch is created.
* <p>
* Example body:
* <pre>{@code
* JSONObject publishConfig = new JSONObject();
* publishConfig.put("environments", Arrays.asList("development", "staging"));
* JSONObject branch = new JSONObject();
* branch.put("uid", "branch_uid");
* branch.put("source", "main");
* branch.put("publish_config", publishConfig);
* JSONObject body = new JSONObject();
* body.put("branch", branch);
* stack.branch().create(body).execute();
* }</pre>
*
* @param body the request body
* @return Call
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/com/contentstack/cms/TestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public class TestClient {
public static final String ENTRY_VARIANT_LOCALE =
isBlank(env.get("entryVariantLocale")) ? "en-us" : env.get("entryVariantLocale").trim();

/** Login email for tests that log in with a real account (null when {@code EMAIL} is not set in {@code .env}). */
public static final String EMAIL = env.get("EMAIL");

/** Login password for tests that log in with a real account (null when {@code PASSWORD} is not set in {@code .env}). */
public static final String PASSWORD = env.get("PASSWORD");

/** MFA secret for accounts with two-factor on (null when {@code MFA_SECRET} is not set in {@code .env}). */
public static final String MFA_SECRET = env.get("MFA_SECRET");

/** {@code true} if {@code value} is null, empty, or whitespace-only. */
private static boolean isBlank(String value) {
return value == null || value.trim().isEmpty();
Expand All @@ -52,6 +61,11 @@ public static boolean isUsingDefaultStackCredentials() {
return env.get("apiKey") == null || env.get("managementToken") == null;
}

/** {@code true} when {@code apiKey} is set to a non-blank value in {@code .env}. */
public static boolean isApiKeyConfigured() {
return !isBlank(env.get("apiKey"));
}

private static Contentstack instance;
private static Stack stackInstance;

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/contentstack/cms/UnitTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.contentstack.cms.core.AuthInterceptorTest;
import com.contentstack.cms.core.EndpointTest;
import com.contentstack.cms.stack.AssetUnitTest;
import com.contentstack.cms.stack.BranchUnitTest;
import com.contentstack.cms.stack.EntryVariantUnitTest;
import com.contentstack.cms.stack.EnvironmentUnitTest;
import com.contentstack.cms.stack.GlobalFieldUnitTests;
Expand Down Expand Up @@ -33,6 +34,7 @@
AssetUnitTest.class,
EntryVariantUnitTest.class,
EnvironmentUnitTest.class,
BranchUnitTest.class,
GlobalFieldUnitTests.class,
LocaleUnitTest.class,
ReleaseUnitTest.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
EndpointAPITest.class,
TaxonomyAPITest.class,
AssetAPITest.class,
BranchAPITest.class,
ContentTypeAPITest.class,
EntryFieldsAPITest.class,
EnvironmentAPITest.class,
Expand Down
Loading
Loading