Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/fullstack/backend/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version ^1.5.0 for the http package does not exist on pub.dev (the latest stable version is 1.3.0). Bumping to a non-existent version will cause dart pub get to fail.

  http: ^1.3.0

json_serializable: ^6.11.3
test: ^1.27.0
test_process: ^2.0.3
2 changes: 1 addition & 1 deletion examples/fullstack/frontend-cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ executables:
greet:

dependencies:
http: ^1.1.0
http: ^1.5.0
io: ^1.0.3
json_annotation: ^4.9.0

Expand Down
4 changes: 2 additions & 2 deletions examples/hello/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ environment:
sdk: ^3.9.0

dependencies:
functions_framework: ^0.4.0
functions_framework: ^0.5.0-wip
shelf: ^1.4.0

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
4 changes: 2 additions & 2 deletions examples/json/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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

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
4 changes: 2 additions & 2 deletions examples/protobuf_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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

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
4 changes: 2 additions & 2 deletions examples/raw_cloudevent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ environment:
sdk: ^3.9.0

dependencies:
functions_framework: ^0.4.0
functions_framework: ^0.5.0-wip
shelf: ^1.4.0

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
5 changes: 3 additions & 2 deletions functions_framework/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion functions_framework/lib/functions_framework.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions functions_framework/lib/src/request_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions functions_framework/lib/src/typedefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ typedef JsonWithContextHandler<RequestType, ResponseType> =

/// 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<Response> Function(Request request, RequestLogger logger);
FutureOr<Response> Function(Request request, CloudLogger logger);
10 changes: 5 additions & 5 deletions functions_framework/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,14 +9,14 @@ environment:
sdk: ^3.9.0

dependencies:
args: ^2.5.0
args: ^2.7.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version ^2.7.0 for the args package is not available on pub.dev (the latest stable version is 2.6.0).

  args: ^2.6.0

collection: ^1.19.0
google_cloud: ^0.3.0-0
http: ^1.1.0
google_cloud: ^0.4.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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version ^1.18.1 for the meta package is not available on pub.dev (the latest stable version is 1.16.0).

  meta: ^1.16.0

shelf: ^1.4.0
stack_trace: ^1.11.0

Expand Down
1 change: 1 addition & 0 deletions functions_framework_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions functions_framework_builder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ environment:
sdk: ^3.9.0

dependencies:
analyzer: '>=9.0.0 <11.0.0'
analyzer: '>=9.0.0 <13.0.0'
build: ^4.0.3
build_config: ^1.2.0
collection: ^1.19.0
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"
glob: ^2.1.2
meta: ^1.17.0
functions_framework: ">=0.5.0-0 <0.5.1"
glob: ^2.1.3
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version ^2.1.3 for the glob package does not exist on pub.dev (the latest stable version is 2.1.2).

  glob: ^2.1.2

meta: ^1.18.1
path: ^1.9.0
shelf: ^1.4.0
source_gen: ^4.1.1
Expand Down
2 changes: 1 addition & 1 deletion integration_test/lib/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Future<Response> function(Request request) async {
}

@CloudFunction()
Response loggingHandler(Request request, RequestLogger logger) {
Response loggingHandler(Request request, CloudLogger logger) {
logger
..log('default', LogSeverity.defaultSeverity)
..debug('debug')
Expand Down
4 changes: 2 additions & 2 deletions integration_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.0
http: ^1.5.0
http_parser: ^4.0.0
io: ^1.0.3
json_serializable: ^6.11.3
Expand Down
24 changes: 3 additions & 21 deletions integration_test/test/cloud_behavior_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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<Map<String, dynamic>>(),
),
);
} else {
matcher = allOf(
matcher,
isNot(contains('logging.googleapis.com/sourceLocation')),
);
}

return isA<String>().having(
(e) => jsonDecode(e) as Map,
'json',
Expand Down
Loading