Skip to content

feat(tools): Add smart change detection, DevOps cost estimator, and test suggestions#15

Merged
aleksandardodevski111 merged 4 commits into
mainfrom
feat/smart-change-detection-devops-costs
Jan 9, 2026
Merged

feat(tools): Add smart change detection, DevOps cost estimator, and test suggestions#15
aleksandardodevski111 merged 4 commits into
mainfrom
feat/smart-change-detection-devops-costs

Conversation

@aleksandardodevski111
Copy link
Copy Markdown
Collaborator

Summary

Integrates enhanced PR analysis features v0.2.0 with smart change detection that conditionally shows relevant outputs based on file types.

New Features

💰 DevOps Cost Estimator

  • Estimates AWS infrastructure costs from IaC files (Terraform, CloudFormation, CDK, Pulumi, K8s, Docker)
  • Uses static pricing tables - no AWS connection required
  • Provides confidence levels (high/medium/low) for estimates
  • Supports: EC2, Lambda, S3, RDS, ECS, ALB, NAT Gateway, ElastiCache, CloudFront, API Gateway, SQS, SNS, DynamoDB

🧪 Test Suggestion Tool

  • Auto-detects test framework (Jest, Vitest, Mocha, Pytest)
  • Generates framework-specific test templates
  • Only suggests for files with significant changes (>5 additions)
  • Suggests test file paths based on project conventions

📊 Coverage Reporter

  • Reads test coverage from multiple formats (Jest, NYC, LCOV, Cobertura)
  • Only runs when coverage tool is configured in project
  • Shows overall percentage, line/branch coverage, file breakdown

🎯 Smart Change Detection

  • Categorizes files automatically (code, test, DevOps/IaC)
  • Only shows relevant outputs - code changes get test suggestions, IaC changes get cost estimates
  • Logs detection for transparency

🗄️ Database Integration

  • Extended SQLite schema with DevOps cost tracking fields
  • Added test suggestions and coverage tracking columns
  • New getDevOpsCostStats() function for dashboard analytics

📈 Dashboard Updates

  • New DevOps Cost/mo card
  • IaC Changes count
  • Test Suggestions count
  • Average Coverage percentage
  • DevOps Resource Types chart (replaces AI cost chart)

Files Changed

File Change
src/tools/devops-cost-estimator.ts ✨ New
src/tools/coverage-reporter.ts ✨ New
src/tools/test-suggestion-tool.ts ✨ New
src/tools/index.ts Updated exports
src/agents/base-pr-agent-workflow.ts Smart detection logic
src/cli/commands/analyze.command.ts Display new features
src/db/index.ts Schema + stats functions
src/types/agent.types.ts New type definitions
src/public/index.html Dashboard cards
src/public/dashboard.js Chart rendering

How It Works

When you run pr-agent analyze:

  1. Smart Detection categorizes changed files
  2. If code files changed without tests → shows Test Suggestions
  3. If IaC files changed → shows DevOps Cost Estimates
  4. If coverage configured → shows Coverage Report
  5. All data saved to SQLite for Dashboard analytics

Testing

npm run build
pr-agent analyze --verbose
pr-agent dashboard

Aleksandar Dodevski added 4 commits January 9, 2026 13:25
…est suggestions

Integrates enhanced PR analysis features v0.2.0 with smart change detection that conditionally shows relevant outputs based on file types.

- Estimates AWS infrastructure costs from IaC files (Terraform, CloudFormation, CDK, Pulumi, K8s, Docker)
- Uses static pricing tables - no AWS connection required
- Provides confidence levels (high/medium/low) for estimates

- Auto-detects test framework (Jest, Vitest, Mocha, Pytest)
- Generates framework-specific test templates
- Only suggests for files with significant changes (>5 additions)

- Reads test coverage from multiple formats (Jest, NYC, LCOV, Cobertura)
- Only runs when coverage tool is configured in project
- Shows overall percentage, line/branch coverage

- Categorizes files automatically (code, test, DevOps/IaC)
- Only shows relevant outputs - no noise
- Logs detection for transparency

- Extended SQLite schema with DevOps cost tracking fields
- Added test suggestions and coverage tracking
- New getDevOpsCostStats() function for dashboard

- New DevOps Cost/mo card
- IaC Changes count
- Test Suggestions count
- Average Coverage percentage
- DevOps Resource Types chart

- src/tools/devops-cost-estimator.ts (new)
- src/tools/coverage-reporter.ts (new)
- src/tools/test-suggestion-tool.ts (new)
- src/tools/index.ts (updated exports)
- src/agents/base-pr-agent-workflow.ts (smart detection)
- src/cli/commands/analyze.command.ts (display)
- src/db/index.ts (schema + stats)
- src/types/agent.types.ts (new types)
- src/public/index.html (dashboard cards)
- src/public/dashboard.js (rendering)
…ntry point

- Fixed dashboard.js to use devops_cost_monthly instead of removed cost_usd
- Fixed dashboard.js to use devops_resources instead of total_tokens
- Updated table header from 'Cost' to 'DevOps Cost'
- Fixed action.yml to point to dist/index.js (bundled) instead of dist/action.js
- Created project-classifier tool to distinguish between business logic and QA projects
- Classification based on file patterns and code content analysis
- Provides type-specific recommendations tailored to project focus
- Integrated into PR analysis workflow with automatic detection
- Added display in CLI output after summary
- Helps teams separate concerns between business logic and QA projects
Bug 1: Added DevOps cost trend chart initialization in dashboard.js
- The HTML canvas element chart-cost-trend was present but never rendered
- Now properly displays daily cost trends when data is available
- Shows placeholder message when no cost trend data exists

Bug 2: Convert currentRisks to fixes format in agent workflow
- Both execute() and executeFastPath() were returning empty fixes array
- Now properly converts risks to fixes format for CLI display
- Maintains backward compatibility with Fix interface
- Enables proper display of critical issues and quick actions in CLI
@aleksandardodevski111 aleksandardodevski111 force-pushed the feat/smart-change-detection-devops-costs branch from 0d938ee to d5f8142 Compare January 9, 2026 12:37
@aleksandardodevski111 aleksandardodevski111 merged commit edb3e87 into main Jan 9, 2026
1 check failed
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