Skip to content

Conversation

@ezeanyicollins
Copy link
Collaborator

@ezeanyicollins ezeanyicollins commented Oct 5, 2025

Purpose

Testing Phase 1 of Evaluation Framework - Telemetry in CI/CD environment

What This Tests

  • ✅ Telemetry infrastructure works in GitHub Actions
  • ✅ Agentic mode with self-correction in CI
  • ✅ Traces captured: SQLite + JSON files
  • ✅ Costs/latency tracked correctly
  • ✅ Validation results recorded

Changes

  1. New workflow: .github/workflows/patchpro-agent-dev-test.yml

    • Uses patchpro-bot@agent-dev (not main)
    • Runs analyze-pr command (replaces run_ci.py)
    • Enables agentic mode via .patchpro.toml
    • Uploads telemetry artifacts
  2. Test file: test_code_quality.py

    • Multiple imports on one line (ruff I001)
    • SQL injection vulnerabilities (semgrep)
    • Hardcoded secrets (ruff S105, S106)
    • Missing docstrings
    • Unsafe file operations (ruff PTH123)

Expected Behavior

  • PatchPro analyzes changed files
  • Generates patches with agentic self-correction
  • Telemetry captures all attempts (successes + retries)
  • Artifacts include traces.db and JSON trace files
  • PR comment shows results

Success Criteria

  • Workflow runs successfully
  • Traces captured in artifacts
  • traces.db contains patch attempt data
  • JSON files show LLM prompts/responses
  • Cost and latency metrics recorded
  • Agentic retry logic visible in traces

Related

  • Evaluation Framework: Agent-Dev branch
  • Roadmap: docs/PATH_TO_MVP.md (Week 1, Phase 1)
  • Test Plan: TELEMETRY_PR_TEST_PLAN.md

ezeanyicollins and others added 27 commits October 3, 2025 09:03
…hPro

- Enhanced workflow to use single-step run-ci command
- Added new functions with style and correctness issues
- Test integrated Denis analyzer + LLM pipeline
- Focus analysis on changed files only for efficiency
- Added patchpro-artifacts/ to .gitignore
- Removed tracked artifact files that should be generated at runtime
- Artifacts will be properly ignored going forward
- Added fallback strategies for git diff when no merge base exists
- Better handling of PR file detection across different branch histories
- Should now properly detect example.py changes for PatchPro analysis
- Set fetch-depth: 0 to get full git history in GitHub Actions
- Simplified changed files detection logic
- Should now properly detect example.py changes
- Added debug output to show number of changed files
- Added test comment to example.py
- Should now run complete E2E pipeline with LLM patch generation
- Test the full integrated Denis analyzer + LLM system
- Only add source code files (*.py, *.js, etc.) not artifacts
- Explicitly exclude artifact/ and changed_files_only/ directories
- This prevents pollution of git history with generated files
- Removed artifact/ and changed_files_only/ directories from git tracking
- Added changed_files_only/ to .gitignore
- These files should only exist during workflow execution, not in git history
- Prevents git repository pollution with generated files
- Should now run complete pipeline with LLM patch generation
- Workflow will not commit any artifacts to git
- Test the full integrated Denis analyzer + LLM + patch application
- Use --tools ruff --tools semgrep instead of --tools ruff semgrep
- Fix CLI argument parsing error that was causing workflow failure
- This should trigger a pull_request event (not workflow_dispatch)
- Should post complete comment with generated patches visible
- Test the full E2E with comment posting
- Added back unused imports (json, os)
- Reverted to == None instead of is None
- Reverted to bare except
- This commit will trigger post-commit analysis
- Multiple imports on one line (I001)
- SQL injection vulnerabilities (semgrep)
- Hardcoded secrets (S105, S106)
- Missing docstrings (D)
- Unsafe file operations (PTH123)
Add comment header to test file to trigger new workflow run.
This run should now:
- Load .patchpro.toml successfully
- Enable agentic mode from config
- Create telemetry traces
- Upload artifacts with traces.db

Testing Phase 1 - Config-driven agentic mode enablement
Add debug step to list .patchpro directory contents before upload.
This will help diagnose why telemetry traces are created but
artifacts upload reports 'No files were found'.

PatchTracer logs show it initialized 4 times and created traces at:
/home/runner/work/patchpro-demo-repo/patchpro-demo-repo/.patchpro/traces

But upload-artifact action can't find files. This debug step will
show exactly what exists in the directory before upload.
The workflow failed because github.base_ref is empty when triggered via
workflow_dispatch (manual trigger), causing git diff command to fail:

  git diff --name-only 'origin/...HEAD'  # ❌ Invalid

Add fallback to 'demo/patchpro-ci-test' for workflow_dispatch events:

  BASE_REF="${{ github.base_ref || 'demo/patchpro-ci-test' }}"

This ensures the workflow works for both:
- pull_request events: Uses actual PR base branch
- workflow_dispatch events: Uses hardcoded fallback branch

This was blocking telemetry testing because analyze-pr exited early
with no files to analyze, so AgenticPatchGeneratorV2 was never invoked.
@github-actions
Copy link

github-actions bot commented Oct 5, 2025

PatchPro Bot Enhanced Report

Generated on: /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/.patchpro
Processing completed in: 142.42 seconds

Summary

  • Total findings: 62
  • Tools used: ruff, semgrep
  • Affected files: 10
  • Patches generated: 1

Performance Metrics

Processing Statistics

  • Processing time: 142.42 seconds
  • Average time per finding: 2.30 seconds
  • Files processed: 10

Cache Performance

  • Cache utilization: 0.0%
  • Cache size: 0.0 MB / 200 MB
  • Cached entries: 0

Scalability Features Used

  • Parallel file processing: ✅ Enabled
  • Intelligent batching: ✅ Enabled
  • Context optimization: ✅ Enabled
  • Memory-efficient caching: ✅ Enabled
  • Progress tracking: ✅ Enabled

Findings Breakdown

By Severity

  • error: 49
  • info: 4
  • warning: 9

By Tool

  • ruff: 49
  • semgrep: 13

By Category

  • error: 23
  • style: 22
  • import: 4
  • security: 13

Generated Patches

  • patch_combined_20251005_194846.diff

Combined Patch

patch_combined_20251005_194846.diff

Affected Files

  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/demo_file.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/example.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/quick_test.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/test_code_quality.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/vulnerable_auth.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/vulnerable_payment_system.py
  • /home/runner/work/patchpro-demo-repo/patchpro-demo-repo/workflow_demo.py
  • test_code_quality.py
  • vulnerable_auth.py
  • vulnerable_payment_system.py

@ezeanyicollins ezeanyicollins requested review from waigisteve and removed request for waigisteve October 6, 2025 01:34
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.

1 participant