Skip to content

Commit

Permalink
Simpler Config Variant (#127)
Browse files Browse the repository at this point in the history
* chore: [DevOps] bump the test group with 2 updates (#121)

Bumps the test group with 2 updates: [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) and [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5).


Updates `org.junit.jupiter:junit-jupiter-api` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.11.2...r5.11.3)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.2 to 5.11.3
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.11.2...r5.11.3)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: test
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: test
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: [DevOps] bump the plugins group with 7 updates (#120)

Bumps the plugins group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) | `3.8.0` | `3.8.1` |
| [org.apache.maven.plugins:maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) | `3.5.0` | `3.6.0` |
| [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) | `4.8.6.4` | `4.8.6.5` |
| [org.springframework.boot:spring-boot-autoconfigure](https://github.com/spring-projects/spring-boot) | `3.3.4` | `3.3.5` |
| [org.springframework.boot:spring-boot](https://github.com/spring-projects/spring-boot) | `3.3.4` | `3.3.5` |
| [org.springframework.boot:spring-boot-starter-web](https://github.com/spring-projects/spring-boot) | `3.3.4` | `3.3.5` |
| [org.springframework.boot:spring-boot-maven-plugin](https://github.com/spring-projects/spring-boot) | `3.3.4` | `3.3.5` |


Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.8.0 to 3.8.1
- [Release notes](https://github.com/apache/maven-dependency-plugin/releases)
- [Commits](apache/maven-dependency-plugin@maven-dependency-plugin-3.8.0...maven-dependency-plugin-3.8.1)

Updates `org.apache.maven.plugins:maven-checkstyle-plugin` from 3.5.0 to 3.6.0
- [Commits](apache/maven-checkstyle-plugin@maven-checkstyle-plugin-3.5.0...maven-checkstyle-plugin-3.6.0)

Updates `com.github.spotbugs:spotbugs-maven-plugin` from 4.8.6.4 to 4.8.6.5
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.8.6.4...spotbugs-maven-plugin-4.8.6.5)

Updates `org.springframework.boot:spring-boot-autoconfigure` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.3.4...v3.3.5)

Updates `org.springframework.boot:spring-boot` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.3.4...v3.3.5)

Updates `org.springframework.boot:spring-boot-starter-web` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.3.4...v3.3.5)

Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.3.4 to 3.3.5
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.3.4...v3.3.5)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-dependency-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: plugins
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.springframework.boot:spring-boot-autoconfigure
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.springframework.boot:spring-boot
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.springframework.boot:spring-boot-starter-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.springframework.boot:spring-boot-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: [DevOps] bump the production-minor-patch group across 1 directory with 3 updates (#122)

Bumps the production-minor-patch group with 3 updates in the / directory: [org.wiremock:wiremock](https://github.com/wiremock/wiremock), [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) and [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback).


Updates `org.wiremock:wiremock` from 3.9.1 to 3.9.2
- [Release notes](https://github.com/wiremock/wiremock/releases)
- [Commits](wiremock/wiremock@3.9.1...3.9.2)

Updates `com.puppycrawl.tools:checkstyle` from 10.18.2 to 10.19.0
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-10.18.2...checkstyle-10.19.0)

Updates `ch.qos.logback:logback-classic` from 1.5.11 to 1.5.12
- [Commits](qos-ch/logback@v_1.5.11...v_1.5.12)

---
updated-dependencies:
- dependency-name: org.wiremock:wiremock
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-minor-patch
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-minor-patch
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-minor-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Chore/sample app readme update (#125)

* Update Sample Code Readme

* F

* Fix typo

* Simpler Config Variant

* [Streaming] Fix issues when not using `try-with-resource` (#49)

* OpenAI streaming

* Added homepage and error handling todo

* Renamed vars

* Added todos

* Made stream generic, try-with resources, TEXT_EVENT_STREAM, exception refactored

* Formatting

* close stream correctly

* Formatting

* Created OpenAiStreamOutput

* Formatting

* Renamed stream to streamChatCompletion, Added comments

* Added total output

* Total output is printed

* Formatting

* addDelta is propagated everywhere

* addDelta is propagated everywhere

* forgotten addDeltas

* Added jackson dependencies

* Added Javadoc

* Removed 1 TODO

* PMD

* PMD again

* Added OpenAiClientTest.streamChatCompletion()

* Change return type of stream, added e2e test

* Added documentation

* Added documentation framework-agnostic + throw if finish reason is invalid

* Added error handling test

* Updates from pair review / discussion

* Cleanup + streamChatCompletion doesn't throw

* PMD

* Added errorHandling test

* Apply suggestions from code review

Co-authored-by: Matthias Kuhr <[email protected]>

* Dependency analyze

* Review comments

* Make client static

* Formatting

* PMD

* Fix tests

* Removed exception constructors no args

* Refactor exception message

* Readme sentences

* Remove superfluous call super

* reset httpclient-cache and -factory after each test case

* Very minor code-style improvements in test

* Minor code-style in OpenAIController

* Reduce README sample code

* Update OpenAiStreamingHandler.java (#43)

* Fix import

* Initial

* Format

* Improve type

* Added stream_options to model

* Change Executor#submit() to #execute()

* Change Executor#submit() to #execute()

* Added usage testing

* Added beautiful Javadoc to enableStreaming

* typo

* Fix mistake

* Syntax improvement to improve API stability.

* Syntax improvement to improve API stability.

* Make exception types similar to BufferedReader original logic

* Format

* Add nonnull characteristic to mirror BufferedReader original logic

* Make buffer size accessible

* Add test

* Add assertion on stream count

* Simplify e2e code

* Simplify README

* Partially revert

* Add assertion

* Partially revert

* Minor code adjustments

* Replace unnecessary nested types

* Merge nested type to renamed parent type

* Change code to ensure our lazy `hasNext()` has no unexpected side effect

* Revert removing `emitter#complete()`

* Add JavaDoc; Replace VAVR type

* Address PMD warnings: change exception type

* Add unhappy-path test cases

* Revert code change in test app

* Initial migrate coverage check to pom xml

* Print FULL coverage report with git diff indicator

* Update foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/IterableStreamConverterTest.java

Co-authored-by: Charles Dubois <[email protected]>

* Update foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/IterableStreamConverterTest.java

Co-authored-by: Charles Dubois <[email protected]>

* Reduce redundant method

* Add comment

* Fix merge error

* Fix JavaDoc inaccessibility warning

* Improve error message

---------

Co-authored-by: I538344 <[email protected]>
Co-authored-by: SAP Cloud SDK Bot <[email protected]>
Co-authored-by: Matthias Kuhr <[email protected]>
Co-authored-by: Charles Dubois <[email protected]>
Co-authored-by: Matthias Kuhr <[email protected]>
Co-authored-by: Alexander Dümont <[email protected]>

* Orchestration Client (#128)

* Orchestration Client

* Documentation fix

* Added error tests

* Better Javadoc

* Updated AI Core unit tests (#131)

* Added Cloud SDK logo (#132)

* `AICORE_SERVICE_KEY` in `.env` file (#129)

* Allow File Path in AI Core Env Var

* Sonarlint

* Documentation

* Update README.md

Co-authored-by: Alexander Dümont <[email protected]>

* Accept both env var and .env

* Updated doc

* Apply suggestions from code review

Co-authored-by: Alexander Dümont <[email protected]>

* Do not use System.getenv anymore

* Fix links

* ℹ️ The environment variable has priority over the `.env` file.

---------

Co-authored-by: Alexander Dümont <[email protected]>

* Initial (#130)

Co-authored-by: Alexander Dümont <[email protected]>

* Remove redundant property (#126)

* Remove redundant property

* Removed empty inputParams

---------

Co-authored-by: Alexander Dümont <[email protected]>
Co-authored-by: I538344 <[email protected]>

* chore: [DevOps] bump the plugins group with 3 updates (#134)

Bumps the plugins group with 3 updates: [org.apache.maven.plugins:maven-pmd-plugin](https://github.com/apache/maven-pmd-plugin), [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) and [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin).


Updates `org.apache.maven.plugins:maven-pmd-plugin` from 3.25.0 to 3.26.0
- [Release notes](https://github.com/apache/maven-pmd-plugin/releases)
- [Commits](apache/maven-pmd-plugin@maven-pmd-plugin-3.25.0...maven-pmd-plugin-3.26.0)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.1 to 3.5.2
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.5.1...surefire-3.5.2)

Updates `org.apache.maven.plugins:maven-javadoc-plugin` from 3.10.1 to 3.11.1
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-3.10.1...maven-javadoc-plugin-3.11.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-pmd-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: plugins
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: plugins
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: plugins
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: [DevOps] bump the production-minor-patch group with 2 updates (#133)

Bumps the production-minor-patch group with 2 updates: [io.github.cdimascio:dotenv-java](https://github.com/cdimascio/dotenv-java) and [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle).


Updates `io.github.cdimascio:dotenv-java` from 3.0.0 to 3.0.2
- [Release notes](https://github.com/cdimascio/dotenv-java/releases)
- [Changelog](https://github.com/cdimascio/dotenv-java/blob/master/CHANGELOG.md)
- [Commits](cdimascio/dotenv-java@v3.0.0...v3.0.2)

Updates `com.puppycrawl.tools:checkstyle` from 10.19.0 to 10.20.0
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-10.19.0...checkstyle-10.20.0)

---
updated-dependencies:
- dependency-name: io.github.cdimascio:dotenv-java
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-minor-patch
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-minor-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Dotend load is static (#135)

* [DevOps] Skip Code Generation By Default (#123)

* DevOps Skip Code Generation By Default

* Fix pom file

* Initial migrate coverage check to pom xml (#116)

Co-authored-by: Alexander Dümont <[email protected]>

* Remove unnecessary steps (#115)

Co-authored-by: Alexander Dümont <[email protected]>

* README fix for AICORE_SERVICE_KEY instructions (#137)

* Switch to passing config with method call

* Add Javadoc

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Dümont <[email protected]>
Co-authored-by: I538344 <[email protected]>
Co-authored-by: SAP Cloud SDK Bot <[email protected]>
Co-authored-by: Charles Dubois <[email protected]>
Co-authored-by: Alexander Dümont <[email protected]>
  • Loading branch information
7 people authored Nov 5, 2024
1 parent 66fe024 commit cfabeda
Show file tree
Hide file tree
Showing 39 changed files with 593 additions and 993 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: "Build SDK"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -DskipTests -DskipFormatting"
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} clean install -Dgenerate -DskipTests -DskipFormatting"
mvn $MVN_ARGS
- name: "Verify Local Changes"
Expand All @@ -64,32 +64,11 @@ jobs:
exit 1
fi
- name: "Checkstyle"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} ${{ env.MVN_SKIP_CI_PLUGINS }} -P!build-test-modules org.apache.maven.plugins:maven-checkstyle-plugin:checkstyle"
mvn $MVN_ARGS
python .pipeline/scripts/print-checkstyle.py
- name: "PMD"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} ${{ env.MVN_SKIP_CI_PLUGINS }} org.apache.maven.plugins:maven-pmd-plugin:pmd"
mvn $MVN_ARGS
python .pipeline/scripts/print-pmd.py
- name: "Spotbugs"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} ${{ env.MVN_SKIP_CI_PLUGINS }} com.github.spotbugs:spotbugs-maven-plugin:spotbugs"
mvn $MVN_ARGS
python .pipeline/scripts/print-spotbugs.py
- name: "Run Unit Tests"
run: |
MVN_ARGS="${{ env.MVN_MULTI_THREADED_ARGS }} org.jacoco:jacoco-maven-plugin:prepare-agent surefire:test org.jacoco:jacoco-maven-plugin:report"
mvn $MVN_ARGS
- name: "Coverage Report"
run: python .pipeline/scripts/print-coverage.py --jacoco-report-pattern "**/target/site/jacoco/jacoco.csv"

- name: "Slack Notification"
if: ${{ github.ref == 'refs/heads/main' && failure() }}
uses: slackapi/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .pipeline/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<suppressions>
<!-- Suppress generated clients -->
<suppress files="/core/client/" checks=".*"/>
<suppress files="/orchestration/client/" checks=".*"/>
<suppress files="[/\\]core[/\\]client[/\\]" checks=".*"/>
<suppress files="[/\\]orchestration[/\\]client[/\\]" checks=".*"/>
<!-- Suppress TODOs -->
<suppress files="OpenAiChatCompletionParameters.java" checks="TodoComment" lines="95" />
<suppress files="OpenAiChatMessage.java" checks="TodoComment" lines="255,271" />
Expand Down
25 changes: 1 addition & 24 deletions .pipeline/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,4 @@ steps:
mavenExcludedScopes: ["provided", "test"]
failOn: ['BLOCKER', 'CRITICAL', 'MAJOR']
versioningModel: "major"
detectTools: ['DETECTOR', 'BINARY_SCAN']

stages:
test:
coverageThresholds:
instruction: 14
branch: 3
complexity: 12
line: 46
method: 33
class: 67
codeCheck:
checkstyle:
high: '0'
normal: '0'
low: '0'
spotbugs:
high: '0'
normal: '0'
low: '0'
pmd:
high: '0'
normal: '0'
low: '0'
detectTools: ['DETECTOR', 'BINARY_SCAN']
65 changes: 0 additions & 65 deletions .pipeline/scripts/print-checkstyle.py

This file was deleted.

133 changes: 0 additions & 133 deletions .pipeline/scripts/print-coverage.py

This file was deleted.

72 changes: 0 additions & 72 deletions .pipeline/scripts/print-pmd.py

This file was deleted.

Loading

0 comments on commit cfabeda

Please sign in to comment.