Add repository audit/upgrade plan, web UI hardening, file previews, and CI workflow - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1b949f7b9
ℹ️ 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".
| request.project_path = str(project_path) | ||
| request.output_path = str(output_path) | ||
| request.ollama_url = ollama_url | ||
| request.extra_ignore_dirs = validate_extra_ignore_dirs(request.extra_ignore_dirs) |
There was a problem hiding this comment.
Handle invalid exclude dirs inside analyze input try-block
Move validate_extra_ignore_dirs() into the existing try/except in analyze(), otherwise malformed entries (for example "../tmp") raise ValueError after the handler and return a 500 instead of a controlled 400/422 response. This breaks the new hardening path for exactly the invalid-input case it is meant to handle.
Useful? React with 👍 / 👎.
|
|
||
| def enforce_analyze_rate_limit() -> int: | ||
| raw_limit = os.environ.get(ANALYZE_RATE_LIMIT_PER_MIN_ENV, "60") | ||
| limit = int(raw_limit) |
There was a problem hiding this comment.
Guard non-integer rate-limit env values
Parsing PROJECT_PROMPTER_ANALYZE_RATE_LIMIT_PER_MIN with a bare int() means any non-numeric deployment value causes every analyze request to fail with a ValueError path. Because this is configuration-driven and affects all users until fixed, the parser should catch conversion errors and fall back to a safe default (or fail fast at startup with a clear operator-facing message).
Useful? React with 👍 / 👎.
Motivation
Description
project_prompter.auditto run baseline repo audits and generate markdown upgrade plans, and wire it to a new--planCLI flag and_run_planhandler inproject_prompter.cli.project_prompter.web_security(rate limiting andextra_ignore_dirsvalidation),project_prompter.web_services(bounded per-file and total preview generation), request model validation fields inproject_prompter.web, and improved error handling for analysis tasks.project_prompter.web_routes) and include preview truncation metadata in scan results..github/workflows/ci.ymlwith a Python 3.10–3.12 matrix that installs dev deps and runspytest,ruff,mypy(on core modules),bandit, andpip-audit(allowed to fail), and updatepyproject.tomldev dependencies accordingly.tests/.Testing
pytestwhich exercisestests/test_audit.py,tests/test_cli_plan.py, andtests/test_web_rate_limit.py, and the test suite completed successfully.rufflinting,mypyonproject_prompter/audit.pyandproject_prompter/web_security.py, andbanditsecurity scan, all configured to run in the workflow.pip-auditis included in the CI but allowed to fail (|| true) to avoid breaking the matrix on transient dependency audit failures.Codex Task