Implement unified GitHub issue creation script and refactor existing scripts - #82
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to consolidate GitHub issue creation automation into a unified Python entrypoint with shared library modules, while also updating wrappers/docs and expanding the repo’s local-dev Docker + dependency/tooling setup.
Changes:
- Added a new unified issue-creation CLI (
scripts/create_issues.py) and updated wrapper scripts to invoke it. - Added new unit tests for the new issue-creation library surface (Config/Validator/Tracker/GitHub client auth).
- Updated Docker development setup (compose + dev Dockerfiles), dependency versions, and multiple docs to reflect new workflows.
Reviewed changes
Copilot reviewed 39 out of 42 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/test_lib_modules.py | Adds unit tests for new lib modules (Config/validator/tracker/GitHub auth). |
| scripts/tests/init.py | Declares scripts test package and scope. |
| scripts/run-issue-creation.sh | Refactors bash wrapper to discover repo + call unified script. |
| scripts/run-issue-creation.ps1 | Adds PowerShell wrapper with repo discovery + unified script invocation. |
| scripts/create_issues.py | Adds unified issue creation CLI (source selection, filtering, dry-run, tracking). |
| scripts/create-github-issues.py | Minor update: repo now derived from GITHUB_REPOSITORY env var. |
| scripts/README.md | Updates script docs and adds PowerShell wrapper documentation. |
| scripts/IMPLEMENTATION_SUMMARY.md | Adds a refactor summary and migration guidance for the scripts changes. |
| plans/scripts-refactoring-plan.md | Adds a detailed refactoring plan document for scripts directory cleanup. |
| frontend/package.json | Updates frontend dependencies/devDependencies versions and adds testing libs. |
| frontend/Dockerfile.dev | Adds dev Dockerfile for frontend (Vite HMR). |
| frontend/.dockerignore | Adds frontend dockerignore. |
| docs/validation/codeql-security-validation.md | Adds CodeQL validation writeup. |
| docs/TEST_FRAMEWORK.md | Clarifies backend venv naming convention (venv/, not .venv/). |
| docs/ISSUE_GENERATION_PROCESS.md | Updates issue-generation doc (notes issue count variability + PS wrapper). |
| docs/DOCKER_VALIDATION.md | Adds Docker validation checklist. |
| docs/DOCKER_GUIDE.md | Adds Docker development guide. |
| docs/CODE_REVIEW_TEST_RESULTS.md | Clarifies references to the 2026-02-02 review issue set. |
| docs/CI_CD.md | Updates CI/CD doc and notes venv standardization + ignore guidance. |
| docker-compose.yml | Adds backend/frontend services and removes obsolete compose version. |
| docker-compose.override.yml.example | Adds example override file for local customization. |
| backend/requirements.txt | Updates backend deps and migrates JWT lib dependency set. |
| backend/docker-entrypoint.sh | Adds backend entrypoint (wait for DB, run migrations, start uvicorn). |
| backend/core/security.py | Switches JWT handling from python-jose to PyJWT. |
| backend/Dockerfile.dev | Adds dev Dockerfile for backend. |
| backend/.dockerignore | Adds backend dockerignore. |
| _bmad-output/implementation-artifacts/code-review-issues-tracking.md | Adds generated tracking markdown. |
| _bmad-output/implementation-artifacts/ISSUE_FORMAT_SCHEMA.md | Adds a detailed schema/guardrails doc for issue JSON format. |
| VENV_SETUP.md | Adds explicit note to use venv/ naming convention. |
| README.md | Adds Docker “Quick Start” and expands Docker troubleshooting. |
| ISSUE_CREATION_INSTRUCTIONS.md | Updates issue creation instructions to reflect variable issue counts. |
| DOCKER_IMPLEMENTATION_SUMMARY.md | Adds Docker compose implementation summary. |
| DEPENDENCY_UPDATE_SUMMARY.md | Adds dependency update summary and verification notes. |
| CONTRIBUTING.md | Updates contributor setup steps (explicit venv/ usage). |
| CHANGELOG.md | Adds a changelog documenting dependency/security updates. |
| .gitignore | Updates ignore rules (adds docker override, Codacy; removes .venv/). |
| .github/workflows/codeql.yml | Enables security-extended query pack. |
| .github/instructions/codacy.instructions.md | Removes some provider/org/repo guidance text from instructions doc. |
| .gitattributes | Forces LF endings for .sh files. |
| .codacy/codacy.yaml | Updates Codacy runtime/tools configuration. |
| # Add parent directory to path to import lib | ||
| sys.path.insert(0, str(Path(__file__).parent.parent)) | ||
|
|
||
| from lib.config import Config | ||
| from lib.issue_validator import ( | ||
| validate_issue, | ||
| normalize_priority, | ||
| get_priority_labels, | ||
| validate_priority, | ||
| merge_labels, | ||
| PRIORITY_LABELS | ||
| ) | ||
| from lib.issue_tracker import IssueTracker | ||
|
|
There was a problem hiding this comment.
These tests import lib.*, but there is no scripts/lib/ package in the PR branch, so the test module will fail to import. Add/commit the scripts/lib modules (and __init__.py) or adjust the imports to the actual module path.
| ### Phase 1: Shared Library Modules ✅ | ||
|
|
||
| Created [`scripts/lib/`](lib/) directory with 4 core modules: | ||
|
|
||
| #### 1. [`lib/config.py`](lib/config.py) (~120 LOC) | ||
| - **Purpose**: Centralized configuration management | ||
| - **Features**: | ||
| - Automatic repository discovery (env var → git remote → fallback) | ||
| - Path management for all issue files |
There was a problem hiding this comment.
This summary claims a scripts/lib/ directory with 4 modules was created, but there is no scripts/lib/ directory in the PR branch. Either add/commit the missing library modules or update the summary to reflect the actual file structure so readers aren’t misled.
| | Script | Issues | Source | Tracking | Best For | | ||
| |--------|--------|--------|----------|----------| | ||
| | **create-p1-issues.py** | 5 | P1 JSON | p1-issues-created.json | **Creating P1 issues only** | | ||
| | **create-p1-issues.sh** | 5 | P1 JSON | None | **Bash users, P1 only** | | ||
| | **create-issues-from-log.py** | 20 | Consolidated log | Updates log file | **Most comprehensive, all issues** | | ||
| | create-github-issues.py | 15 | Code review JSONs | Separate tracking file | Code review issues only | | ||
| | create-code-review-issues.sh | 15 | Inline bash | Manual | Bash users, selective creation | | ||
| | run-issue-creation.sh | 15 | Via Python | Via Python script | Simple wrapper | | ||
| | **create-issues-from-log.py** | Varies | Consolidated log | Updates log file | **Most comprehensive, all issues** | |
There was a problem hiding this comment.
The comparison/recommended workflow documentation doesn’t mention create_issues.py (the new unified script), even though the wrappers now call it. Please add create_issues.py to this table (and update the recommended commands) so users don’t continue using the legacy scripts by default.
| # Add lib directory to path | ||
| sys.path.insert(0, str(Path(__file__).parent)) | ||
|
|
||
| from lib.config import Config | ||
| from lib.github_client import GitHubClient | ||
| from lib.issue_validator import validate_issue, normalize_priority, merge_labels | ||
| from lib.issue_tracker import IssueTracker |
There was a problem hiding this comment.
create_issues.py imports lib.* modules, but there is no scripts/lib/ package present in this PR branch (and no lib/ package elsewhere). As-is, running this script will fail immediately with ModuleNotFoundError. Add the missing scripts/lib modules (and an __init__.py) or update the imports/path handling to match the actual module location.
| print("Next steps:") | ||
| print(" 1. Review created issues at https://github.com/{config.repo}/issues") | ||
| print(" 2. Assign issues to team members") |
There was a problem hiding this comment.
This line prints a literal {config.repo} because the string is missing the f prefix. Use an f-string (or string formatting) so the repo is shown correctly in the output URL.
| # Run unified script with any additional arguments | ||
| $PYTHON_CMD "${SCRIPT_DIR}/create_issues.py" "$@" | ||
|
|
||
| EXIT_CODE=$? |
There was a problem hiding this comment.
With set -e enabled earlier, a non-zero exit from create_issues.py will cause the wrapper to exit immediately and skip the EXIT_CODE=$? capture and the final status message. If you want the wrapper to always print the success/failure footer, temporarily disable set -e around the Python call (or use an if ...; then ...; else ...; fi pattern).
create_issues.pyto consolidate multiple issue creation scripts into one.