From 0db0b5e4238fa7e232a13b43f4c2c0e4e255ed7f Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Fri, 15 Nov 2024 11:09:53 +0100 Subject: [PATCH 1/4] fix ci --- .../workflows/changes-in-high-risk-code.yml | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/changes-in-high-risk-code.yml b/.github/workflows/changes-in-high-risk-code.yml index 64decbe48f..3c1c75ff96 100644 --- a/.github/workflows/changes-in-high-risk-code.yml +++ b/.github/workflows/changes-in-high-risk-code.yml @@ -41,9 +41,25 @@ jobs: script: | const highRiskFiles = process.env.high_risk_code; const fileList = highRiskFiles.split(',').map(file => `- [ ] ${file}`).join('\n'); - github.rest.issues.createComment({ + + // Get existing comments + const comments = await github.rest.issues.listComments({ issue_number: context.issue.number, owner: context.repo.owner, - repo: context.repo.repo, - body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:\n ${fileList}` - }) + repo: context.repo.repo + }); + + // Check if we already have a high risk code comment + const hasExistingComment = comments.data.some(comment => + comment.body.includes('🚨 Detected changes in high risk code 🚨') + ); + + // Only create comment if we don't already have one + if (!hasExistingComment) { + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `### 🚨 Detected changes in high risk code 🚨 \n High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:\n ${fileList}` + }); + } From 6a513a5829ec492814436823c5dd9333e2b65309 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Fri, 15 Nov 2024 11:15:08 +0100 Subject: [PATCH 2/4] demo --- flutter/lib/src/integrations/native_app_start_integration.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/flutter/lib/src/integrations/native_app_start_integration.dart b/flutter/lib/src/integrations/native_app_start_integration.dart index 03cf15329f..b10b24e42c 100644 --- a/flutter/lib/src/integrations/native_app_start_integration.dart +++ b/flutter/lib/src/integrations/native_app_start_integration.dart @@ -6,6 +6,7 @@ import '../../sentry_flutter.dart'; import '../frame_callback_handler.dart'; import 'native_app_start_handler.dart'; +// todo: remove this after /// Integration which calls [NativeAppStartHandler] after /// [SchedulerBinding.instance.addPostFrameCallback] is called. class NativeAppStartIntegration extends Integration { From 907f68aeb482d5d8dbd8b37f56457a63d1644515 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Fri, 15 Nov 2024 11:39:21 +0100 Subject: [PATCH 3/4] update --- flutter/lib/src/integrations/native_app_start_integration.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/flutter/lib/src/integrations/native_app_start_integration.dart b/flutter/lib/src/integrations/native_app_start_integration.dart index b10b24e42c..a37b3aa3af 100644 --- a/flutter/lib/src/integrations/native_app_start_integration.dart +++ b/flutter/lib/src/integrations/native_app_start_integration.dart @@ -7,6 +7,7 @@ import '../frame_callback_handler.dart'; import 'native_app_start_handler.dart'; // todo: remove this after +// again /// Integration which calls [NativeAppStartHandler] after /// [SchedulerBinding.instance.addPostFrameCallback] is called. class NativeAppStartIntegration extends Integration { From c6f34b4bb46e260af36eb71bf7811413265b82cf Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Fri, 15 Nov 2024 12:31:00 +0100 Subject: [PATCH 4/4] Update native_app_start_integration.dart --- flutter/lib/src/integrations/native_app_start_integration.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/flutter/lib/src/integrations/native_app_start_integration.dart b/flutter/lib/src/integrations/native_app_start_integration.dart index a37b3aa3af..03cf15329f 100644 --- a/flutter/lib/src/integrations/native_app_start_integration.dart +++ b/flutter/lib/src/integrations/native_app_start_integration.dart @@ -6,8 +6,6 @@ import '../../sentry_flutter.dart'; import '../frame_callback_handler.dart'; import 'native_app_start_handler.dart'; -// todo: remove this after -// again /// Integration which calls [NativeAppStartHandler] after /// [SchedulerBinding.instance.addPostFrameCallback] is called. class NativeAppStartIntegration extends Integration {