feat(deploy): Add a deployment script to the server and a configurati…#37
Conversation
…on file for the webhook
Руководство для рецензентаДобавляет простой конвейер деплоя с использованием shell-скрипта, вызываемого вебхуком, и немного изменяет контекст сессии базы данных в задаче очистки magic-токенов, чтобы обойти проблемы с проверкой типов. Изменения на уровне файлов
Подсказки и командыВзаимодействие с Sourcery
Персонализация работыЗайдите в свою панель управления, чтобы:
Получение помощи
Original review guide in EnglishReviewer's GuideAdds a simple deployment pipeline using a webhook-configured shell script and slightly adjusts a database session context in the magic token cleanup task to bypass type checking issues. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - я нашёл одну проблему и оставил немного общих комментариев:
# type: ignoreнаSessionLocal()указывает на несоответствие типов; вместо того чтобы полностью отключать проверку типов в этом месте, попробуйте скорректировать тип аннотацииSessionLocalили использовать более точное приведение типов, чтобы mypy мог корректно проверить это использование.- В
deploy/hooks.yamlключparametr, похоже, написан с ошибкой и, скорее всего, будет проигнорирован сервисом вебхуков; перепроверьте ожидаемый формат конфигурации (например,parameterилиrules), чтобы заголовок HMAC действительно был прочитан. - Скрипт деплоя и конфиг вебхука используют жёстко прописанные абсолютные пути и конкретный пользовательский каталог (
/home/fl1rix/SteelTime), что усложняет повторное использование и изменение окружения; рассмотрите возможность параметризовать корень проекта через переменные окружения или одно конфигурационное значение.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `# type: ignore` on `SessionLocal()` suggests a typing mismatch; instead of suppressing all type checking here, consider adjusting the `SessionLocal` type annotation or using a more precise cast so mypy can validate this usage.
- In `deploy/hooks.yaml`, the `parametr` key appears to be misspelled and will likely be ignored by the webhook service; double-check the expected configuration format (e.g., `parameter` or `rules`) so the HMAC header is actually read.
- The deployment script and webhook config hardcode absolute paths and a specific user directory (`/home/fl1rix/SteelTime`), which makes reuse and environment changes difficult; consider parameterizing the project root via environment variables or a single config value instead.
## Individual Comments
### Comment 1
<location path="deploy/hooks.yaml" line_range="8" />
<code_context>
+ match:
+ type: payload-hmac-sha256
+ secret: "ЗАМЕНИТЬ НА РЕАЛЬНЫЙ"
+ parametr:
+ source: header
+ name: X-Hub-Signature-256
</code_context>
<issue_to_address>
**issue (bug_risk):** Check the `parametr` key spelling against the webhook config schema.
In most webhook configs this key is named `parameter` (or another defined field), not `parametr`. With the wrong key name the rule may be ignored. Please verify the correct key in your webhook service’s config schema.
</issue_to_address>Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The
# type: ignoreonSessionLocal()suggests a typing mismatch; instead of suppressing all type checking here, consider adjusting theSessionLocaltype annotation or using a more precise cast so mypy can validate this usage. - In
deploy/hooks.yaml, theparametrkey appears to be misspelled and will likely be ignored by the webhook service; double-check the expected configuration format (e.g.,parameterorrules) so the HMAC header is actually read. - The deployment script and webhook config hardcode absolute paths and a specific user directory (
/home/fl1rix/SteelTime), which makes reuse and environment changes difficult; consider parameterizing the project root via environment variables or a single config value instead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `# type: ignore` on `SessionLocal()` suggests a typing mismatch; instead of suppressing all type checking here, consider adjusting the `SessionLocal` type annotation or using a more precise cast so mypy can validate this usage.
- In `deploy/hooks.yaml`, the `parametr` key appears to be misspelled and will likely be ignored by the webhook service; double-check the expected configuration format (e.g., `parameter` or `rules`) so the HMAC header is actually read.
- The deployment script and webhook config hardcode absolute paths and a specific user directory (`/home/fl1rix/SteelTime`), which makes reuse and environment changes difficult; consider parameterizing the project root via environment variables or a single config value instead.
## Individual Comments
### Comment 1
<location path="deploy/hooks.yaml" line_range="8" />
<code_context>
+ match:
+ type: payload-hmac-sha256
+ secret: "ЗАМЕНИТЬ НА РЕАЛЬНЫЙ"
+ parametr:
+ source: header
+ name: X-Hub-Signature-256
</code_context>
<issue_to_address>
**issue (bug_risk):** Check the `parametr` key spelling against the webhook config schema.
In most webhook configs this key is named `parameter` (or another defined field), not `parametr`. With the wrong key name the rule may be ignored. Please verify the correct key in your webhook service’s config schema.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| match: | ||
| type: payload-hmac-sha256 | ||
| secret: "ЗАМЕНИТЬ НА РЕАЛЬНЫЙ" | ||
| parametr: |
There was a problem hiding this comment.
issue (bug_risk): Проверьте написание ключа parametr в соответствии со схемой конфигурации вебхука.
В большинстве конфигураций вебхуков этот ключ называется parameter (или другим заранее определённым полем), а не parametr. При неверном названии ключа правило может быть проигнорировано. Пожалуйста, уточните корректное имя ключа в схеме конфигурации вашего сервиса вебхуков.
Original comment in English
issue (bug_risk): Check the parametr key spelling against the webhook config schema.
In most webhook configs this key is named parameter (or another defined field), not parametr. With the wrong key name the rule may be ignored. Please verify the correct key in your webhook service’s config schema.
Coverage Report for CI Build 26872096363Coverage remained the same at 30.313%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
1 similar comment
Coverage Report for CI Build 26872096363Coverage remained the same at 30.313%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…on file for the webhook
Summary by Sourcery
Добавить автоматизацию серверного деплоя, запускаемую через вебхук, и внести небольшое изменение в контекст сессии базы данных.
Новые возможности:
Улучшения:
Original summary in English
Summary by Sourcery
Add server-side deployment automation triggered via webhook and make a minor adjustment to a database session context.
New Features:
Enhancements: