Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
db1b5d9
Merge pull request #180 from contentstack/staging
reeshika-h Mar 25, 2025
bb9315e
Merge pull request #182 from contentstack/staging
harshithad0703 Apr 1, 2025
d8d1523
policy-scan.yml
aravindbuilt Apr 16, 2025
275c937
issues-jira.yml
aravindbuilt Apr 16, 2025
2851b44
Delete jira.yml
aravindbuilt Apr 16, 2025
bd10379
Delete sast-scan.yml
aravindbuilt Apr 16, 2025
46eaff1
codeql-analysis.yml
aravindbuilt Apr 16, 2025
12441f2
Updated codeowners
aravindbuilt Apr 16, 2025
236a058
Refactor assertions in tests to use assertNotNull for improved valida…
reeshika-h Apr 23, 2025
4ff32c9
Uncomment skipTests configuration in maven-surefire-plugin for test e…
reeshika-h Apr 23, 2025
4d3e0cb
policy-scan.yml
aravindbuilt Apr 23, 2025
cb5ce37
Merge branch 'master' into fix/dx-2373-skips-single-item
harshithad0703 Apr 24, 2025
8beaa58
Fix item processing in SyncStack to handle JSONObject correctly and p…
harshithad0703 Apr 24, 2025
9d39ac5
Add test for handling single JSONObject under "items" in SyncStack
harshithad0703 Apr 24, 2025
c62265f
Merge pull request #185 from contentstack/fix/dx-2373-skips-single-item
harshithad0703 Apr 24, 2025
eed871f
Add Slack reporting functionality and update dependencies
reeshika-h Apr 30, 2025
10f0bd2
Enhance tests by adding assertions for entry parameters and headers; …
reeshika-h May 5, 2025
6567ff4
Add SLF4J dependency and update JavaDoc links; comment out disabled t…
reeshika-h May 5, 2025
1435a5d
Update assertions in tests to reflect expected header and entry counts
reeshika-h May 5, 2025
9448814
Remove header size assertions from entry and query tests
reeshika-h May 6, 2025
82e75af
Merge pull request #184 from contentstack/fix/DX-2420-pipeline-friendly
reeshika-h May 6, 2025
527f953
Update version to 2.1.1 and updated changelog
reeshika-h May 15, 2025
7eb50ed
Merge pull request #187 from contentstack/version-bump
reeshika-h May 15, 2025
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
31 changes: 31 additions & 0 deletions .github/workflows/issues-jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create Jira Ticket for Github Issue

on:
issues:
types: [opened]

jobs:
issue-jira:
runs-on: ubuntu-latest
steps:

- name: Login to Jira
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create Jira Issue
id: create_jira
uses: atlassian/gajira-create@master
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}
description: |
*GitHub Issue:* ${{ github.event.issue.html_url }}

*Description:*
${{ github.event.issue.body }}
fields: "${{ secrets.ISSUES_JIRA_FIELDS }}"
33 changes: 0 additions & 33 deletions .github/workflows/jira.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/policy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Checks the security policy and configurations
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-policy:
if: github.event.repository.visibility == 'public'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@master
- name: Checks for SECURITY.md policy file
run: |
if ! [[ -f "SECURITY.md" || -f ".github/SECURITY.md" ]]; then exit 1; fi
security-license:
if: github.event.repository.visibility == 'public'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@master
- name: Checks for License file
run: |
expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
license_file_found=false
current_year=$(date +"%Y")

for license_file in "${expected_license_files[@]}"; do
if [ -f "$license_file" ]; then
license_file_found=true
# check the license file for the current year, if not exists, exit with error
if ! grep -q "$current_year" "$license_file"; then
echo "License file $license_file does not contain the current year."
exit 2
fi
break
fi
done

if [ "$license_file_found" = false ]; then
echo "No license file found. Please add a license file to the repository."
exit 1
fi
11 changes: 0 additions & 11 deletions .github/workflows/sast-scan.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ local.properties
.settings/
.loadpath
.recommenders
# Ignore test configuration
test-config.properties

