Skip to content

Implement unified GitHub issue creation script and refactor existing scripts - #82

Merged
tim-dickey merged 2 commits into
mainfrom
feature/unified-issue-creation
Feb 12, 2026
Merged

Implement unified GitHub issue creation script and refactor existing scripts#82
tim-dickey merged 2 commits into
mainfrom
feature/unified-issue-creation

Conversation

@tim-dickey

Copy link
Copy Markdown
Owner
  • Added create_issues.py to consolidate multiple issue creation scripts into one.
  • Created shared library modules for configuration, GitHub operations, issue validation, and tracking.
  • Enhanced PowerShell and Bash wrappers to call the new unified script.
  • Established comprehensive test coverage with 37 unit tests across the new library modules.
  • Eliminated 70-80% code duplication and reduced total lines of code significantly.
  • Updated documentation with implementation summary and migration guide for users.

Copilot AI review requested due to automatic review settings February 12, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +19 to +32
# 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

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +33
### 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

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread scripts/README.md
Comment on lines 123 to +127
| 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** |

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread scripts/create_issues.py
Comment on lines +29 to +35
# 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

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread scripts/create_issues.py
Comment on lines +426 to +428
print("Next steps:")
print(" 1. Review created issues at https://github.com/{config.repo}/issues")
print(" 2. Assign issues to team members")

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +63
# Run unified script with any additional arguments
$PYTHON_CMD "${SCRIPT_DIR}/create_issues.py" "$@"

EXIT_CODE=$?

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
@tim-dickey
tim-dickey merged commit 239c8e6 into main Feb 12, 2026
1 check passed
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.

2 participants