liberu-genealogy / genealogy-laravel

Full genealogy application using Laravel 11, PHP 8.3, Filament 3.2 and Livewire 3.5
https://www.liberu.net
MIT License
123 stars 55 forks source link

Make sure dna matching in dna resources works as per laravel dna and php-dna call of matchkits.php function or laravel dna command not python anymore #496

Closed curtisdelicata closed 8 months ago

curtisdelicata commented 8 months ago
Checklist - [X] Create `app/Console/Commands/MatchKitsCommand.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/dbbcd51e443521c82bb3d324815a3feff9cf94ee [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/make_sure_dna_matching_in_dna_resources/app/Console/Commands/MatchKitsCommand.php) - [X] Running GitHub Actions for `app/Console/Commands/MatchKitsCommand.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/make_sure_dna_matching_in_dna_resources/app/Console/Commands/MatchKitsCommand.php) - [X] Modify `app/Jobs/DnaMatching.php` ✓ https://github.com/liberu-genealogy/genealogy-laravel/commit/cf7f975cec5a04b9ace0ed9d3fd17acd4967db54 [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/make_sure_dna_matching_in_dna_resources/app/Jobs/DnaMatching.php) - [X] Running GitHub Actions for `app/Jobs/DnaMatching.php` ✓ [Edit](https://github.com/liberu-genealogy/genealogy-laravel/edit/sweep/make_sure_dna_matching_in_dna_resources/app/Jobs/DnaMatching.php)
sweep-ai[bot] commented 8 months ago

🚀 Here's the PR! #511

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 8b9eda6c0a)

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/liberu-genealogy/genealogy-laravel/blob/23310598cb6ccaaf7b7f6c18a30e60edd6bd1ed7/app/Jobs/DnaMatching.php#L2-L120 https://github.com/liberu-genealogy/genealogy-laravel/blob/23310598cb6ccaaf7b7f6c18a30e60edd6bd1ed7/app/Filament/Resources/DnaMatchingResource.php#L2-L104 https://github.com/liberu-genealogy/genealogy-laravel/blob/23310598cb6ccaaf7b7f6c18a30e60edd6bd1ed7/app/Models/DnaMatching.php#L2-L16 https://github.com/liberu-genealogy/genealogy-laravel/blob/23310598cb6ccaaf7b7f6c18a30e60edd6bd1ed7/app/Policies/DnaMatchingPolicy.php#L2-L64

Step 2: ⌨️ Coding

Ran GitHub Actions for dbbcd51e443521c82bb3d324815a3feff9cf94ee:

--- 
+++ 
@@ -48,8 +48,13 @@
             //            system('/usr/bin/python3 /home/genealogia/public_html/dna.py ' . $this->var_name . ' ' . $dna->variable_name . ' ' . '/home/genealogia/public_html/storage/app/dna/'. $this->file_name . ' ' . '/home/genealogia/public_html/storage/app/dna/'. $dna->file_name);
             // chdir('/home/familytree365/domains/api.familytree365.com/genealogy/app');
             chdir($mpath);
-            // exec('python dna.py '.$this->var_name.' '.$dna->variable_name.' '.$this->file_name.' '.$dna->file_name, $dna_output);
-            $result = exec('python3 dna.py '.$this->var_name.' '.$dna->variable_name.' '.$this->file_name.' '.$dna->file_name);
+            $result = \Illuminate\Support\Facades\Artisan::call('dna:match', [
+                'varName1' => $this->var_name,
+                'fileName1' => $this->file_name,
+                'varName2' => $dna->variable_name,
+                'fileName2' => $dna->file_name
+            ]);
+            $resultData = json_decode($result, true, 512, JSON_THROW_ON_ERROR);
 //            $resultData = json_decode($result, true, 512, JSON_THROW_ON_ERROR);
             $resultData = json_decode($result, true, 512, JSON_THROW_ON_ERROR);
             // chmod(storage_path('/app/public/dna/output/shared_dna_'.$this->var_name.'_'.$dna->variable_name.'_'.$this->file_name.'_'.$dna->file_name), 0777);

Ran GitHub Actions for cf7f975cec5a04b9ace0ed9d3fd17acd4967db54:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/make_sure_dna_matching_in_dna_resources.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.

This is an automated message generated by Sweep AI.