Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
707ac50
feat: update yml and compose files
Shumer-1 Apr 20, 2025
48ac30a
feat: add kafka producer to scrapper
Shumer-1 Apr 20, 2025
b81f8d1
feat: add kafka consumer and dlq to bot
Shumer-1 Apr 20, 2025
471c759
feat: add kafka notification service
Shumer-1 Apr 20, 2025
2e986ef
feat: add redis cache
Shumer-1 Apr 20, 2025
29e844a
test: add tests to bot (kafka and cache)
Shumer-1 Apr 20, 2025
d05ce7e
feat: add retries and some kafka configs
Shumer-1 May 2, 2025
e8a833d
test: update tests
Shumer-1 May 3, 2025
ec2f211
refactor: use spotless:apply and refactor code for checkstyle
Shumer-1 May 3, 2025
5505779
refactor: delete unnecessary semicolon
Shumer-1 May 3, 2025
ec0fb43
refactor: use spotless:apply
Shumer-1 May 3, 2025
4b82e60
feat: add avro schemas to kafka
Shumer-1 May 4, 2025
1c80325
chore: add pom to avro-schemas
Shumer-1 May 4, 2025
f35b40b
refactor: use spotless:apply and update plugin and excludes
Shumer-1 May 4, 2025
9dfda5f
Update build.yaml
Shumer-1 May 4, 2025
dc6b57f
Update build.yaml
Shumer-1 May 4, 2025
c554428
Update build.yaml
Shumer-1 May 4, 2025
6e4048e
Update build.yaml
Shumer-1 May 4, 2025
c2df925
Update build.yaml
Shumer-1 May 4, 2025
5e9d0fe
chore: update version
Shumer-1 May 4, 2025
7181f1a
test: update tests
Shumer-1 May 4, 2025
b4119eb
test: temporarily commented
Shumer-1 May 4, 2025
88519a1
refactor: use spotless:apply
Shumer-1 May 4, 2025
ab725c0
chore: update dependencies in poms
Shumer-1 May 4, 2025
976523d
feat: add retries, circuit breaker to bot
Shumer-1 May 4, 2025
47cf17d
feat: add retries, circuit breaker to scrapper
Shumer-1 May 4, 2025
34bd243
fix: fix avro parsing errors
Shumer-1 May 5, 2025
a04dbf4
feat: add notification fallback
Shumer-1 May 6, 2025
73990f0
test: add fallback test
Shumer-1 May 6, 2025
f46802e
fix: add primary annotation
Shumer-1 May 6, 2025
e8d5d71
feat: use CB and add new field - bean name
Shumer-1 May 25, 2025
70c586d
feat: add RL for each endpoint
Shumer-1 May 25, 2025
e3cf13e
feat: add new CB
Shumer-1 May 25, 2025
851dcea
feat: add dockerfiles and yml
Shumer-1 May 25, 2025
8f261fb
feat: add tests
Shumer-1 Sep 21, 2025
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
67 changes: 67 additions & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Bot Build

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/bot.yml
- bot/**

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/bot

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up Java 22
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
cache: maven

- name: Maven package
run: mvn -f bot/pom.xml clean package

- id: jacoco
uses: madrapps/jacoco-report@v1.6.1
if: github.event_name != 'workflow_dispatch'
with:
paths: bot/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 30
min-coverage-changed-files: 30
title: Code Coverage
update-comment: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build & push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: bot.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TELEGRAM_TOKEN=${{ secrets.TELEGRAM_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/build.yaml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/scrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Scrapper Build

on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/scrapper.yml
- scrapper/**
- link-parser/**

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/scrapper

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Maven package
run: mvn -f scrapper/pom.xml clean package

- id: jacoco
uses: madrapps/jacoco-report@v1.6.1
if: github.event_name != 'workflow_dispatch'
with:
paths: scrapper/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 30
min-coverage-changed-files: 30
title: Code Coverage
update-comment: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build & push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: scrapper.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SO_TOKEN_KEY=${{ secrets.SO_TOKEN_KEY }}
63 changes: 63 additions & 0 deletions avro-schemas/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- 1. Наследуемся от корневого агрегатора -->
<parent>
<groupId>backend.academy</groupId>
<artifactId>root</artifactId>
<version>1.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>backend.academy</groupId>
<artifactId>avro-schemas</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Avro Schemas Module</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<!-- 2. Зависимость на runtime Avro -->
<dependencies>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.11.3</version>
</dependency>
</dependencies>

<!-- 3. Подключаем и настраиваем плагин генерации -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.26.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.11.3</version>
<executions>
<execution>
<id>generate-avro-sources</id>
<goals>
<goal>schema</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<sourceDirectory>${project.basedir}/src/main/avro</sourceDirectory>
<stringType>String</stringType>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
15 changes: 15 additions & 0 deletions avro-schemas/src/main/avro/NotificationRequest.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"namespace": "backend.academy.avro",
"type": "record",
"name": "NotificationRequest",
"fields": [
{
"name": "message",
"type": "string"
},
{
"name": "userId",
"type": "long"
}
]
}
14 changes: 14 additions & 0 deletions bot/bot.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM maven:3.8.8-eclipse-temurin-22 AS build
WORKDIR /workspace
COPY bot/pom.xml bot/pom.xml
COPY bot/src bot/src
RUN mvn -f bot/pom.xml clean package -DskipTests

FROM eclipse-temurin:22-jre-alpine
WORKDIR /app
COPY --from=build /workspace/bot/target/bot.jar ./bot.jar

ARG APP_TELEGRAM_TOKEN
ENV APP_TELEGRAM_TOKEN=${APP_TELEGRAM_TOKEN}
EXPOSE 8090
ENTRYPOINT ["sh", "-c", "java -jar -Dapp.telegram-token=$APP_TELEGRAM_TOKEN /app/bot.jar"]
Loading
Loading