# External tool builders
.externalToolBuilders/
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## v2.1.1

### Date: 1-Apr-2025

- Github Issue fix
- Sanity test Integration

## v2.1.0

### Date: 1-Apr-2025
Expand Down
40 changes: 26 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API</description>
Expand All @@ -22,7 +22,7 @@
<dotenv-source.version>3.0.0</dotenv-source.version>
<rxjava-source.version>3.1.10</rxjava-source.version>
<retrofit-source.version>2.11.0</retrofit-source.version>
<loggin.version>5.0.0-alpha.11</loggin.version>
<loggin.version>4.12.0</loggin.version>
<jococo-plugin.version>0.8.5</jococo-plugin.version>
<lombok-source.version>1.18.36</lombok-source.version>
<junit-jupiter.version>5.11.4</junit-jupiter.version>
Expand All @@ -34,7 +34,7 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<json-version>20250107</json-version>
<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
<jacoco-maven-plugin-version>0.8.11</jacoco-maven-plugin-version>
<maven-release-plugin-version>2.5.3</maven-release-plugin-version>
<contentstack-utils-version>1.2.15</contentstack-utils-version>
</properties>
Expand Down Expand Up @@ -122,14 +122,6 @@
<scope>compile</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/io.github.cdimascio/java-dotenv -->
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>java-dotenv</artifactId>
<version>5.2.2</version>
</dependency>


<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
Expand Down Expand Up @@ -189,6 +181,27 @@
<artifactId>jackson-databind</artifactId>
<version>2.18.2</version>
</dependency>
<dependency>
<groupId>com.slack.api</groupId>
<artifactId>bolt</artifactId>
<version>1.44.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>24.0.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -237,8 +250,7 @@
<use>false</use>
<source>1.8</source>
<links>
<link>https://docs.oracle.com/javase/7/docs/api/</link>
<link>https://docs.oracle.com/javase/7/docs/api/</link>
<link>https://docs.oracle.com/en/java/javase/23/docs/api/index.html</link>
</links>
<doclint>none</doclint>
</configuration>
Expand All @@ -251,7 +263,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<skipTests>true</skipTests>
<!-- <skipTests>true</skipTests> -->
</configuration>
</plugin>

Expand Down
14 changes: 14 additions & 0 deletions send-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e # Exit immediately if any command fails

echo "🧪 Running tests..."
mvn clean test

echo "📄 Generating Surefire HTML report..."
mvn surefire-report:report-only

echo "📤 Sending test report to Slack..."
mvn compile exec:java -Dexec.mainClass="com.contentstack.sdk.SanityReport"

echo "✅ Done."
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/sdk/CSHttpConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private String getParams(HashMap<String, Object> params) {
urlParams += urlParams.equals("?") ? key + "=" + value : "&" + key + "=" + value;
}
} catch (Exception e1) {
e1.printStackTrace();
logger.log(Level.SEVERE, e1.getLocalizedMessage(), e1);
}
}
return urlParams;
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/com/contentstack/sdk/Entry.java
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ private void setIncludeJSON(JSONObject mainJson, ResultCallBack callBack) {

private void throwException(@Nullable String errorMsg, Exception e, EntryResultCallBack callBack) {
Error error = new Error();
if (errorMsg != null) {
if (!errorMsg.isEmpty()) {
error.setErrorMessage(errorMsg);
} else {
error.setErrorMessage(e.toString());
Expand Down Expand Up @@ -1124,11 +1124,9 @@ public Entry includeMetadata() {
}

/**
* @method variants
* @memberof Entry
* @description The variant header will be added to client
* @returns {Entry}
* @example
* The variant header will be added to client
* @return {Entry}
*
* import contentstack from '@contentstack/delivery-sdk'
*
* Stack stack = contentstack.Stack("apiKey", "deliveryToken",
Expand Down
Loading
Loading