Skip to content

Commit

Permalink
Merge branch 'main' into wip-merge-main-patriknw
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw committed Dec 19, 2024
2 parents 80fb437 + 2ec5f11 commit 488d784
Show file tree
Hide file tree
Showing 83 changed files with 299 additions and 150 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ jobs:
fi
if [ true == '${{matrix.it}}' ]; then
${PRE_CMD}
KALIX_TESTKIT_DEBUG=true mvn verify -Pit --no-transfer-progress
KALIX_TESTKIT_DEBUG=true mvn integration-test --no-transfer-progress
fi
- name: ${{ matrix.sample }} rm & test-compile
Expand All @@ -450,5 +450,5 @@ jobs:
export SDK_VERSION=$(cat ~/akka-javasdk-version.txt)
cd samples/${DIR}
echo "==== Verifying that generated unmanaged sources compile ===="
rm -rf src/main/java src/test/java src/it/java
rm -rf src/main/java src/test/java
mvn test-compile --no-transfer-progress
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Business Source License 1.1
Parameters

Licensor: Lightbend, Inc.
Licensed Work: Akka SDK for Java v 3.0.1
Licensed Work: Akka SDK for Java v 3.0.2
The Licensed Work is (c) 2024 Lightbend Inc.

Change Date: 2027-12-03
Change Date: 2027-12-12

Change License: Apache License, Version 2.0

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ attributes: prepare
> "${managed_partials}/attributes.adoc"
docs/bin/version.sh | xargs -0 printf ":akka-javasdk-version: %s" \
> "${managed_partials}/attributes.adoc"
echo ":akka-cli-version: 3.0.6" >> "${managed_partials}/attributes.adoc"
echo ":akka-cli-version: 3.0.8" >> "${managed_partials}/attributes.adoc"
echo ":akka-cli-min-version: 3.0.4" >> "${managed_partials}/attributes.adoc"
# see https://adoptium.net/marketplace/
echo ":java-version: 21" \
Expand Down
4 changes: 2 additions & 2 deletions akka-javasdk-maven/akka-javasdk-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>akka-javasdk-archetype</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<packaging>maven-archetype</packaging>
<parent>
<groupId>io.akka</groupId>
<artifactId>akka-javasdk-maven</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>

