Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #150

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ roman.iml
frontend/node_modules
frontend/build
*.iml
!backend/target/surefire-reports
!backend/target/test.result
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @wireapp/integrations
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: CI

on:
push:
branches-ignore:
- master
- staging

pull_request:
types: [ opened, synchronize ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,6 +20,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Run tests
run: make docker-run-tests

- name: Publish test report
uses: EnricoMi/publish-unit-test-result-action/[email protected]
if: always()
with:
files: |
backend/target/reports/TEST-*.xml

- name: Build image
id: docker_build
uses: docker/build-push-action@v2
Expand All @@ -36,10 +42,11 @@ jobs:

# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Docker CI pipeline
fields: repo,message,commit,author,action,eventName,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_CI }}
# Send message only if previous step failed
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ jobs:

# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: ${{ env.SERVICE_NAME }} Quay Production Publish
fields: repo,message,commit,author,action,eventName,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_RELEASE }}
# Send message only if previous step failed
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/quay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ jobs:
release_version=${{ github.event.inputs.tag }}
# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: Roman Quay Custom Tag Pipeline
fields: repo,message,commit,author,action,eventName,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_CI }}
# Send message only if previous step failed
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ jobs:

# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
author_name: ${{ env.SERVICE_NAME }} Quay Staging Publish
fields: repo,message,commit,author,action,eventName,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_RELEASE }}
# Send message only if previous step failed
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile.UnitTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM --platform=linux/x86_64 wirebot/cryptobox:1.4.0 AS test-stage
WORKDIR /app

COPY . ./
WORKDIR /app/backend

# in case of error, write test output status code to /tmp/test.result and exit with 0 for later stages checks.
RUN echo "0" > /tmp/test.result
RUN ./mvnw test -Dmaven.test.skip=false 2>&1 || echo $? > /tmp/test.result || echo "Tests failed"

FROM scratch AS export-stage
COPY --from=test-stage /app/backend/target/surefire-reports/TEST-*.xml /tmp/test.result /
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
docker-run-tests:
./test.sh

db:
docker-compose up -d db

Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ result.
In order to receive events via _Websocket_ connect to:

```
wss://proxy.services.wire.com/api/await/`<app_key>`
wss://proxy.services.wire.com/await/`<app_key>`
```

### Events that are sent as HTTP `POST` to your endpoint (Webhook or Websocket)
Expand Down Expand Up @@ -334,7 +334,7 @@ or

Full description: https://proxy.services.wire.com/swagger#!/default/post

**Note:** `token` that comes with `conversation.init` events is _lifelong_. It should be stored for later usage. `token`
**Note:** `token` that comes with `conversation.bot_request` events is _lifelong_. It should be stored for later usage. `token`
that comes with other event types has lifespan of 20 seconds.

### Bot Examples
Expand All @@ -353,7 +353,7 @@ The best way how to run Roman is to use Docker, another option is to run the Rom
- In order to actually being able to connect to the Wire backend, Roman's endpoints needs to run on HTTPS.
- You need a PostgreSQL instance with an empty database and credentials.
- In order to run it as a Docker container, you need to have Docker installed.
- In order to run it natively on JVM, you need to have JVM 11 installed + all necessary libraries
- In order to run it natively on JVM, you need to have JVM 17 installed + all necessary libraries
for [Cryptobox4j](https://github.com/wireapp/cryptobox4j).

### Configuration
Expand Down Expand Up @@ -455,7 +455,7 @@ env variables. See [Configuration section](#configuration) how to obtain them.

As previously mentioned, Wire recommends running the Roman as a docker container. However, you can run it natively on
the JVM as well.
Please note that Roman requires JVM >= 11. To run it natively, one needs to
Please note that Roman requires JVM >= 17. To run it natively, one needs to
install [Cryptobox4j](https://github.com/wireapp/cryptobox4j)
and other cryptographic libraries. You can use
[Docker Build Image](https://github.com/wireapp/cryptobox4j/blob/master/dockerfiles/Dockerfile.cryptobox)
Expand All @@ -464,17 +464,17 @@ as an inspiration what needs to be installed and what environment variables need
Also, don't forget to read the [Configuration section](#configuration) and set all necessary environment variables for
the Roman itselgf.

First, it is necessary to build the application:
First, it is necessary to build the application under `backend` directory:

```bash
# Maven and JVM 11 is required
mvn package -DskipTests
# Maven and JVM 17 is required
./mvnw package -DskipTests
```

Then to run it like that:

```bash
# JVM 11 required
# JVM 17 required
java -jar target/roman.jar server roman.yaml
```

Expand Down Expand Up @@ -557,6 +557,20 @@ docker-compose -f docker-compose.prod.yml --env-file .env.prod up -d

10. All set! You can go to `https://roman.example.com/swagger` and start using Roman.

## Running Roman tests suite

Tests run with the help of docker containers to setup all requirements.
To run the test suite just run:

```bash
make docker-run-tests
```

or directly:
```bash
./test.sh
```

## Comprehensive tutorial how to onboard new bot

Step-by-step guide, how to create a simple bot for Roman - [onboarding.md](docs/onboarding.md).
2 changes: 2 additions & 0 deletions backend/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Loading
Loading