Skip to content

Comments

notifications config rework#4

Merged
kheina merged 5 commits intomainfrom
dani_notifications-config-rework
Apr 15, 2025
Merged

notifications config rework#4
kheina merged 5 commits intomainfrom
dani_notifications-config-rework

Conversation

@kheina
Copy link
Contributor

@kheina kheina commented Apr 14, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 14, 2025

PR Summary

This PR implements a new notifications system, including database schema changes, API endpoints, and related model updates. It also includes Dockerfile and configuration improvements.

Changes

File Summary
Dockerfile Updated the base image to python:3.13-alpine, added jq, and introduced a docker-exec.sh script to streamline the execution process. Removed unnecessary apt commands.
account/account.py Updated import path for Request from shared.server to shared.models.server.
account/router.py Updated import path for Request from shared.server to shared.models.server. Removed /bot/renew and /bot/internal endpoints.
authenticator/authenticator.py Added aerospike import, improved error handling for index creation, and updated KhUser import path. Refactored token generation and key management.
avro_schema_repository/schema_repository.py Replaced CRC with sha1 for fingerprint generation. Updated caching mechanism and schema handling. Improved error handling.
configs/configs.py Refactored config management, using enums for config types and stores. Updated caching and data handling. Improved error handling.
configs/models.py Introduced enums for config types and user config types. Updated models for better type safety and structure. Added Store base class.
configs/router.py Removed startup event handler and updated config update endpoint.
db/10/00-add-notification-subscriptions.sql New file. Added subscriptions and notifications tables to the database. Created functions for subscription management.
db/11/00-create-user-configs-table.sql New file. Created user_configs table for user-specific configurations.
docker-exec.sh New file. This script handles certificate loading and gunicorn execution within the Docker container.
emojis/repository.py Updated import path for Users from users to users.repository.
emojis/router.py Updated import path for Request from shared.server to shared.models.server.
init.py Added lock option to execSql command. Updated key generation and management. Improved error handling.
k8s.yml Updated the Docker image SHA to sha256:53b0898536ff726a2557ea55cb9bdc99cdadeb310185af21093eb8ad88d1a452.
notifications/__init__.py New file.
notifications/models.py New file. Defines models for notifications, subscriptions, and related data structures.
notifications/notifications.py New file. Implements notification logic, including fetching, sending, and managing subscriptions.
notifications/repository.py New file. Provides database interaction and caching for notifications.
notifications/router.py New file. Defines API endpoints for managing notifications.
posts/blocking.py Updated BlockTree to handle both string and integer tags. Improved tag handling and blocking logic.
posts/models.py Updated Post model to include locked field. Added Rating enum.
posts/posts.py Updated import path for Sets and Posts. Improved query efficiency and error handling.
posts/repository.py Updated import paths for Users, Tags, and Posts. Improved caching and data handling. Updated query efficiency.
posts/router.py Updated import path for Request from shared.server to shared.models.server.
posts/uploader.py Added image and video validation. Improved thumbnail generation and upload. Added notification support.
reporting/mod_actions.py Updated import paths for Posts and Users. Improved action handling and caching. Updated ban management.
reporting/models/__init__.py Renamed ReportReponseRequest to CloseReponseRequest.
reporting/models/actions.py Updated enum assertions for better type safety.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (2)
Files Processed (30)
  • .dockerignore (1 hunk)
  • Dockerfile (3 hunks)
  • account/account.py (1 hunk)
  • account/router.py (2 hunks)
  • authenticator/authenticator.py (9 hunks)
  • avro_schema_repository/schema_repository.py (4 hunks)
  • configs/configs.py (8 hunks)
  • configs/models.py (5 hunks)
  • configs/router.py (4 hunks)
  • db/10/00-add-notification-subscriptions.sql (1 hunk)
  • db/11/00-create-user-configs-table.sql (1 hunk)
  • docker-exec.sh (1 hunk)
  • emojis/repository.py (1 hunk)
  • emojis/router.py (1 hunk)
  • init.py (5 hunks)
  • notifications/init.py (0 hunks)
  • notifications/models.py (1 hunk)
  • notifications/notifications.py (1 hunk)
  • notifications/repository.py (1 hunk)
  • notifications/router.py (1 hunk)
  • posts/blocking.py (4 hunks)
  • posts/models.py (3 hunks)
  • posts/posts.py (5 hunks)
  • posts/repository.py (30 hunks)
  • posts/router.py (2 hunks)
  • posts/uploader.py (29 hunks)
  • reporting/mod_actions.py (9 hunks)
  • reporting/models/init.py (1 hunk)
  • reporting/models/actions.py (1 hunk)
  • reporting/models/bans.py (1 hunk)
Actionable Comments (0)
Skipped Comments (0)

@kheina kheina merged commit 14b270a into main Apr 15, 2025
1 check passed
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (3)
Files Processed (17)
  • .dockerignore (1 hunk)
  • Dockerfile (2 hunks)
  • authenticator/authenticator.py (10 hunks)
  • configs/configs.py (8 hunks)
  • configs/models.py (5 hunks)
  • configs/router.py (4 hunks)
  • db/10/00-add-notification-subscriptions.sql (1 hunk)
  • db/11/00-create-user-configs-table.sql (1 hunk)
  • docker-exec.sh (1 hunk)
  • k8s.yml (1 hunk)
  • notifications/models.py (1 hunk)
  • notifications/notifications.py (1 hunk)
  • notifications/repository.py (1 hunk)
  • notifications/router.py (1 hunk)
  • posts/blocking.py (4 hunks)
  • posts/repository.py (30 hunks)
  • reporting/models/init.py (1 hunk)
Actionable Comments (0)
Skipped Comments (0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant