Skip to content

Bump SDK dependency to 3.3.0, replace removed dart:typed_data type in test code #953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 5, 2025
Merged
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
123 changes: 33 additions & 90 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can also move away from using this mono_repo generated workflow file - in favor of some simple hand-written ones - if that's preferable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's fine, I don't have any problems with it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

#957 moves to using simple, hand-written workflow files per-package instead of a generated mono_repo one.

name: Dart CI
on:
push:
Expand Down Expand Up @@ -35,27 +35,27 @@ jobs:
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.5.7
run: dart pub global activate mono_repo 6.6.2
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "format_analyze; linux; Dart 2.19.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
name: "format_analyze; linux; Dart 3.3.0; PKG: protobuf; `dart analyze lib`, `dart analyze test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf;commands:analyze_1-analyze_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf;commands:analyze_1-analyze_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -73,14 +73,14 @@ jobs:
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
job_003:
name: "format_analyze; linux; Dart dev; PKG: api_benchmark; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `./compile_protos.sh`, `dart analyze --fatal-infos`"
name: "format_analyze; linux; Dart dev; PKG: api_benchmark; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `./compile_protos.sh`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:api_benchmark;commands:format-command_0-command_1-analyze_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:api_benchmark;commands:format-command_0-command_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:api_benchmark
os:ubuntu-latest;pub-cache-hosted;sdk:dev
Expand Down Expand Up @@ -110,10 +110,6 @@ jobs:
run: ./compile_protos.sh
if: "always() && steps.api_benchmark_pub_upgrade.conclusion == 'success'"
working-directory: api_benchmark
- name: "api_benchmark; dart analyze --fatal-infos"
run: dart analyze --fatal-infos
if: "always() && steps.api_benchmark_pub_upgrade.conclusion == 'success'"
working-directory: api_benchmark
job_004:
name: "format_analyze; linux; Dart dev; PKG: benchmarks; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `./tool/compile_protos.sh`, `dart analyze --fatal-infos`"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -191,14 +187,14 @@ jobs:
if: "always() && steps.protobuf_pub_upgrade.conclusion == 'success'"
working-directory: protobuf
job_006:
name: "format_analyze; linux; Dart dev; PKG: protoc_plugin; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `make protos`, `dart analyze --fatal-infos bin lib test`"
name: "format_analyze; linux; Dart dev; PKG: protoc_plugin; `dart format --output=none --set-exit-if-changed .`, `./../tool/setup.sh`, `make protos`, `dart analyze --fatal-infos`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:format-command_0-command_3-analyze_3"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:format-command_0-command_3-analyze_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:dev
Expand Down Expand Up @@ -228,28 +224,28 @@ jobs:
run: make protos
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
- name: "protoc_plugin; dart analyze --fatal-infos bin lib test"
run: dart analyze --fatal-infos bin lib test
- name: "protoc_plugin; dart analyze --fatal-infos"
run: dart analyze --fatal-infos
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
job_007:
name: "run_tests; linux; Dart 2.19.0; PKG: protobuf; `dart test`"
name: "run_tests; linux; Dart 3.3.0; PKG: protobuf; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf;commands:test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand All @@ -270,23 +266,23 @@ jobs:
- job_005
- job_006
job_008:
name: "run_tests; linux; Dart 2.19.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
name: "run_tests; linux; Dart 3.3.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protoc_plugin;commands:command_0-command_3-test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protoc_plugin;commands:command_0-command_3-test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -322,7 +318,7 @@ jobs:
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protobuf
os:ubuntu-latest;pub-cache-hosted;sdk:dev
Expand Down Expand Up @@ -359,7 +355,7 @@ jobs:
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:command_0-command_3-test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin;commands:command_0-command_3-test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:dev
Expand Down Expand Up @@ -397,23 +393,23 @@ jobs:
- job_005
- job_006
job_011:
name: "run_tests; osx; Dart 2.19.0; PKG: protobuf; `dart test`"
name: "run_tests; osx; Dart 3.3.0; PKG: protobuf; `dart test`"
runs-on: macos-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:macos-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf;commands:test_0"
key: "os:macos-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf;commands:test"
restore-keys: |
os:macos-latest;pub-cache-hosted;sdk:2.19.0;packages:protobuf
os:macos-latest;pub-cache-hosted;sdk:2.19.0
os:macos-latest;pub-cache-hosted;sdk:3.3.0;packages:protobuf
os:macos-latest;pub-cache-hosted;sdk:3.3.0
os:macos-latest;pub-cache-hosted
os:macos-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -441,7 +437,7 @@ jobs:
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:macos-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test_0"
key: "os:macos-latest;pub-cache-hosted;sdk:dev;packages:protobuf;commands:test"
restore-keys: |
os:macos-latest;pub-cache-hosted;sdk:dev;packages:protobuf
os:macos-latest;pub-cache-hosted;sdk:dev
Expand Down Expand Up @@ -471,13 +467,13 @@ jobs:
- job_005
- job_006
job_013:
name: "run_tests; windows; Dart 2.19.0; PKG: protobuf; `dart test`"
name: "run_tests; windows; Dart 3.3.0; PKG: protobuf; `dart test`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
Expand Down Expand Up @@ -524,56 +520,3 @@ jobs:
- job_004
- job_005
- job_006
job_015:
name: "run_legacy_tests; linux; Dart 2.19.0; PKG: protoc_plugin; `./../tool/setup.sh`, `make protos`, `dart test legacy_tests/generated_message_test.dart`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protoc_plugin;commands:command_0-command_3-test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0;packages:protoc_plugin
os:ubuntu-latest;pub-cache-hosted;sdk:2.19.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: "2.19.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: protoc_plugin_pub_upgrade
name: protoc_plugin; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: protoc_plugin
- name: protoc_plugin; ./../tool/setup.sh
run: ./../tool/setup.sh
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
- name: protoc_plugin; make protos
run: make protos
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
- name: protoc_plugin; dart test legacy_tests/generated_message_test.dart
run: dart test legacy_tests/generated_message_test.dart
if: "always() && steps.protoc_plugin_pub_upgrade.conclusion == 'success'"
working-directory: protoc_plugin
needs:
- job_001
- job_002
- job_003
- job_004
- job_005
- job_006
- job_007
- job_008
- job_009
- job_010
- job_011
- job_012
- job_013
- job_014
1 change: 0 additions & 1 deletion api_benchmark/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ stages:
- format
- command: ./../tool/setup.sh
- command: ./compile_protos.sh
- analyze: --fatal-infos
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to removing this package

