Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0] - 2025-12-22

### Added

- **Test Suggestions**: Automatically detects code changes without corresponding tests and generates copyable test templates
- Supports Jest, Mocha, Vitest, pytest, and unittest frameworks
- Auto-detects testing framework from project configuration
- Suggests appropriate test file paths based on project structure

- **Coverage Reporting**: Reports test coverage percentage when a coverage tool is configured
- Supports Jest/NYC JSON, lcov, and Cobertura XML formats
- Only runs when coverage tool is detected in project (per user preference)
- Shows overall percentage, line coverage, and branch coverage

- **DevOps Cost Estimation**: Estimates AWS infrastructure costs for DevOps-related changes
- Detects Terraform, CloudFormation, CDK, Pulumi, Docker, and Kubernetes files
- Built-in pricing data for EC2, Lambda, S3, RDS, ECS, ALB, NAT Gateway, and more
- Shows confidence level for each estimate

- **Enhanced CLI Output**: New sections in `pr-agent analyze` output
- 🧪 Test Suggestions section with copyable test code
- 📊 Coverage Report section with percentage and file breakdown
- 💰 AWS Cost Estimates section with monthly cost impact

- **Smart Change Detection**: Agent automatically shows only relevant outputs
- Categorizes files as code, test, or DevOps
- Code without tests → Shows test suggestions
- Terraform/CloudFormation → Shows cost estimates
- Coverage tool configured → Shows coverage report

### New Files

- `src/tools/test-suggestion-tool.ts` - Test framework detection and test generation
- `src/tools/coverage-reporter.ts` - Coverage report parsing and formatting
- `src/tools/devops-cost-estimator.ts` - IaC file detection and AWS cost estimation

### Changed

- `src/types/agent.types.ts` - Added `CodeSuggestion`, `TestSuggestion`, `DevOpsCostEstimate`, and `CoverageReport` interfaces
- `src/tools/index.ts` - Exports for new tools
- `src/cli/commands/analyze.command.ts` - Display sections for new features

4 changes: 4 additions & 0 deletions dist/agents/base-pr-agent-workflow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export declare abstract class BasePRAgentWorkflow {
* Fast path execution - skip refinement loop but still use LLM for detailed analysis
*/
private executeFastPath;
/**
* Smart change detection - analyzes files and returns only relevant enhanced features
*/
private detectAndAnalyzeChangeTypes;
private analyzeFilesNode;
private detectRisksNode;
private calculateComplexityNode;
Expand Down
76 changes: 76 additions & 0 deletions dist/agents/base-pr-agent-workflow.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/agents/base-pr-agent-workflow.js.map

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions dist/cli/commands/analyze.command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cli/commands/analyze.command.js.map

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions dist/tools/coverage-reporter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Coverage Reporter Tool for PR Analysis
* Reads coverage reports and extracts metrics when coverage tool is configured
*/
import { DynamicStructuredTool } from '@langchain/core/tools';
import { z } from 'zod';
import { CoverageReport } from '../types/agent.types.js';
/**
* Detect if coverage tool is configured in the project
*/
export declare function detectCoverageTool(repoPath?: string): {
tool: string | null;
configured: boolean;
coveragePath?: string;
};
/**
* Find existing coverage report files
*/
export declare function findCoverageFiles(repoPath?: string): string[];
/**
* Read and parse coverage report
*/
export declare function readCoverageReport(repoPath?: string): CoverageReport;
/**
* Create coverage reporter tool
*/
export declare function createCoverageReporterTool(): DynamicStructuredTool<z.ZodObject<{
repoPath: z.ZodOptional<z.ZodString>;
forceRead: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, {
repoPath?: string;
forceRead?: boolean;
}, {
repoPath?: string | undefined;
forceRead?: boolean | undefined;
}, string>;
/**
* Format coverage report for display
*/
export declare function formatCoverageReport(report: CoverageReport): string;
Loading