• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / Iznik / 11495

09 May 2026 07:35AM UTC coverage: 69.06% (-3.8%) from 72.847%
11495

Pull #408

circleci

edwh
docs(migration): mark restartproject and repaircafewales as migrated (PR #408)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request #408: feat(batch): migrate check_cgas, visualise, tn_sync + dry-run improvements

9127 of 10554 branches covered (86.48%)

Branch coverage included in aggregate %.

507 of 663 new or added lines in 16 files covered. (76.47%)

11902 existing lines in 138 files now uncovered.

101630 of 149824 relevant lines covered (67.83%)

19.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/iznik-batch/app/Console/Commands/Integrations/SyncTrashNothingCommand.php
1
<?php
2

3
namespace App\Console\Commands\Integrations;
4

5
use App\Console\Concerns\PreventsOverlapping;
6
use App\Services\TnSyncService;
7
use Illuminate\Console\Command;
8
use Illuminate\Support\Facades\Log;
9

10
class SyncTrashNothingCommand extends Command
11
{
12
    use PreventsOverlapping;
13

14
    protected $signature = 'integrations:sync-trashnothing
15
                            {--dry-run : Log what would change without writing to the database}';
16

17
    protected $description = 'Sync ratings and user changes from the TrashNothing API';
18

19
    public function handle(TnSyncService $service): int
7✔
20
    {
21
        if (!$this->acquireLock()) {
7✔
NEW
22
            $this->info('Already running, exiting.');
×
NEW
23
            return Command::SUCCESS;
×
24
        }
25

26
        try {
27
            $dryRun = (bool) $this->option('dry-run');
7✔
28

29
            if ($dryRun) {
7✔
30
                $this->info('DRY RUN — no database writes will be made.');
2✔
31
            }
32

33
            Log::info('TN sync command starting', ['dry_run' => $dryRun]);
7✔
34

35
            $result = $service->sync($dryRun);
7✔
36

37
            $prefix = $dryRun ? '[DRY RUN] Would process' : 'Processed';
7✔
38
            $this->info("{$prefix} {$result['ratings']} rating(s), {$result['user_changes']} user change(s).");
7✔
39

40
            Log::info('TN sync command complete', $result + ['dry_run' => $dryRun]);
7✔
41

42
            return Command::SUCCESS;
7✔
43
        } finally {
44
            $this->releaseLock();
7✔
45
        }
46
    }
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc