Skip to content

Commit 1164986

Browse files
authored
fix: update dependencies and allow disable metrics (#142)
* feat(upgrade): Update deprecated properties to current opentelemetry, update dependencies and example dependencies * fix: ensure application started avoid warn log * docs: add docs site * Add new workflow, fix package permissions
1 parent 5fa472c commit 1164986

86 files changed

Lines changed: 26700 additions & 3108 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-channel-sender.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,43 @@ jobs:
3131
- name: Generate a token of Github APP
3232
id: generate_token
3333
if: github.ref == 'refs/heads/main'
34-
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
34+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
3535
with:
36-
app_id: ${{ secrets.APP_ID_ADMIN_GITHUB }}
37-
private_key: ${{ secrets.APP_PRIVATE_KEY_ADMIN_GITHUB }}
38-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
app-id: ${{ secrets.APP_ID_ADMIN_GITHUB }}
37+
private-key: ${{ secrets.APP_PRIVATE_KEY_ADMIN_GITHUB }}
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3939
if: github.ref == 'refs/heads/main'
4040
with:
4141
token: ${{ steps.generate_token.outputs.token }}
42-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4343
if: github.ref != 'refs/heads/main'
4444

4545
- name: Verify Conventional Commits
46-
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
46+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
4747
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
4848
env:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
- name: Set up NodeJS
5151
if: github.ref == 'refs/heads/main'
52-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
52+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
5353
with:
5454
node-version-file: './channel-sender/.nvmrc'
5555
- name: Set up Semantic Release
5656
if: github.ref == 'refs/heads/main'
57-
run: npm -g install @semantic-release/git semantic-release@23.0.0
57+
run: npm -g install @semantic-release/git semantic-release
5858
- name: Semantic Release
5959
if: github.ref == 'refs/heads/main'
60-
run: npx semantic-release@23.0.0
60+
run: npx semantic-release
6161
env:
6262
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
6363

6464
- name: Set up Elixir
65-
uses: erlef/setup-beam@v1.17.6
65+
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
6666
with:
6767
version-type: strict
6868
version-file: "./channel-sender/.tool-versions"
6969
- name: Restore dependencies cache
70-
uses: actions/cache@v4
70+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
7171
with:
7272
path: deps
7373
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
@@ -94,10 +94,10 @@ jobs:
9494
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9595
- name: Setup PR Report tool
9696
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
97-
uses: hrishikesh-kadam/setup-lcov@v1
97+
uses: hrishikesh-kadam/setup-lcov@6c1aa0cc9e1c02f9f58f01ac599f1064ccc83470 # v1.1.0
9898
- name: Validate code coverage
9999
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
100-
uses: zgosalvez/github-actions-report-lcov@v3
100+
uses: zgosalvez/github-actions-report-lcov@4eb99c09644c30cceb609413620bd9e1bf80ee79 # v6.0.1
101101
with:
102102
coverage-files: ./channel-sender/cover/lcov.info
103103
minimum-coverage: 70

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: 'async-dataflow-docs'
2+
on:
3+
release:
4+
types:
5+
- released
6+
push:
7+
branches:
8+
- master
9+
workflow_dispatch:
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v6
26+
# Next steps will only run if generation code templates have been changed
27+
- name: Detect changes in generated code
28+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
29+
id: changes
30+
with:
31+
filters: |
32+
docs:
33+
- 'docs/**'
34+
- name: Set release mode
35+
if: github.event_name == 'release'
36+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
37+
- name: Setup Node.js
38+
if: github.event_name == 'release' || steps.changes.outputs.docs == 'true'
39+
uses: actions/setup-node@v6
40+
with:
41+
node-version-file: 'docs/.nvmrc'
42+
- name: Install dependencies
43+
if: github.event_name == 'release' || steps.changes.outputs.docs == 'true'
44+
run: npm ci
45+
working-directory: docs
46+
- name: Build docs
47+
if: github.event_name == 'release' || steps.changes.outputs.docs == 'true'
48+
run: npm run build
49+
working-directory: docs
50+
- name: Upload artifact
51+
if: github.event_name == 'release' || steps.changes.outputs.docs == 'true'
52+
uses: actions/upload-pages-artifact@v4
53+
with:
54+
path: 'docs/build/'
55+
- name: Deploy to GitHub Pages
56+
if: github.event_name == 'release' || steps.changes.outputs.docs == 'true'
57+
id: deployment
58+
uses: actions/deploy-pages@v4

.github/workflows/release-channel-sender.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
working-directory: channel-sender
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
13+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414
- name: Login to Docker Hub
15-
uses: docker/login-action@v3
15+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
1616
with:
1717
username: ${{ secrets.DOCKER_USER }}
1818
password: ${{ secrets.DOCKER_TOKEN }}
1919
- name: Set up QEMU
20-
uses: docker/setup-qemu-action@v3
20+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
2121
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
22+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
2323
- name: Config Builder
2424
run: docker buildx create --name mbuilder && docker buildx use mbuilder
2525
- name: Docker Build Multiplatform

.github/workflows/release-client-js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
permissions:
77
id-token: write # Required for OIDC
88
contents: read
9+
packages: write
910
jobs:
1011
build:
1112
defaults:

README.md

Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,6 @@
44

55
The Async DataFlow component aims to deliver asynchronous responses in real time to client applications, thus enabling end-to-end asynchronois flows without losing the ability to respond in real time or eventually, send data to client applications as a result of asynchronous operations and oriented to `messages / commands / events` on the platform.
66

7+
## Documentation
78

8-
## Repository
9-
10-
- [Channel Sender](https://github.com/bancolombia/async-dataflow/tree/master/channel-sender) Distributed Elixir Cluster implementation of real time with websockets and notifications channels.
11-
12-
```mermaid
13-
C4Dynamic
14-
Boundary(aa, "Client side applications") {
15-
Component(cli, "Single Page Application or Mobile App", "Javascript / Angular /Flutter", "")
16-
}
17-
18-
Boundary(xx, "ADF") {
19-
Component(sender, "Channel Sender", "", "")
20-
}
21-
22-
Boundary(zz, "Backend") {
23-
Component(abl, "Async business logic")
24-
}
25-
26-
Rel(cli, sender, "create connection")
27-
Rel(cli, abl, "Call Http or another entry point definition")
28-
Rel(abl, cli, "Return Http Empty response")
29-
Rel(abl, sender, "Send Response (Http)")
30-
Rel(sender, cli, "Send Response (websocket)")
31-
32-
UpdateElementStyle(sender, $fontColor="black", $bgColor="orange", $borderColor="black")
33-
34-
UpdateRelStyle(cli, sender, $offsetX="-40", $offsetY="-20")
35-
UpdateRelStyle(cli, abl, $offsetX="-240", $offsetY="-40")
36-
UpdateRelStyle(abl, cli, $offsetX="30", $offsetY="-40")
37-
UpdateRelStyle(abl, sender, $offsetX="-60", $offsetY="40")
38-
UpdateRelStyle(sender, cli, $offsetX="-40", $offsetY="20")
39-
40-
UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2")
41-
```
42-
43-
44-
- [Channel Streams](https://github.com/bancolombia/async-dataflow/tree/master/channel-streams) Distributed Elixir Cluster implementation of a async messages router.
45-
46-
```mermaid
47-
C4Dynamic
48-
49-
Boundary(zz, "Backend") {
50-
Component(abl, "Async business logic")
51-
SystemDb(bus, "Event bus")
52-
}
53-
54-
Boundary(xx, "ADF") {
55-
Component(sender, "Channel Sender", "", "")
56-
Component(streams, "Channel Streams", "", "")
57-
}
58-
59-
Boundary(aa, "Client side applications") {
60-
Component(cli, "Single Page Application or Mobile App", "Javascript / Angular /Flutter", "")
61-
}
62-
63-
Rel(abl, bus, "Emit event")
64-
Rel(bus, streams, "Subscribe event")
65-
Rel(streams, sender, "route [Http]")
66-
Rel(sender, cli, "Push response [websocket]")
67-
68-
UpdateElementStyle(sender, $fontColor="black", $bgColor="orange", $borderColor="black")
69-
UpdateElementStyle(streams, $fontColor="black", $bgColor="green", $borderColor="black")
70-
71-
UpdateRelStyle(abl, bus, $offsetX="-40", $offsetY="-40")
72-
UpdateRelStyle(bus, streams, $offsetX="-40", $offsetY="-20")
73-
UpdateRelStyle(streams, sender, $offsetX="-33", $offsetY="-20")
74-
UpdateRelStyle(sender, cli, $offsetX="-40", $offsetY="-10")
75-
76-
UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1")
77-
```
78-
79-
80-
- [Client JS](https://github.com/bancolombia/async-dataflow/tree/master/clients/client-js) Javascript library for async data flow implementation for browsers.
81-
- [Client Dart](https://github.com/bancolombia/async-dataflow/tree/master/clients/client-dart) Dart library for async data flow implementation for flutter applications.
82-
83-
- [Examples](https://github.com/bancolombia/async-dataflow/tree/master/examples)
84-
The purpose of this project is to help the community to understand more the the async data flow component to implement in full asyncio solutions.
85-
86-
## How can I help?
87-
88-
Review the [issues](https://github.com/bancolombia/async-dataflow/issues). Read [how Contributing](https://github.com/bancolombia/async-dataflow/wiki/Contributing).
9+
The documentation for this component is available in the [Async DataFlow Documentation Site](https://bancolombia.github.io/async-dataflow/).

channel-sender/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.0
1+
v24.12.0

channel-sender/.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
erlang 27.3
2-
elixir 1.18.4-otp-27
1+
erlang 28.3.1
2+
elixir 1.19.5-otp-28

channel-sender/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#===============
22
# Build Stage
33
#===============
4-
FROM elixir:1.18.4-otp-27-alpine as build
4+
FROM elixir:1.19.5-otp-28-alpine as build
55

66
ARG BUILD_ENV=prod
77

@@ -29,7 +29,7 @@ RUN mix release channel_sender_ex && \
2929
#===================
3030
# Deployment Stage
3131
#===================
32-
FROM alpine:3.22.2
32+
FROM alpine:3.23
3333

3434
RUN apk upgrade --no-cache && \
3535
apk add --no-cache \
@@ -52,5 +52,4 @@ USER adfuser
5252
VOLUME /app/config
5353

5454
ENTRYPOINT ["/bin/bash"]
55-
CMD ["/app/runner.sh"]
56-
55+
CMD ["/app/runner.sh"]

channel-sender/README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
11
# Channel Sender
22

3-
[![Docker Hub](https://img.shields.io/docker/pulls/bancolombia/async-dataflow-channel-sender?label=Docker%20Hub)](https://hub.docker.com/repository/docker/bancolombia/async-dataflow-channel-sender)
4-
5-
- [Requirements](#requirements)
6-
- [Install](#install)
7-
- [Configuration](#configuration)
8-
- [Run](#run)
9-
- [Clients](#clients)
10-
11-
Distributed Elixir Cluster implementation of real time with websockets and notifications channels.
12-
13-
This service is part of the Async Dataflow project, which is a set of tools to facilitate the implementation
14-
of real-time applications.
15-
16-
Channel sender main purpose is to allow backend services to send messages via a real time channel (websocket) to your
17-
front end application(s) (web or mobile). Enabling you to implement real time notifications, updates, etc.
18-
19-
```mermaid
20-
flowchart LR
21-
subgraph
22-
A(Backend service) -- send message --> B[ADF channel sender]
23-
A2(Backend service) -- send message --> B
24-
A3(Backend service) -- send message --> B
25-
end
26-
B -- send message --> C(Front end application)
27-
```
3+
See [Usage Documentation](https://bancolombia.github.io/async-dataflow/docs/channel-sender) for the Channel Sender component of the Async DataFlow project.
284

29-
See detailed [docs](docs/main.md) for more information.
5+
# Local Setup
306

317
## Requirements
328

channel-sender/bench/single_socket_delivery_bench.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ defmodule SingleSocketDeliveryBench do
3030
1000 -> raise "Websocket upgrade timeout!"
3131
end
3232

33-
:gun.ws_send(conn, {:text, "Auth::#{secret}"})
33+
:gun.ws_send(conn, stream, {:text, "Auth::#{secret}"})
3434

3535
data_string = receive do
3636
{:gun_ws, ^conn, ^stream, {:text, data_string}} -> data_string
@@ -89,10 +89,10 @@ send_and_receive_sequential = fn {conn, stream, channel_id} ->
8989
receive do
9090
{:gun_ws, ^conn, ^stream, {:text, data}} ->
9191
{message_id, _, _, _, _} = JsonEncoder.decode_message(data)
92-
:gun.ws_send(conn, {:text, "Ack::" <> message_id})
92+
:gun.ws_send(conn, stream, {:text, "Ack::" <> message_id})
9393
{:gun_ws, ^conn, ^stream, {:binary, data}} ->
9494
{message_id, _, _, _, _} = BinaryEncoder.decode_message(data)
95-
:gun.ws_send(conn, {:text, "Ack::" <> message_id})
95+
:gun.ws_send(conn, stream, {:text, "Ack::" <> message_id})
9696
after
9797
100 ->
9898
raise "No message!"

0 commit comments

Comments
 (0)