Skip to content

fix: RM-000 gunicorn app entry#577

Merged
yurake merged 6 commits intomainfrom
fix/gunicorn-app-entry
Jan 28, 2026
Merged

fix: RM-000 gunicorn app entry#577
yurake merged 6 commits intomainfrom
fix/gunicorn-app-entry

Conversation

@yurake
Copy link
Copy Markdown
Owner

@yurake yurake commented Jan 28, 2026

概要

  • Dockerfile の gunicorn 起動引数から --factory を外し、WSGI アプリを直接参照するように修正した。
  • gunicorn のバージョンを 20 系に固定し、起動時の互換性を確保した。

関連リンク

変更内容

  • 主なコード変更
    • Dockerfile の gunicorn 起動対象を pptx_generator.api.flask_app:app に変更
    • src/pptx_generator/api/flask_app.py に WSGI app を公開
    • pyproject.toml / uv.lock の gunicorn 依存を 20 系へ
  • 追加したテスト
    • なし
  • 更新したドキュメント
    • なし
  • その他(サンプル、アセット、設定など)
    • なし

ユーザー影響

  • Docker コンテナ起動時に --factory 未対応で落ちる問題が解消される。
  • 確認方法
    • 実行コマンド: docker build -t pptx-backend-test .docker run --rm -p 8000:8000 -e PPTX_API_BEARER_TOKEN=dev-token-12345 pptx-backend-test
    • 結果の見方: http://localhost:8000/health が 200 を返すこと

動作確認

  • ローカルで想定テストを実行した
    • 実行コマンド: 未実施
  • 追加の手動確認(スクリーンショット、生成物チェックなど)を実施した
    • 添付ファイル/確認方法: 未実施
  • 必要なレビュー観点を満たしている

チェックリスト

  • 該当 ToDo のチェックボックスとメモを最新化した
  • ロードマップ(docs/roadmap/roadmap.md)が最新状態になっている
  • Issue 自動クローズ用に Close #576 を PR 本文へ記載した
  • Issue に進捗コメント(またはクローズコメント)を残した
  • 影響範囲を確認し、必要なドキュメント・サンプルを更新した
  • 生成物(PDF など)がある場合は添付または参照先を明記した
  • PR 本文中の Close #576docs/todo/… などのプレースホルダをすべて実際の値に置き換えた

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4303163489

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/pptx_generator/api/flask_app.py Outdated
@yurake
Copy link
Copy Markdown
Owner Author

yurake commented Jan 28, 2026

@codex 修正したので確認してください

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jan 28, 2026
@yurake
Copy link
Copy Markdown
Owner Author

yurake commented Jan 28, 2026

@codex 再度変更が入ったので内容を確認して

@sonarqubecloud
Copy link
Copy Markdown

@yurake yurake merged commit b26ba40 into main Jan 28, 2026
4 of 5 checks passed
@yurake yurake deleted the fix/gunicorn-app-entry branch January 28, 2026 09:18
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de77f71fd1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +42 to +47
@app.before_request
def _ensure_env_validated(): # type: ignore[unused-local]
if app.config.get("ENV_VALIDATED"):
return None
_validate_required_env(logger)
app.config["ENV_VALIDATED"] = True
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 遅延検証後も認証設定が更新されない

validate_env=False の場合、_ensure_env_validated は必須環境変数の存在チェックだけを行い、app.config に取り込済みの HMAC_KEYS / BEARER_TOKEN を再読み込みしません。アプリ生成後に環境変数を注入する運用(WSGI 設定での secrets 読み込みやテストで os.environ を後から上書きするケース)では検証は通っても認証情報が更新されず、/health 以外のリクエストが常に missing auth で 401 になります。遅延検証を許容するなら、検証成功後に認証設定を再取得して app.config を更新する必要があります。

Useful? React with 👍 / 👎.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Dockerfile の gunicorn 起動で --factory が未対応のため失敗する

1 participant