sdk: dev
3 changes: 3 additions & 0 deletions protobuf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@

([#49], [#918])

* Minimum SDK dependency bumped from 2.19.0 to 3.3.0. (#953)

[#738]: https://github.com/google/protobuf.dart/issues/738
[#896]: https://github.com/google/protobuf.dart/issues/896
[#902]: https://github.com/google/protobuf.dart/issues/902
[#49]: https://github.com/google/protobuf.dart/issues/49
[#918]: https://github.com/google/protobuf.dart/pulls/918
[#953]: https://github.com/google/protobuf.dart/pull/953

## 3.1.0

Expand Down
4 changes: 2 additions & 2 deletions protobuf/lib/src/protobuf/field_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class _FieldSet {
if (currentOneofTag != null) {
_clearField(currentOneofTag);
}
_oneofCases![oneofIndex] = tag;
_oneofCases[oneofIndex] = tag;
}

_values[fi.index!] = value;
Expand Down Expand Up @@ -485,7 +485,7 @@ class _FieldSet {
if (currentOneofTag != null) {
_clearField(currentOneofTag);
}
_oneofCases![oneofIndex] = tag;
_oneofCases[oneofIndex] = tag;
}
_values[index] = value;
}
Expand Down
4 changes: 2 additions & 2 deletions protobuf/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: protobuf
version: 4.0.0-dev
description: >-
Runtime library for protocol buffers support. Use with package:protoc_plugin
to generate dart code for your '.proto' files.
to generate Dart code for your '.proto' files.
repository: https://github.com/google/protobuf.dart/tree/master/protobuf

environment:
sdk: '>=2.19.0 <4.0.0'
sdk: '>=3.3.0 <4.0.0'

dependencies:
collection: ^1.15.0
Expand Down
6 changes: 1 addition & 5 deletions protobuf/test/coded_buffer_reader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ void main() {
});

test('unmodifiable-uint8-list-view', () {
// TODO: Use `Uint8List.asUnmodifiableView` instead of
// `UnmodifiableUint8ListView` when it's available in the oldest
// supported SDK version.
// ignore: deprecated_member_use
testWithList(UnmodifiableUint8ListView(Uint8List.fromList(inputBuffer)));
testWithList(Uint8List.fromList(inputBuffer).asUnmodifiableView());
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

});

test('uint8-list-view', () {
Expand Down
2 changes: 2 additions & 0 deletions protoc_plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* `deprecated` options in messages, grpc services and methods, and enum types
and values are now handled to generate Dart `@deprecated` annotations.
([#900], [#908])
* `protoc_plugin` and generated files now require Dart 3.3.0. (#953)

[#738]: https://github.com/google/protobuf.dart/issues/738
[#903]: https://github.com/google/protobuf.dart/pull/903
Expand All @@ -20,6 +21,7 @@
[#900]: https://github.com/google/protobuf.dart/issues/900
[#909]: https://github.com/google/protobuf.dart/pull/909
[#908]: https://github.com/google/protobuf.dart/pull/908
[#953]: https://github.com/google/protobuf.dart/pull/953

## 21.1.2

Expand Down
Loading