Skip to content

Fix workflow duplication, resource leaks, and datetime timezone bugs#17

Merged
heidi-dang merged 4 commits intomainfrom
copilot/fix-workflow-and-debug
Jan 31, 2026
Merged

Fix workflow duplication, resource leaks, and datetime timezone bugs#17
heidi-dang merged 4 commits intomainfrom
copilot/fix-workflow-and-debug

Conversation

Copy link

Copilot AI commented Jan 31, 2026

CI workflows were running duplicate jobs on PRs. Codebase had resource leaks in SQLite connections and naive datetime usage causing timezone comparison failures.

Workflow

  • Remove pull_request trigger from ci.yml (now push-only; pr-check.yml handles PRs)
  • Add pip caching for consistency across workflows

Resource Management

Before:

conn = sqlite3.connect(db_file)
cursor = conn.cursor()
cursor.execute("SELECT COUNT(*) FROM features")
conn.close()  # Never called on exception
return count

After:

with sqlite3.connect(db_file) as conn:
    cursor = conn.cursor()
    cursor.execute("SELECT COUNT(*) FROM features")
    return count  # Connection auto-closed

Fixed 3 instances in progress.py.

Datetime Consistency

Issue: Mixed naive and UTC-aware datetimes cause TypeError on comparison.

Fixed: 6 instances across registry.py and parallel_orchestrator.py:

  • datetime.now()datetime.now(UTC)
  • session_start_time: datetime = Nonedatetime.now(UTC) (prevents AttributeError)

Error Visibility

Added logging to 12 silent exception handlers:

  • progress.py: Database ops, webhook failures
  • prompts.py: Template loading, file copy failures
  • server/routers/auth.py: Token revocation

Code Quality

  • Auto-fixed 30 linting issues (imports, type annotations, deprecated patterns)
  • Per-file ignores for print statements in CLI tools

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.jsdelivr.net
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

please fix workflow on my latest commit to main. also do debugging and refactor, find bug and fix but on my entire code


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 31, 2026 07:56
- Update CI workflow to only run on pushes to main
- Add pip caching to CI workflow Python job
- Fix all auto-fixable linting issues (imports, type annotations)
- Add logging to auth.py instead of print
- Configure per-file ignores for T201 (print) in CLI tools
- All linting checks now pass
- Security tests pass

Co-authored-by: heidi-dang <35790+heidi-dang@users.noreply.github.com>
- Fix database connection leaks in progress.py by using context managers
- Add logging to all exception handlers in progress.py
- Properly close SQLite connections even when exceptions occur
- Add detailed error logging for better debugging

Co-authored-by: heidi-dang <35790+heidi-dang@users.noreply.github.com>
@heidi-dang heidi-dang marked this pull request as ready for review January 31, 2026 08:00
- Fix naive datetime usage in registry.py (use UTC)
- Fix datetime initialization in parallel_orchestrator.py
- Add comprehensive error logging to prompts.py
- Prevent timezone-related bugs from mixing naive and aware datetimes

Co-authored-by: heidi-dang <35790+heidi-dang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow issues and refactor entire code Fix workflow duplication, resource leaks, and datetime timezone bugs Jan 31, 2026
Copilot AI requested a review from heidi-dang January 31, 2026 08:06
@heidi-dang heidi-dang merged commit b42aa13 into main Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants