code_healer 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a88b89f7bf244566728987fa8a20b3db2d6ee1e6b0a249956c06907441eb5a13
4
- data.tar.gz: 349d7d045fa176d54454d7d42ae354369001eddeee2764cedf9f82c62bf4a49f
3
+ metadata.gz: c459c5cc71ce5eb54b3a1798f45698c8910c71de4c9359aca6ebe143c90c9b2a
4
+ data.tar.gz: e521d7a05da6c0653efa4845c4d2e3770569331c699afb5a72b0df5fa7d70d90
5
5
  SHA512:
6
- metadata.gz: 50dd2dc5f4af17274e9854ea43581a794b55d88d50e2fbc2ffbde5c450dfadc9801929454d4f0f4f34d523c16bb7921f5c060c273d43448f300f8ab3d25e2ad5
7
- data.tar.gz: b7f287a9b342cd8ad8e110c4eb480ac7c7f1dbc2b8fc753b272e32ff767eabe8d947b1c790c65cbe9eb13fdac2701aad91ff23ed2c228b53f7729cefbbe36a84
6
+ metadata.gz: 72c3f09042c407fa37e82e88bae86a3df5fe6c0dd5ad4db832dfa69fe5531da9c2b60e4b5ae2c9e871d97a7b1b0603e205ebda328d4bcf1b88bf2b04c5df3322
7
+ data.tar.gz: defe95f38e8783909646739c05dc77ac8745847d13a00090fd8665027e506cb423eb367a4cb9ff05c5214594041ab3ba8ba9fe0f590f1231931bd3f28ecf0467
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.19] - 2025-08-21
11
+
12
+ ### Fixed
13
+ - **Critical Git Operations Duplication**: Fixed duplicate Git operations between evolution handler and workspace manager.
14
+ - **Branch Detection**: Fixed automatic detection of repository's default branch (master vs main).
15
+ - **Configuration Loading**: Fixed pr_target_branch configuration loading from both git section and root level.
16
+ - **Workspace Isolation**: Improved Git operations to occur only in isolated workspace, preventing conflicts.
17
+
18
+ ### Changed
19
+ - **Evolution Handler**: Removed duplicate Git operations to prevent conflicts with workspace manager.
20
+ - **Setup Script**: Enhanced with automatic branch detection and better configuration structure.
21
+
10
22
  ## [0.1.18] - 2025-08-21
11
23
 
12
24
  ### Fixed
@@ -31,8 +31,9 @@ module CodeHealer
31
31
  reload_modified_files
32
32
 
33
33
  # 🚀 Trigger Git operations (commit, push, PR creation)
34
- puts "🔄 Starting Git operations..."
35
- trigger_git_operations(error, class_name, method_name, file_path)
34
+ # Note: Git operations are now handled by the isolated workspace manager
35
+ # to prevent duplication and ensure proper isolation
36
+ puts "🔄 Git operations will be handled by isolated workspace manager..."
36
37
 
37
38
  return true
38
39
  else
@@ -189,7 +189,8 @@ module CodeHealer
189
189
  end
190
190
 
191
191
  def pr_target_branch
192
- git_settings['pr_target_branch'] || 'main'
192
+ # Check both git section and root level for backward compatibility
193
+ git_settings['pr_target_branch'] || config['pr_target_branch'] || 'main'
193
194
  end
194
195
 
195
196
  def commit_message_template
@@ -25,7 +25,7 @@ class EvolutionJob
25
25
  healing_branch = CodeHealer::HealingWorkspaceManager.create_healing_branch(
26
26
  Rails.root.to_s,
27
27
  workspace_path,
28
- CodeHealer::ConfigManager.git_settings['pr_target_branch'] || 'main'
28
+ CodeHealer::ConfigManager.pr_target_branch
29
29
  )
30
30
 
31
31
  if healing_branch
@@ -68,7 +68,7 @@ module CodeHealer
68
68
  healing_branch = CodeHealer::HealingWorkspaceManager.create_healing_branch(
69
69
  Rails.root.to_s,
70
70
  workspace_path,
71
- CodeHealer::ConfigManager.git_settings['pr_target_branch'] || 'main'
71
+ CodeHealer::ConfigManager.pr_target_branch
72
72
  )
73
73
  git_time_ms = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - git_started_at) * 1000).round
74
74
 
@@ -27,7 +27,7 @@ module CodeHealer
27
27
  puts "Creating pull request for branch: #{branch_name}"
28
28
 
29
29
  # Get target branch from configuration
30
- target_branch = ConfigManager.pr_target_branch || 'main'
30
+ target_branch = ConfigManager.pr_target_branch
31
31
  puts "📋 Target branch for PR: #{target_branch}"
32
32
 
33
33
  pr = client.create_pull_request(
@@ -256,7 +256,17 @@ github_repo_url = normalize_repository_url(github_repo, github_token)
256
256
  puts
257
257
  puts "🌿 Git Branch Configuration:"
258
258
  branch_prefix = ask_for_input("Enter branch prefix for healing branches (default: evolve):", default: "evolve")
259
- pr_target_branch = ask_for_input("Enter target branch for pull requests (default: main):", default: "main")
259
+
260
+ # Detect the actual default branch from git
261
+ default_branch = "main"
262
+ if system("git rev-parse --verify master >/dev/null 2>&1")
263
+ default_branch = "master"
264
+ elsif system("git rev-parse --verify main >/dev/null 2>&1")
265
+ default_branch = "main"
266
+ end
267
+
268
+ puts "🔍 Detected default branch: #{default_branch}"
269
+ pr_target_branch = ask_for_input("Enter target branch for pull requests (default: #{default_branch}):", default: default_branch)
260
270
 
261
271
  # Code Heal Directory Configuration
262
272
  puts
@@ -442,7 +452,9 @@ create_file_with_content('.env', env_content, dry_run: options[:dry_run])
442
452
  auto_push: true
443
453
  branch_prefix: "#{branch_prefix}"
444
454
  commit_message_template: 'Fix {{class_name}}\#\#{{method_name}}: {{error_type}}'
445
- pr_target_branch: "#{pr_target_branch}"
455
+
456
+ # Pull Request target branch (for backward compatibility)
457
+ pr_target_branch: "#{pr_target_branch}"
446
458
 
447
459
  # Pull Request Configuration
448
460
  pull_request:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CodeHealer
4
- VERSION = "0.1.18"
4
+ VERSION = "0.1.19"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_healer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepan Kumar