From 0e882797fc3bd3edb4a2385844325a1cc7def9da Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Sat, 7 Dec 2024 18:44:04 -0600 Subject: [PATCH 1/3] Drop notify on failure --- .github/workflows/lint.yml | 18 ------------------ .github/workflows/unit.yml | 19 ------------------- mono_repo.yaml | 13 ------------- 3 files changed, 50 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f558965..04c2ae4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -473,21 +473,3 @@ jobs: run: flutter analyze if: "always() && steps.examples_fullstack_frontend_pub_upgrade.conclusion == 'success'" working-directory: examples/fullstack/frontend - job_007: - name: Notify failure - runs-on: ubuntu-latest - if: "(github.event_name == 'push' || github.event_name == 'schedule') && failure()" - steps: - - run: | - curl -H "Content-Type: application/json" -X POST -d \ - "{'text':'Build failed! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'}" \ - "${CHAT_WEBHOOK_URL}" - env: - CHAT_WEBHOOK_URL: "${{ secrets.CHAT_WEBHOOK_URL }}" - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - - job_006 diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index d46eb578..60587790 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -359,22 +359,3 @@ jobs: run: dart test if: "always() && steps.google_cloud_pub_upgrade.conclusion == 'success'" working-directory: google_cloud - job_008: - name: Notify failure - runs-on: ubuntu-latest - if: "(github.event_name == 'push' || github.event_name == 'schedule') && failure()" - steps: - - run: | - curl -H "Content-Type: application/json" -X POST -d \ - "{'text':'Build failed! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'}" \ - "${CHAT_WEBHOOK_URL}" - env: - CHAT_WEBHOOK_URL: "${{ secrets.CHAT_WEBHOOK_URL }}" - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - - job_006 - - job_007 diff --git a/mono_repo.yaml b/mono_repo.yaml index 491eb52a..090a1aa0 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -25,16 +25,3 @@ github: name: Dart Unit CI stages: - unit_test - - on_completion: - - name: "Notify failure" - runs-on: ubuntu-latest - # Run only if other jobs have failed and this is a push or scheduled build. - if: (github.event_name == 'push' || github.event_name == 'schedule') && failure() - steps: - - run: > - curl -H "Content-Type: application/json" -X POST -d \ - "{'text':'Build failed! ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}'}" \ - "${CHAT_WEBHOOK_URL}" - env: - CHAT_WEBHOOK_URL: ${{ secrets.CHAT_WEBHOOK_URL }} From a9eefe70f55ecce7f3753728361ad000612cd9fd Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Sun, 8 Dec 2024 11:16:53 -0600 Subject: [PATCH 2/3] bump generated output --- .../lib/src/cloud_event.g.dart | 34 +++++++------------ functions_framework/pubspec.yaml | 2 +- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/functions_framework/lib/src/cloud_event.g.dart b/functions_framework/lib/src/cloud_event.g.dart index 856ad049..5a531802 100644 --- a/functions_framework/lib/src/cloud_event.g.dart +++ b/functions_framework/lib/src/cloud_event.g.dart @@ -39,24 +39,16 @@ CloudEvent _$CloudEventFromJson(Map json) => $checkedCreate( }, ); -Map _$CloudEventToJson(CloudEvent instance) { - final val = { - 'id': instance.id, - 'source': instance.source.toString(), - 'specversion': instance.specVersion, - 'type': instance.type, - }; - - void writeNotNull(String key, dynamic value) { - if (value != null) { - val[key] = value; - } - } - - writeNotNull('datacontenttype', instance.dataContentType); - writeNotNull('data', instance.data); - writeNotNull('dataschema', instance.dataSchema?.toString()); - writeNotNull('subject', instance.subject); - writeNotNull('time', instance.time?.toIso8601String()); - return val; -} +Map _$CloudEventToJson(CloudEvent instance) => + { + 'id': instance.id, + 'source': instance.source.toString(), + 'specversion': instance.specVersion, + 'type': instance.type, + if (instance.dataContentType case final value?) 'datacontenttype': value, + if (instance.data case final value?) 'data': value, + if (instance.dataSchema?.toString() case final value?) + 'dataschema': value, + if (instance.subject case final value?) 'subject': value, + if (instance.time?.toIso8601String() case final value?) 'time': value, + }; diff --git a/functions_framework/pubspec.yaml b/functions_framework/pubspec.yaml index be67f796..9fb6a97a 100644 --- a/functions_framework/pubspec.yaml +++ b/functions_framework/pubspec.yaml @@ -24,5 +24,5 @@ dev_dependencies: build_runner: ^2.2.1 build_verify: ^3.0.0 dart_flutter_team_lints: ^3.0.0 - json_serializable: ^6.6.0 + json_serializable: ^6.9.0 test: ^1.21.6 From 766c24912ffa658fc13f732655d7492e05302f10 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Sun, 8 Dec 2024 11:32:01 -0600 Subject: [PATCH 3/3] fix tests --- integration_test/test/cli_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/test/cli_test.dart b/integration_test/test/cli_test.dart index b1c2cd38..6a82a8f4 100644 --- a/integration_test/test/cli_test.dart +++ b/integration_test/test/cli_test.dart @@ -157,7 +157,7 @@ void main() { await expectLater( proc.stderr, emitsInOrder([ - 'Could not find an option named "bob".', + 'Could not find an option named "--bob".', ...LineSplitter.split(_usage), ]), ); @@ -193,7 +193,7 @@ void main() { await expectLater( proc.stderr, emitsInOrder([ - '"foo" is not an allowed value for option "signature-type".', + '"foo" is not an allowed value for option "--signature-type".', ...LineSplitter.split(_usage), ]), );