From c789ed6003a4884cfb241fa1bca85fa0a155ed9f Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:16:57 +0100 Subject: [PATCH] chore: remove more logging --- app/Jobs/GithubAppPermissionJob.php | 12 ------------ bootstrap/helpers/github.php | 11 ----------- 2 files changed, 23 deletions(-) diff --git a/app/Jobs/GithubAppPermissionJob.php b/app/Jobs/GithubAppPermissionJob.php index d6da4439c..7cd1b86ac 100644 --- a/app/Jobs/GithubAppPermissionJob.php +++ b/app/Jobs/GithubAppPermissionJob.php @@ -10,7 +10,6 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; class GithubAppPermissionJob implements ShouldBeEncrypted, ShouldQueue { @@ -36,11 +35,6 @@ class GithubAppPermissionJob implements ShouldBeEncrypted, ShouldQueue ])->get("{$this->github_app->api_url}/app"); if (! $response->successful()) { - Log::error('GitHub API request failed', [ - 'status_code' => $response->status(), - 'error' => $response->body(), - 'app_id' => $this->github_app->app_id, - ]); throw new \RuntimeException('Failed to fetch GitHub app permissions: '.$response->body()); } @@ -56,12 +50,6 @@ class GithubAppPermissionJob implements ShouldBeEncrypted, ShouldQueue $this->github_app->makeVisible('client_secret')->makeVisible('webhook_secret'); } catch (\Throwable $e) { - Log::error('GithubAppPermissionJob failed', [ - 'app_id' => $this->github_app->app_id, - 'error' => $e->getMessage(), - 'trace' => $e->getTraceAsString(), - ]); - send_internal_notification('GithubAppPermissionJob failed with: '.$e->getMessage()); throw $e; } diff --git a/bootstrap/helpers/github.php b/bootstrap/helpers/github.php index 168308967..3a3f6e7b2 100644 --- a/bootstrap/helpers/github.php +++ b/bootstrap/helpers/github.php @@ -5,7 +5,6 @@ use App\Models\GitlabApp; use Carbon\Carbon; use Carbon\CarbonImmutable; use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; use Illuminate\Support\Str; use Lcobucci\JWT\Encoding\ChainedFormatter; use Lcobucci\JWT\Encoding\JoseEncoder; @@ -21,11 +20,6 @@ function generateGithubToken(GithubApp $source, string $type) $timeDiff = abs($serverTime->diffInSeconds($githubTime)); if ($timeDiff > 50) { - Log::error('System time out of sync with GitHub', [ - 'time_difference' => $timeDiff, - 'server_time' => $serverTime->format('Y-m-d H:i:s'), - 'github_time' => $githubTime->format('Y-m-d H:i:s'), - ]); throw new \Exception( 'System time is out of sync with GitHub API time:
'. '- System time: '.$serverTime->format('Y-m-d H:i:s').' UTC
'. @@ -58,11 +52,6 @@ function generateGithubToken(GithubApp $source, string $type) if (! $response->successful()) { $error = data_get($response->json(), 'message', 'no error message found'); - Log::error('Failed to get installation token', [ - 'status_code' => $response->status(), - 'error_message' => $error, - 'app_id' => $source->app_id, - ]); throw new RuntimeException("Failed to get installation token for {$source->name} with error: ".$error); }