Skip to content

fix: batch fixes for issues #3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070 [skip ci]#408

Open
echobt wants to merge 1 commit intomasterfrom
fix/bounty-batch-3061-3070
Open

fix: batch fixes for issues #3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070 [skip ci]#408
echobt wants to merge 1 commit intomasterfrom
fix/bounty-batch-3061-3070

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 27, 2026

Summary

This PR implements batch fixes for 10 feature requests spanning error handling improvements, PR/MR workflow enhancements, GitLab support, and web scraping capabilities.

Changes

Issue #3061: Add Structured Error Codes for Programmatic Handling

  • Added ErrorCode enum with structured codes (E001-E999) organized by category
  • Implemented error_code() and format_with_code() methods for CortexError
  • Added comprehensive tests for error codes

Issue #3062: Add PR Review Command for Automated Reviews

  • Added cortex pr review <number> command with AI-powered code analysis
  • Support for focus areas (--focus security,performance,quality)
  • Support for output formats (--format markdown|json)
  • Option to post review as PR comment (--post)

Issue #3063: Add PR Create Command

  • Added cortex pr create command to create PRs from current branch
  • Auto-generate title/body from commits or provide manually
  • Support for draft mode, labels, and reviewers
  • Integration with gh CLI

Issue #3064: Store GitHub Token in Configuration

  • Extended config_set to support github.token and github.user keys
  • Token can be stored securely in config.toml [github] section

Issue #3065: Add GitLab Support Alongside GitHub

  • Created new gitlab_cmd.rs module with complete MR operations
  • Support for cortex gitlab mr checkout/review/create/list commands
  • Self-hosted GitLab support via --url flag
  • Token storage in config: gitlab.token, gitlab.url, gitlab.user

Issue #3066: Add Content Caching for Scrape Command

  • Added --cache flag to enable response caching
  • Configurable TTL with --cache-ttl (default: 3600s)
  • Cache stored in ~/.cache/cortex/scrape_cache/
  • Hash-based cache keys for URL identification

Issue #3067: Add Readability-Style Content Extraction

  • Added --readability flag for article content extraction
  • Targets semantic elements: article, main, [role=main]
  • Removes navigation, ads, sidebars, and boilerplate

Issue #3068: Add Headless Browser Option

  • Added --headless flag for JavaScript-rendered pages
  • Added --wait-time option for JS rendering delay
  • Prints helpful message about browser automation setup

Issue #3069: Add Sitemap-Based Bulk Scraping

  • Added --sitemap flag to parse sitemap.xml and scrape URLs
  • Configurable limit with --sitemap-limit (default: 100)
  • Configurable delay between requests with --sitemap-delay

Issue #3070: Add Input/Output Encoding Options

  • Added --input-encoding for source page encoding
  • Added --output-encoding for result encoding (default: utf-8)

Files Changed

  • cortex-engine/src/error.rs - Structured error codes
  • cortex-cli/src/pr_cmd.rs - PR review and create commands
  • cortex-cli/src/gitlab_cmd.rs - New GitLab integration module
  • cortex-cli/src/scrape_cmd.rs - Caching, readability, headless, sitemap, encoding
  • cortex-cli/src/main.rs - GitLab command registration, config key support
  • cortex-cli/src/lib.rs - Module declaration

Closes #3061, #3062, #3063, #3064, #3065, #3066, #3067, #3068, #3069, #3070

…, 3068, 3069, 3070 [skip ci]

Issue #3061: Add Structured Error Codes for Programmatic Handling
- Added ErrorCode enum with structured codes (E001-E999) organized by category
- Implemented error_code() and format_with_code() methods for CortexError
- Added comprehensive tests for error codes

Issue #3062: Add PR Review Command for Automated Reviews
- Added 'cortex pr review <number>' command with AI-powered code analysis
- Support for focus areas (--focus security,performance,quality)
- Support for output formats (--format markdown|json)
- Option to post review as PR comment (--post)

Issue #3063: Add PR Create Command
- Added 'cortex pr create' command to create PRs from current branch
- Auto-generate title/body from commits or provide manually
- Support for draft mode, labels, and reviewers
- Integration with gh CLI

Issue #3064: Store GitHub Token in Configuration
- Extended config_set to support github.token and github.user keys
- Token can be stored securely in config.toml [github] section

Issue #3065: Add GitLab Support Alongside GitHub
- Created new gitlab_cmd.rs module with complete MR operations
- Support for 'cortex gitlab mr checkout/review/create/list' commands
- Self-hosted GitLab support via --url flag
- Token storage in config: gitlab.token, gitlab.url, gitlab.user

Issue #3066: Add Content Caching for Scrape Command
- Added --cache flag to enable response caching
- Configurable TTL with --cache-ttl (default: 3600s)
- Cache stored in ~/.cache/cortex/scrape_cache/
- Hash-based cache keys for URL identification

Issue #3067: Add Readability-Style Content Extraction
- Added --readability flag for article content extraction
- Targets semantic elements: article, main, [role=main]
- Removes navigation, ads, sidebars, and boilerplate

Issue #3068: Add Headless Browser Option
- Added --headless flag for JavaScript-rendered pages
- Added --wait-time option for JS rendering delay
- Prints helpful message about browser automation setup

Issue #3069: Add Sitemap-Based Bulk Scraping
- Added --sitemap flag to parse sitemap.xml and scrape URLs
- Configurable limit with --sitemap-limit (default: 100)
- Configurable delay between requests with --sitemap-delay

Issue #3070: Add Input/Output Encoding Options
- Added --input-encoding for source page encoding
- Added --output-encoding for result encoding (default: utf-8)
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