Skip to content

Add GitHub workflow and Update dependency#10

Open
alikemalocalan wants to merge 8 commits intostitchdata:masterfrom
Spendit-AG:master
Open

Add GitHub workflow and Update dependency#10
alikemalocalan wants to merge 8 commits intostitchdata:masterfrom
Spendit-AG:master

Conversation

@alikemalocalan
Copy link
Copy Markdown

@alikemalocalan alikemalocalan commented Apr 21, 2026

Description of change

This PR includes Maven project configuration improvements and a migration to Java's built-in HTTP client.

What changed

  1. Runtime HTTP client migration: Replaced Apache HttpClient with java.net.http.HttpClient for all network calls to Stitch
  2. Build/release configuration:
    • Updated build/release plugin setup in pom.xml (source, javadoc, GPG signing, Nexus staging, and release flow)
    • Refined publishing-related configuration for OSSRH deployment
    • Updated/maintained dependency and plugin versions

Why

  • HTTP client migration: Simplifies dependencies by using Java's built-in HTTP client (available since Java 11), reducing external dependency footprint and improving maintainability
  • Configuration updates: Improve release reliability and maintainability of the Java Stitch Client build pipeline

Runtime behavior changes

This change modifies runtime HTTP behavior including:

  • TLS/SSL defaults and cipher suite handling
  • HTTP redirect handling semantics
  • Connection timeout and retry behavior
  • Header processing and validation
  • Potential differences in error handling and edge cases

QA steps

  • automated tests passing
  • manual qa steps passing (list below)

Manual QA steps:

  1. Run a clean build and verify packaging succeeds
  2. Run the full test suite and confirm all tests pass
  3. Verify source and javadoc artifacts are generated
  4. Verify release-related Maven configuration is resolved correctly (without performing an actual production release)
  5. Integration testing: Test HTTP connectivity and batch submissions to verify the new HTTP client behaves correctly with Stitch API endpoints

Risks

  • HTTP client behavior differences: Switching HTTP clients may expose edge cases or behavioral differences in TLS negotiation, redirects, timeouts, or error handling
  • Release/publish workflow risk: misconfiguration could affect artifact signing or staging
  • Build-time compatibility risk: plugin version changes may behave differently across local/CI environments
  • Integration risk: Network communication changes must be validated against actual Stitch API

Rollback steps

  • Revert this branch
  • Re-run CI to confirm previous build and HTTP behavior is restored

@spendito-peter
Copy link
Copy Markdown

@psantacl @cmerrick @mdelaurentis

Would it be possible for you to review this request? Due to severe vulnerabilities a release with updated dependencies would be very desirable.

Thank You!

@alikemalocalan fyi

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the project’s build/release setup (Maven plugins, Java level, dependencies) and adds GitHub automation, while also updating the client implementation to use Java 11’s java.net.http.HttpClient and Jakarta JSON.

Changes:

  • Update pom.xml for Java 11, newer Maven release/publish plugins, and dependency refresh (including removing Apache HttpClient in favor of JDK HTTP client).
  • Add GitHub Actions CI workflows and Dependabot configuration for Maven dependencies.
  • Replace previously “example” main classes with JUnit tests that exercise the same flows; add a test asserting HTTP/1.1 usage.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/com/stitchdata/client/StitchClient.java Switch HTTP transport to java.net.http.HttpClient, update JSON parsing, add helper for JSON content-type detection.
src/main/java/com/stitchdata/client/StitchResponse.java Migrate JSON type to jakarta.json.JsonObject.
src/main/java/com/stitchdata/client/StitchClientBuilder.java Formatting/type tweaks around Transit write handlers and builder build() formatting.
src/main/java/com/stitchdata/client/Buffer.java Import cleanup and formatting-only changes.
src/test/java/com/stitchdata/client/StitchClientTest.java Import cleanup/formatting; add test asserting client uses HTTP/1.1.
src/test/java/com/stitchdata/client/BufferTest.java Import cleanup/formatting.
src/test/java/com/stitchdata/client/SimpleExampleTest.java New test replacing the removed “simple example” main program flow.
src/test/java/com/stitchdata/client/CallbackExampleTest.java New test replacing the removed “callback example” main program flow.
src/main/java/com/stitchdata/client/examples/SimpleExample.java Removed example main program (superseded by tests).
src/main/java/com/stitchdata/client/examples/CallbackExample.java Removed example main program (superseded by tests).
pom.xml Update compiler level to 11; update Maven plugins; refresh dependencies (Transit, Jakarta JSON, JUnit), remove Apache HttpClient dependency.
.github/workflows/maven.yml New Maven build workflow (currently restricted to master).
.github/workflows/maven-unit-tests.yml New unit test workflow for Java 11/17 (currently push only).
.github/dependabot.yml New Dependabot configuration for Maven.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/com/stitchdata/client/StitchClient.java
Comment thread src/main/java/com/stitchdata/client/StitchClient.java
Comment thread .github/workflows/maven.yml Outdated
Comment thread .github/workflows/maven-unit-tests.yml
alikemalocalan and others added 2 commits May 6, 2026 14:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Comment thread .github/workflows/maven.yml Outdated
Comment thread src/main/java/com/stitchdata/client/StitchClient.java Outdated
Comment thread src/test/java/com/stitchdata/client/StitchClientTest.java Outdated
Comment thread src/test/java/com/stitchdata/client/SimpleExampleTest.java Outdated
Comment thread src/test/java/com/stitchdata/client/CallbackExampleTest.java
Comment thread src/test/java/com/stitchdata/client/CallbackExampleTest.java
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Comment thread src/main/java/com/stitchdata/client/StitchClient.java Outdated
Comment thread src/main/java/com/stitchdata/client/StitchClient.java Outdated
Comment thread src/main/java/com/stitchdata/client/StitchClient.java Outdated
Comment thread src/main/java/com/stitchdata/client/StitchClient.java
Comment thread src/test/java/com/stitchdata/client/StitchClientTest.java Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.

ByteArrayInputStream bais = new ByteArrayInputStream(entry.bytes);
Reader reader = TransitFactory.reader(TransitFactory.Format.JSON, bais);
messages.add((Map)reader.read());
messages.add(reader.read());
Comment on lines +269 to +273
// Try to extract more context from JSON response body if available
if (jsonContent != null && jsonContent.containsKey("message")) {
String message = jsonContent.getString("message");
return standardPhrase + " - " + message;
}
* Stitch
*/
public void push(StitchMessage message, Object callbackArg) throws StitchException, IOException {
public void push(StitchMessage message, Object callbackArg) throws StitchException, IOException, IllegalArgumentException {
Comment thread pom.xml
Comment on lines +96 to +104
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.*;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
Comment on lines +14 to +28
public class SimpleExampleTest {

private static Map<String, Object> makePerson(int id, String name) {
Map<String, Object> result = new HashMap<>();
result.put("id", id);
result.put("name", name);
return result;
}

private static class DummyStitchClient extends StitchClient {
final List<Map<String, Object>> receivedPeople = new ArrayList<Map<String, Object>>();

DummyStitchClient() {
super("", 1, "token", "namespace", "people", Arrays.asList("id"),
StitchClientBuilder.DEFAULT_BATCH_SIZE_BYTES,
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.

3 participants