From f9ca87b9398b671ed0a1fadb2e7b2e32c9c24e7d Mon Sep 17 00:00:00 2001 From: kevmoo Date: Thu, 2 Apr 2026 12:07:01 -0700 Subject: [PATCH 1/5] bump min deps across the board --- examples/fullstack/backend/pubspec.yaml | 2 +- examples/fullstack/frontend-cli/pubspec.yaml | 2 +- examples/hello/pubspec.yaml | 2 +- examples/json/pubspec.yaml | 2 +- examples/protobuf_firestore/pubspec.yaml | 2 +- examples/raw_cloudevent/pubspec.yaml | 2 +- functions_framework/pubspec.yaml | 8 ++++---- functions_framework_builder/pubspec.yaml | 6 +++--- integration_test/pubspec.yaml | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/fullstack/backend/pubspec.yaml b/examples/fullstack/backend/pubspec.yaml index c597b53e..18a6f8b8 100644 --- a/examples/fullstack/backend/pubspec.yaml +++ b/examples/fullstack/backend/pubspec.yaml @@ -14,7 +14,7 @@ dev_dependencies: build_runner: ^2.10.4 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: ^0.4.7 - http: ^1.1.0 + http: ^1.5.0 json_serializable: ^6.11.3 test: ^1.27.0 test_process: ^2.0.3 diff --git a/examples/fullstack/frontend-cli/pubspec.yaml b/examples/fullstack/frontend-cli/pubspec.yaml index fc1ba08b..e35fef79 100644 --- a/examples/fullstack/frontend-cli/pubspec.yaml +++ b/examples/fullstack/frontend-cli/pubspec.yaml @@ -9,7 +9,7 @@ executables: greet: dependencies: - http: ^1.1.0 + http: ^1.5.0 io: ^1.0.3 json_annotation: ^4.9.0 diff --git a/examples/hello/pubspec.yaml b/examples/hello/pubspec.yaml index 8cadbc27..260b8772 100644 --- a/examples/hello/pubspec.yaml +++ b/examples/hello/pubspec.yaml @@ -16,6 +16,6 @@ dev_dependencies: build_runner: ^2.10.4 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: ^0.4.1 - http: ^1.1.0 + http: ^1.5.0 test: ^1.27.0 test_process: ^2.0.3 diff --git a/examples/json/pubspec.yaml b/examples/json/pubspec.yaml index 9a238f8d..a46644b1 100644 --- a/examples/json/pubspec.yaml +++ b/examples/json/pubspec.yaml @@ -14,7 +14,7 @@ dev_dependencies: build_runner: ^2.10.4 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: ^0.4.7 - http: ^1.1.0 + http: ^1.5.0 json_serializable: ^6.11.3 test: ^1.27.0 test_process: ^2.0.3 diff --git a/examples/protobuf_firestore/pubspec.yaml b/examples/protobuf_firestore/pubspec.yaml index 614c5542..9dc5546c 100644 --- a/examples/protobuf_firestore/pubspec.yaml +++ b/examples/protobuf_firestore/pubspec.yaml @@ -14,6 +14,6 @@ dev_dependencies: build_runner: ^2.10.4 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: ^0.4.10 - http: ^1.1.0 + http: ^1.5.0 test: ^1.27.0 test_process: ^2.0.3 diff --git a/examples/raw_cloudevent/pubspec.yaml b/examples/raw_cloudevent/pubspec.yaml index cdff97d4..40fb11de 100644 --- a/examples/raw_cloudevent/pubspec.yaml +++ b/examples/raw_cloudevent/pubspec.yaml @@ -13,6 +13,6 @@ dev_dependencies: build_runner: ^2.10.4 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: ^0.4.1 - http: ^1.1.0 + http: ^1.5.0 test: ^1.27.0 test_process: ^2.0.3 diff --git a/functions_framework/pubspec.yaml b/functions_framework/pubspec.yaml index ce7d54d0..54d62739 100644 --- a/functions_framework/pubspec.yaml +++ b/functions_framework/pubspec.yaml @@ -9,14 +9,14 @@ environment: sdk: ^3.9.0 dependencies: - args: ^2.5.0 + args: ^2.7.0 collection: ^1.19.0 - google_cloud: ^0.3.0-0 - http: ^1.1.0 + google_cloud: ^0.3.0 + http: ^1.5.0 http_parser: ^4.0.0 io: ^1.0.3 json_annotation: ^4.9.0 - meta: ^1.17.0 + meta: ^1.18.1 shelf: ^1.4.0 stack_trace: ^1.11.0 diff --git a/functions_framework_builder/pubspec.yaml b/functions_framework_builder/pubspec.yaml index bbcc5f7b..5ed4f086 100644 --- a/functions_framework_builder/pubspec.yaml +++ b/functions_framework_builder/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: ^3.9.0 dependencies: - analyzer: '>=9.0.0 <11.0.0' + analyzer: '>=9.0.0 <12.0.0' build: ^4.0.3 build_config: ^1.2.0 collection: ^1.19.0 @@ -16,8 +16,8 @@ dependencies: # There is a tight version constraint because the builder has a strict # dependency on all features exposed. functions_framework: ">=0.4.0 <0.4.5" - glob: ^2.1.2 - meta: ^1.17.0 + glob: ^2.1.3 + meta: ^1.18.1 path: ^1.9.0 shelf: ^1.4.0 source_gen: ^4.1.1 diff --git a/integration_test/pubspec.yaml b/integration_test/pubspec.yaml index eac04154..ed5d62b4 100644 --- a/integration_test/pubspec.yaml +++ b/integration_test/pubspec.yaml @@ -15,8 +15,8 @@ dev_dependencies: build_verify: ^3.0.0 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: any - google_cloud: any - http: ^1.1.0 + google_cloud: ^0.3.0 + http: ^1.5.0 http_parser: ^4.0.0 io: ^1.0.3 json_serializable: ^6.11.3 From b4a254bb013e443eaba22f11a5ef521d2d5b108c Mon Sep 17 00:00:00 2001 From: kevmoo Date: Thu, 2 Apr 2026 12:13:48 -0700 Subject: [PATCH 2/5] Much bigger change --- examples/fullstack/backend/pubspec.yaml | 2 +- examples/hello/pubspec.yaml | 2 +- examples/json/pubspec.yaml | 2 +- examples/protobuf_firestore/pubspec.yaml | 2 +- examples/raw_cloudevent/pubspec.yaml | 2 +- functions_framework/CHANGELOG.md | 5 +++-- functions_framework/lib/functions_framework.dart | 2 +- functions_framework/lib/src/request_context.dart | 4 ++-- functions_framework/lib/src/typedefs.dart | 4 ++-- functions_framework/pubspec.yaml | 4 ++-- functions_framework_builder/CHANGELOG.md | 1 + functions_framework_builder/pubspec.yaml | 2 +- integration_test/lib/functions.dart | 2 +- integration_test/pubspec.yaml | 2 +- 14 files changed, 19 insertions(+), 17 deletions(-) diff --git a/examples/fullstack/backend/pubspec.yaml b/examples/fullstack/backend/pubspec.yaml index 18a6f8b8..7f8c0daa 100644 --- a/examples/fullstack/backend/pubspec.yaml +++ b/examples/fullstack/backend/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/hello/pubspec.yaml b/examples/hello/pubspec.yaml index 260b8772..40ab4b19 100644 --- a/examples/hello/pubspec.yaml +++ b/examples/hello/pubspec.yaml @@ -9,7 +9,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip shelf: ^1.4.0 dev_dependencies: diff --git a/examples/json/pubspec.yaml b/examples/json/pubspec.yaml index a46644b1..91f53649 100644 --- a/examples/json/pubspec.yaml +++ b/examples/json/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/protobuf_firestore/pubspec.yaml b/examples/protobuf_firestore/pubspec.yaml index 9dc5546c..77e8626a 100644 --- a/examples/protobuf_firestore/pubspec.yaml +++ b/examples/protobuf_firestore/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.3 + functions_framework: ^0.5.0-wip protobuf: ^6.0.0 shelf: ^1.4.0 diff --git a/examples/raw_cloudevent/pubspec.yaml b/examples/raw_cloudevent/pubspec.yaml index 40fb11de..b03f1095 100644 --- a/examples/raw_cloudevent/pubspec.yaml +++ b/examples/raw_cloudevent/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip shelf: ^1.4.0 dev_dependencies: diff --git a/functions_framework/CHANGELOG.md b/functions_framework/CHANGELOG.md index 28f2be61..086869dd 100644 --- a/functions_framework/CHANGELOG.md +++ b/functions_framework/CHANGELOG.md @@ -1,6 +1,7 @@ -## 0.4.4-wip +## 0.5.0-wip -- Update to `package:google_cloud` `0.3.0-wip`. +- **BREAKING** `RequestLogger` -> `CloudLogger` +- Update to `package:google_cloud` `0.4.0`. - Fix project ID discovery to handle new exception types from `package:google_cloud`. - Require Dart 3.9 diff --git a/functions_framework/lib/functions_framework.dart b/functions_framework/lib/functions_framework.dart index 7e796368..355d92b7 100644 --- a/functions_framework/lib/functions_framework.dart +++ b/functions_framework/lib/functions_framework.dart @@ -25,7 +25,7 @@ library; export 'package:google_cloud/google_cloud.dart' - show BadRequestException, LogSeverity, RequestLogger; + show BadRequestException, CloudLogger, LogSeverity; export 'src/cloud_event.dart' show CloudEvent; export 'src/cloud_function.dart' show CloudFunction; diff --git a/functions_framework/lib/src/request_context.dart b/functions_framework/lib/src/request_context.dart index 62005025..891bd4e3 100644 --- a/functions_framework/lib/src/request_context.dart +++ b/functions_framework/lib/src/request_context.dart @@ -18,13 +18,13 @@ import 'package:shelf/shelf.dart'; import 'cloud_event.dart'; -/// Provides access to a [RequestLogger], the source [Request] and response +/// Provides access to a [CloudLogger], the source [Request] and response /// headers for a typed function handler. /// /// Can be used as an optional second parameter in a function definition that /// accepts a [CloudEvent] or a custom type. class RequestContext { - final RequestLogger logger; + final CloudLogger logger; /// Access to the source [Request] object. /// diff --git a/functions_framework/lib/src/typedefs.dart b/functions_framework/lib/src/typedefs.dart index e5d78e25..4d2f022d 100644 --- a/functions_framework/lib/src/typedefs.dart +++ b/functions_framework/lib/src/typedefs.dart @@ -54,6 +54,6 @@ typedef JsonWithContextHandler = /// The shape of a basic handler that follows the /// [package:shelf](https://pub.dev/packages/shelf) [Handler] pattern while also -/// providing a [RequestLogger]. +/// providing a [CloudLogger]. typedef HandlerWithLogger = - FutureOr Function(Request request, RequestLogger logger); + FutureOr Function(Request request, CloudLogger logger); diff --git a/functions_framework/pubspec.yaml b/functions_framework/pubspec.yaml index 54d62739..2cff58e5 100644 --- a/functions_framework/pubspec.yaml +++ b/functions_framework/pubspec.yaml @@ -1,5 +1,5 @@ name: functions_framework -version: 0.4.4-wip +version: 0.5.0-wip description: >- FaaS (Function as a service) framework for writing portable Dart functions repository: https://github.com/GoogleCloudPlatform/functions-framework-dart @@ -11,7 +11,7 @@ environment: dependencies: args: ^2.7.0 collection: ^1.19.0 - google_cloud: ^0.3.0 + google_cloud: ^0.4.0 http: ^1.5.0 http_parser: ^4.0.0 io: ^1.0.3 diff --git a/functions_framework_builder/CHANGELOG.md b/functions_framework_builder/CHANGELOG.md index f6bd1068..92464eb3 100644 --- a/functions_framework_builder/CHANGELOG.md +++ b/functions_framework_builder/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.4.11-wip - Support the latest versions of `analyzer`, `dart_style` and `source_gen`. +- Support `package:functions_framework` `0.5.0`. - Require Dart 3.9 ## 0.4.10 diff --git a/functions_framework_builder/pubspec.yaml b/functions_framework_builder/pubspec.yaml index 5ed4f086..f5fa6d96 100644 --- a/functions_framework_builder/pubspec.yaml +++ b/functions_framework_builder/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: dart_style: ^3.1.3 # There is a tight version constraint because the builder has a strict # dependency on all features exposed. - functions_framework: ">=0.4.0 <0.4.5" + functions_framework: ">=0.5.0-0 <0.5.1" glob: ^2.1.3 meta: ^1.18.1 path: ^1.9.0 diff --git a/integration_test/lib/functions.dart b/integration_test/lib/functions.dart index a3d245f8..9017fd1b 100644 --- a/integration_test/lib/functions.dart +++ b/integration_test/lib/functions.dart @@ -109,7 +109,7 @@ Future function(Request request) async { } @CloudFunction() -Response loggingHandler(Request request, RequestLogger logger) { +Response loggingHandler(Request request, CloudLogger logger) { logger ..log('default', LogSeverity.defaultSeverity) ..debug('debug') diff --git a/integration_test/pubspec.yaml b/integration_test/pubspec.yaml index ed5d62b4..b4af0680 100644 --- a/integration_test/pubspec.yaml +++ b/integration_test/pubspec.yaml @@ -15,7 +15,7 @@ dev_dependencies: build_verify: ^3.0.0 dart_flutter_team_lints: ^3.2.0 functions_framework_builder: any - google_cloud: ^0.3.0 + google_cloud: ^0.4.0 http: ^1.5.0 http_parser: ^4.0.0 io: ^1.0.3 From c89c87f6332b1c9b7f2ccae8bed6ab622ebfc6e1 Mon Sep 17 00:00:00 2001 From: kevmoo Date: Thu, 2 Apr 2026 15:24:20 -0700 Subject: [PATCH 3/5] oops --- examples/fullstack/backend/pubspec.yaml | 2 +- examples/hello/pubspec.yaml | 2 +- examples/json/pubspec.yaml | 2 +- examples/protobuf_firestore/pubspec.yaml | 2 +- examples/raw_cloudevent/pubspec.yaml | 2 +- functions_framework_builder/pubspec.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/fullstack/backend/pubspec.yaml b/examples/fullstack/backend/pubspec.yaml index 7f8c0daa..18a6f8b8 100644 --- a/examples/fullstack/backend/pubspec.yaml +++ b/examples/fullstack/backend/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.5.0-wip + functions_framework: ^0.4.0 json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/hello/pubspec.yaml b/examples/hello/pubspec.yaml index 40ab4b19..260b8772 100644 --- a/examples/hello/pubspec.yaml +++ b/examples/hello/pubspec.yaml @@ -9,7 +9,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.5.0-wip + functions_framework: ^0.4.0 shelf: ^1.4.0 dev_dependencies: diff --git a/examples/json/pubspec.yaml b/examples/json/pubspec.yaml index 91f53649..a46644b1 100644 --- a/examples/json/pubspec.yaml +++ b/examples/json/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.5.0-wip + functions_framework: ^0.4.0 json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/protobuf_firestore/pubspec.yaml b/examples/protobuf_firestore/pubspec.yaml index 77e8626a..8e3efb59 100644 --- a/examples/protobuf_firestore/pubspec.yaml +++ b/examples/protobuf_firestore/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.5.0-wip + functions_framework: ^0.4.0 protobuf: ^6.0.0 shelf: ^1.4.0 diff --git a/examples/raw_cloudevent/pubspec.yaml b/examples/raw_cloudevent/pubspec.yaml index b03f1095..40fb11de 100644 --- a/examples/raw_cloudevent/pubspec.yaml +++ b/examples/raw_cloudevent/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.5.0-wip + functions_framework: ^0.4.0 shelf: ^1.4.0 dev_dependencies: diff --git a/functions_framework_builder/pubspec.yaml b/functions_framework_builder/pubspec.yaml index f5fa6d96..625c16a3 100644 --- a/functions_framework_builder/pubspec.yaml +++ b/functions_framework_builder/pubspec.yaml @@ -8,7 +8,7 @@ environment: sdk: ^3.9.0 dependencies: - analyzer: '>=9.0.0 <12.0.0' + analyzer: '>=9.0.0 <13.0.0' build: ^4.0.3 build_config: ^1.2.0 collection: ^1.19.0 From fb24daeeb4bd4e4f2305af7bd87480efc7310c6d Mon Sep 17 00:00:00 2001 From: kevmoo Date: Thu, 2 Apr 2026 15:26:10 -0700 Subject: [PATCH 4/5] ugh --- examples/fullstack/backend/pubspec.yaml | 2 +- examples/hello/pubspec.yaml | 2 +- examples/json/pubspec.yaml | 2 +- examples/protobuf_firestore/pubspec.yaml | 2 +- examples/raw_cloudevent/pubspec.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/fullstack/backend/pubspec.yaml b/examples/fullstack/backend/pubspec.yaml index 18a6f8b8..7f8c0daa 100644 --- a/examples/fullstack/backend/pubspec.yaml +++ b/examples/fullstack/backend/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/hello/pubspec.yaml b/examples/hello/pubspec.yaml index 260b8772..40ab4b19 100644 --- a/examples/hello/pubspec.yaml +++ b/examples/hello/pubspec.yaml @@ -9,7 +9,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip shelf: ^1.4.0 dev_dependencies: diff --git a/examples/json/pubspec.yaml b/examples/json/pubspec.yaml index a46644b1..91f53649 100644 --- a/examples/json/pubspec.yaml +++ b/examples/json/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip json_annotation: ^4.9.0 shelf: ^1.4.0 diff --git a/examples/protobuf_firestore/pubspec.yaml b/examples/protobuf_firestore/pubspec.yaml index 8e3efb59..77e8626a 100644 --- a/examples/protobuf_firestore/pubspec.yaml +++ b/examples/protobuf_firestore/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip protobuf: ^6.0.0 shelf: ^1.4.0 diff --git a/examples/raw_cloudevent/pubspec.yaml b/examples/raw_cloudevent/pubspec.yaml index 40fb11de..b03f1095 100644 --- a/examples/raw_cloudevent/pubspec.yaml +++ b/examples/raw_cloudevent/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.9.0 dependencies: - functions_framework: ^0.4.0 + functions_framework: ^0.5.0-wip shelf: ^1.4.0 dev_dependencies: From cf4fb5c3d97b3d04a3779e6099ad8833041659e1 Mon Sep 17 00:00:00 2001 From: kevmoo Date: Thu, 2 Apr 2026 15:45:03 -0700 Subject: [PATCH 5/5] fix up the behavior tests! --- .../test/cloud_behavior_test.dart | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/integration_test/test/cloud_behavior_test.dart b/integration_test/test/cloud_behavior_test.dart index afbbb430..6a546480 100644 --- a/integration_test/test/cloud_behavior_test.dart +++ b/integration_test/test/cloud_behavior_test.dart @@ -73,7 +73,7 @@ void main() { port = int.parse(split.last); count++; - traceStart = 'trace_start$count'; + traceStart = count.toString().padLeft(32, '0'); headers = { cloud_constants.cloudTraceContextHeader: '$traceStart/trace_end', @@ -124,7 +124,6 @@ void main() { String severity = 'ERROR', bool containsLine = true, }) { - expect(map, hasLength(4)); expect(map, containsPair('severity', severity)); expect(map, containsPair('message', messageMatcher)); expect( @@ -354,30 +353,13 @@ void main() { final trace = 'projects/test_project_id/traces/$traceStart'; Matcher isLog(String message, String severity) { - final severityEnum = LogSeverity.values.firstWhere( - (e) => e.name == severity, - ); - var matcher = allOf( + final matcher = allOf( containsPair('message', message), containsPair('severity', severity), containsPair('logging.googleapis.com/trace', trace), + isNot(contains('logging.googleapis.com/sourceLocation')), ); - if (severityEnum >= LogSeverity.warning) { - matcher = allOf( - matcher, - containsPair( - 'logging.googleapis.com/sourceLocation', - isA>(), - ), - ); - } else { - matcher = allOf( - matcher, - isNot(contains('logging.googleapis.com/sourceLocation')), - ); - } - return isA().having( (e) => jsonDecode(e) as Map, 'json',