<name>Akka SDK for Java Maven Archetype</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</includes>
</fileSet>
<fileSet filtered="true">
<directory>src/it/java</directory>
<directory>src/test/java</directory>
<includes>
<include>**/*</include>
</includes>
Expand Down
63 changes: 38 additions & 25 deletions akka-javasdk-maven/akka-javasdk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>io.akka</groupId>
<artifactId>akka-javasdk-maven</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
</parent>

<groupId>io.akka</groupId>
<artifactId>akka-javasdk-parent</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<packaging>pom</packaging>


Expand All @@ -34,7 +34,7 @@

<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>

<akka-javasdk.version>3.0.1</akka-javasdk.version>
<akka-javasdk.version>3.0.2</akka-javasdk.version>

<!-- These are dependent on runtime environment and cannot be customized by users -->
<maven.compiler.release>21</maven.compiler.release>
Expand Down Expand Up @@ -73,12 +73,6 @@


<build>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>

<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
Expand Down Expand Up @@ -284,7 +278,27 @@
</systemPropertyVariables>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTest.java</include>
<include>**/*IT.java</include>
<include>**/IT*.java</include>
<include>**/*ITCase.java</include>
</includes>
<argLine>-Dlogback.configurationFile=${logback.configurationFile} -Dakka.javasdk.dev-mode.project-artifact-id=${project.artifactId}</argLine>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down Expand Up @@ -335,6 +349,11 @@
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
Expand All @@ -359,36 +378,30 @@
<profiles>

<profile>
<!-- run Integration Tests in src/it/java with `mvn verify -Pit`-->
<id>it</id>
<build>
<plugins>
<plugin>
<!-- run *IntegrationTest with failsafe -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
<goal>execute</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTest</include>
</includes>
<argLine>-Dlogback.configurationFile=${logback.configurationFile} -Dakka.javasdk.dev-mode.project-artifact-id=${project.artifactId}</argLine>
<source>
log.warn('The 'it' profile is deprecated. It will be removed in future versions. Integration tests only need `mvn integration-test` to run.')
</source>
</configuration>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profile>

<profile>
<id>clean-on-missing-descriptor</id>
Expand Down
2 changes: 1 addition & 1 deletion akka-javasdk-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>io.akka</groupId>
<artifactId>akka-javasdk-maven</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<packaging>pom</packaging>

<name>Akka SDK for Java Maven</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public SpiSettings getSettings() {
proxyPort,
settings.aclEnabled,
false,
settings.serviceName,
settings.serviceName + "-IT-" + System.currentTimeMillis(),
eventingSettings,
mockedEventingSettings,
true);
Expand Down
8 changes: 5 additions & 3 deletions akka-javasdk/src/main/scala/akka/javasdk/impl/SdkRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ class SdkRunner private (dependencyProvider: Option[DependencyProvider]) extends
startContext.remoteIdentification,
startContext.tracerFactory,
dependencyProvider,
startedPromise)
startedPromise,
getSettings.devMode.map(_.serviceName))
Future.successful(app.spiComponents)
} catch {
case NonFatal(ex) =>
Expand Down Expand Up @@ -296,7 +297,8 @@ private final class Sdk(
remoteIdentification: Option[RemoteIdentification],
tracerFactory: String => Tracer,
dependencyProviderOverride: Option[DependencyProvider],
startedPromise: Promise[StartupContext]) {
startedPromise: Promise[StartupContext],
serviceNameOverride: Option[String]) {
private val logger = LoggerFactory.getLogger(getClass)
private val serializer = new JsonSerializer
private val ComponentLocator.LocatedClasses(componentClasses, maybeServiceClass) =
Expand Down Expand Up @@ -617,7 +619,7 @@ private final class Sdk(

override val serviceInfo: SpiServiceInfo =
new SpiServiceInfo(
serviceName = sdkSettings.devModeSettings.map(_.serviceName).getOrElse(""),
serviceName = serviceNameOverride.orElse(sdkSettings.devModeSettings.map(_.serviceName)).getOrElse(""),
sdkName = "java",
sdkVersion = BuildInfo.version,
protocolMajorVersion = BuildInfo.protocolMajorVersion,
Expand Down
42 changes: 42 additions & 0 deletions docs/src/modules/ROOT/partials/cli-install-short.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Install the Akka CLI:

NOTE: In case there is any trouble with installing the CLI when following these instructions, please check xref:reference:cli/installation.adoc[].

[.tabset]
Linux::
+
--
Download and install the latest version of `akka`:
[source,bash]
....
curl -sL https://doc.akka.io/install-cli.sh | bash
....

--
macOS::
+
--
The recommended approach to install `akka` on macOS, is using https://brew.sh[brew, window="new"]

[source,bash]
----
brew install akka/brew/akka
----

--
Windows::
+
--

. Download the latest version of `akka` from https://downloads.akka.io/latest/akka_windows_amd64.zip[https://downloads.akka.io/latest/akka_windows_amd64.zip]

. Extract the zip file and move `akka.exe` to a location on your `%PATH%`.

--

Verify that the Akka CLI has been installed successfully by running the following to list all available commands:

[source, command window]
----
akka help
----
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/src/modules/java/pages/access-control.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ ACL rules will be applied whenever a call is made using testkit's `HttpClient`.
originating from the internet. You can disable the ACL checks by overriding the `testKitSettings()` method.

[source, java, indent=0]
.{sample-base-url}/doc-snippets/src/it/java/com/example/acl/UserEndpointIntegrationTest.java[UserEndpointIntegrationTest.java]
.{sample-base-url}/doc-snippets/src/test/java/com/example/acl/UserEndpointIntegrationTest.java[UserEndpointIntegrationTest.java]
----
include::example$doc-snippets/src/it/java/com/example/acl/UserEndpointIntegrationTest.java[tag=disable-acl-in-it]
include::example$doc-snippets/src/test/java/com/example/acl/UserEndpointIntegrationTest.java[tag=disable-acl-in-it]
----

Calls made through the `ComponentClient` are internal to the service and therefore no ACL rule is applied.
4 changes: 2 additions & 2 deletions docs/src/modules/java/pages/auth-with-jwts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ When running locally, by default, a dev key with id `dev` is configured for use.
When running integration tests, JWTs will still be enforced but its signature will not be validated, similarly to what is described above for when running locally. Thus, when making calls in the context of integration testing, make sure to inject a proper token with the required claims, as shown below:

[source, java, indent=0]
.{sample-base-url}/endpoint-jwt/src/it/java/hellojwt/api/HelloJwtIntegrationTest.java[HelloJwtIntegrationTest.java]
.{sample-base-url}/endpoint-jwt/src/test/java/hellojwt/api/HelloJwtIntegrationTest.java[HelloJwtIntegrationTest.java]
----
include::example$endpoint-jwt/src/it/java/hellojwt/api/HelloJwtIntegrationTest.java[tag=bearer-token-claims-test]
include::example$endpoint-jwt/src/test/java/hellojwt/api/HelloJwtIntegrationTest.java[tag=bearer-token-claims-test]
----
<1> Use a helper method to create a JWT token with 2 claims: issuer and subject.
<2> Inject the bearer token as header with the key `Authorization`.
Expand Down
Loading

0 comments on commit 488d784

Please sign in to comment.