Skip to content

Commit

Permalink
Merge branch 'main' into merge-stream_transform-package
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem authored Dec 17, 2024
2 parents 19a4b38 + 84f7a11 commit 80e4dfd
Show file tree
Hide file tree
Showing 177 changed files with 8,266 additions and 910 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/term_glyph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:term_glyph"
about: "Create a bug or file a feature request against package:term_glyph."
labels: "package:term_glyph"
---
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/test_reflective_loader.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:test_reflective_loader"
about: "Create a bug or file a feature request against package:test_reflective_loader."
labels: "package:test_reflective_loader"
---
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/timing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:timing"
about: "Create a bug or file a feature request against package:timing."
labels: "package:timing"
---
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/watcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:watcher"
about: "Create a bug or file a feature request against package:watcher."
labels: "package:watcher"
---
16 changes: 16 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/stream_transform/**'

'package:term_glyph':
- changed-files:
- any-glob-to-any-file: 'pkgs/term_glyph/**'

'package:test_reflective_loader':
- changed-files:
- any-glob-to-any-file: 'pkgs/test_reflective_loader/**'

'package:timing':
- changed-files:
- any-glob-to-any-file: 'pkgs/timing/**'

'package:unified_analytics':
- changed-files:
- any-glob-to-any-file: 'pkgs/unified_analytics/**'

'package:watcher':
- changed-files:
- any-glob-to-any-file: 'pkgs/watcher/**'
2 changes: 2 additions & 0 deletions .github/workflows/bazel_worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: "dart format --output=none --set-exit-if-changed ."
if: ${{ matrix.sdk == 'dev' }}
- name: Test
run: ./tool/travis.sh
72 changes: 72 additions & 0 deletions .github/workflows/term_glyph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: package:term_glyph

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/term_glyph.yaml'
- 'pkgs/term_glyph/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/term_glyph.yaml'
- 'pkgs/term_glyph/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github


defaults:
run:
working-directory: pkgs/term_glyph/

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.1, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
43 changes: 43 additions & 0 deletions .github/workflows/test_reflective_loader.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: package:test_reflective_loader

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/test_reflective_loader.yaml'
- 'pkgs/test_reflective_loader/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/test_reflective_loader.yaml'
- 'pkgs/test_reflective_loader/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

defaults:
run:
working-directory: pkgs/test_reflective_loader/

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev, 3.1]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}

- run: dart pub get
- name: dart format
run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infos
- run: dart test
67 changes: 67 additions & 0 deletions .github/workflows/timing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: package:timing

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/timing.yaml'
- 'pkgs/timing/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/timing.yaml'
- 'pkgs/timing/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github


defaults:
run:
working-directory: pkgs/timing/

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [3.4, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
run: dart pub get
- run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev, 2.2.0
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.4, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
run: dart pub get
- run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
71 changes: 71 additions & 0 deletions .github/workflows/watcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: package:watcher

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/watcher.yaml'
- 'pkgs/watcher/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/watcher.yaml'
- 'pkgs/watcher/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github


defaults:
run:
working-directory: pkgs/watcher/

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, macos-latest, windows-latest
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [3.1, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ don't naturally belong to other topic monorepos (like
| [source_span](pkgs/source_span/) | Provides a standard representation for source code locations and spans. | [![package issues](https://img.shields.io/badge/package:source_span-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Asource_span) | [![pub package](https://img.shields.io/pub/v/source_span.svg)](https://pub.dev/packages/source_span) |
| [sse](pkgs/sse/) | Provides client and server functionality for setting up bi-directional communication through Server Sent Events (SSE) and corresponding POST requests. | [![package issues](https://img.shields.io/badge/package:sse-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Asse) | [![pub package](https://img.shields.io/pub/v/sse.svg)](https://pub.dev/packages/sse) |
| [stream_transform](pkgs/stream_transform/) | A collection of utilities to transform and manipulate streams. | [![package issues](https://img.shields.io/badge/package:stream_transform-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Astream_transform) | [![pub package](https://img.shields.io/pub/v/stream_transform.svg)](https://pub.dev/packages/stream_transform) |
| [term_glyph](pkgs/term_glyph/) | Useful Unicode glyphs and ASCII substitutes. | [![package issues](https://img.shields.io/badge/package:term_glyph-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aterm_glyph) | [![pub package](https://img.shields.io/pub/v/term_glyph.svg)](https://pub.dev/packages/term_glyph) |
| [test_reflective_loader](pkgs/test_reflective_loader/) | Support for discovering tests and test suites using reflection. | [![package issues](https://img.shields.io/badge/package:test_reflective_loader-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atest_reflective_loader) | [![pub package](https://img.shields.io/pub/v/test_reflective_loader.svg)](https://pub.dev/packages/test_reflective_loader) |
| [timing](pkgs/timing/) | A simple package for tracking the performance of synchronous and asynchronous actions. | [![package issues](https://img.shields.io/badge/package:timing-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atiming) | [![pub package](https://img.shields.io/pub/v/timing.svg)](https://pub.dev/packages/timing) |
| [unified_analytics](pkgs/unified_analytics/) | A package for logging analytics for all Dart and Flutter related tooling to Google Analytics. | [![package issues](https://img.shields.io/badge/package:unified_analytics-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics) | [![pub package](https://img.shields.io/pub/v/unified_analytics.svg)](https://pub.dev/packages/unified_analytics) |
| [watcher](pkgs/watcher/) | Monitor directories and send notifications when the contents change. | [![package issues](https://img.shields.io/badge/package:watcher-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Awatcher) | [![pub package](https://img.shields.io/pub/v/watcher.svg)](https://pub.dev/packages/watcher) |

## Publishing automation

Expand Down
19 changes: 11 additions & 8 deletions pkgs/bazel_worker/benchmark/benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ Future<void> main() async {
var path = 'blaze-bin/some/path/to/a/file/that/is/an/input/$i';
workRequest
..arguments.add('--input=$path')
..inputs.add(Input(
path: '',
digest: List.filled(70, 0x11),
));
..inputs.add(Input(path: '', digest: List.filled(70, 0x11)));
}

// Serialize it.
Expand All @@ -24,14 +21,20 @@ Future<void> main() async {
print('Request has $length requestBytes.');

// Add the length in front base 128 encoded as in the worker protocol.
requestBytes =
Uint8List.fromList(requestBytes.toList()..insertAll(0, _varInt(length)));
requestBytes = Uint8List.fromList(
requestBytes.toList()..insertAll(0, _varInt(length)),
);

// Split into 10000 byte chunks.
var lists = <Uint8List>[];
for (var i = 0; i < requestBytes.length; i += 10000) {
lists.add(Uint8List.sublistView(
requestBytes, i, min(i + 10000, requestBytes.length)));
lists.add(
Uint8List.sublistView(
requestBytes,
i,
min(i + 10000, requestBytes.length),
),
);
}

// Time `AsyncMessageGrouper` and deserialization.
Expand Down
5 changes: 4 additions & 1 deletion pkgs/bazel_worker/e2e_test/bin/async_worker_in_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import 'package:e2e_test/forwards_to_isolate_async_worker.dart';
Future main(List<String> args, [SendPort? message]) async {
var receivePort = ReceivePort();
await Isolate.spawnUri(
Uri.file('async_worker.dart'), [], receivePort.sendPort);
Uri.file('async_worker.dart'),
[],
receivePort.sendPort,
);

var worker = await ForwardsToIsolateAsyncWorker.create(receivePort);
await worker.run();
Expand Down
5 changes: 1 addition & 4 deletions pkgs/bazel_worker/e2e_test/lib/async_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class ExampleAsyncWorker extends AsyncWorkerLoop {

@override
Future<WorkResponse> performRequest(WorkRequest request) async {
return WorkResponse(
exitCode: 0,
output: request.arguments.join('\n'),
);
return WorkResponse(exitCode: 0, output: request.arguments.join('\n'));
}
}
Loading

0 comments on commit 80e4dfd

Please sign in to comment.