Skip to content

Commit

Permalink
Merge branch 'main' into tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnroyal committed Mar 27, 2024
2 parents 223ce70 + 94cd530 commit 3bb5ba2
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 22 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/check_issues_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,36 @@ name: Check issues access

on:
issues:
types: [ opened ]
types: [ opened, reopened, edited ]

jobs:
verify_access:
runs-on: ubuntu-latest
if: ${{ join(github.event.issue.labels) == '' || contains(github.event.issue.labels.*.name, 'infra')}}
steps:
- uses: actions-cool/check-user-permission@v2
id: checkIfUserHasWriteAccess
- uses: actions-cool/check-user-permission@v2.2.1
id: checkUser
with:
require: 'write'
- name: Close issues if no access
if: steps.checkIfUserHasWriteAccess.outputs.check-result == false
uses: actions-cool/[email protected]
with:
actions: 'close-issue'
issue-number: ${{ github.event.issue.number }}
- name: Write comment
if: steps.checkIfUserHasWriteAccess.outputs.check-result == false
uses: actions-cool/issues-helper@v2.1.2
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/issues-helper@v3.6.0
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }} Infra and blank issues are only available for moderators. You're apperantly using the wrong issue template.
@${{ github.event.issue.user.login }} Infra and blank issues are only available for moderators. You're apparently using the wrong issue template.
> Infra 和空白 issue 仅供管理人员使用,请选择其他 issue 模板创建 issue。
- name: Close issue
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/[email protected]
with:
actions: 'close-issue'
issue-number: ${{ github.event.issue.number }}
- name: Lock issue
if: steps.checkUser.outputs.require-result == 'false'
uses: actions-cool/[email protected]
with:
actions: 'lock-issue'
issue-number: ${{ github.event.issue.number }}
lock-reason: 'off-topic'
4 changes: 4 additions & 0 deletions dio/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ See the [Migration Guide][] for the complete breaking changes list.**

## Unreleased

*None.*

## 5.4.2

- Fix `receiveTimeout` throws exception after the request has been cancelled.
- Catch sync/async exceptions in interceptors' handlers.
- Throws precise `StateError` for handler's duplicated calls.
Expand Down
10 changes: 7 additions & 3 deletions dio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dio
version: 5.4.1
version: 5.4.2

description: |
A powerful HTTP networking package,
Expand Down Expand Up @@ -28,9 +28,13 @@ dependencies:
dev_dependencies:
lints: any
test: ^1.5.1
build_runner: any
coverage: ^1.0.3
crypto: ^3.0.2
mockito: ^5.2.0
build_runner: any

# Shared test package.
dio_test:
path: ../dio_test
git:
url: https://github.com/cfug/dio
path: dio_test
21 changes: 21 additions & 0 deletions dio_test/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 The CFUG Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions dio_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Dio shared test package

The package gathered shared tests between Dio's packages,
such as `dio` and `http2_adapter`.

The package was meant to not be published to pub.dev.
To use the package in tests, make the library depend like this:

```yaml
dev_dependencies:
# Shared test package.
dio_test:
git:
url: https://github.com/cfug/dio
path: dio_test
```
Then, use `dependency_overrides` or `pubspec_overrides.yaml`
to override the package to a local path or somewhere else.

## Copyright & License

The project is authored by
[Chinese Flutter User Group (@cfug)](https://github.com/cfug)
since 2024.

The project consents [the MIT license](LICENSE).
9 changes: 6 additions & 3 deletions dio_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: dio_test
version: 1.0.0

publish_to: none
homepage: https://github.com/cfug/dio
repository: https://github.com/cfug/dio/blob/main/dio_test
issue_tracker: https://github.com/cfug/dio/issues

environment:
sdk: '>=2.15.0 <4.0.0'

dependencies:
dio:
path: ../dio
dio: any

dev_dependencies:
test: ^1.5.1
4 changes: 4 additions & 0 deletions plugins/http2_adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

*None.*

## 2.5.1

- Wrap `SocketException` in `DioExceptionType.connectionError`
instead of `DioExceptionType.unknown`.

Expand Down
12 changes: 8 additions & 4 deletions plugins/http2_adapter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dio_http2_adapter
version: 2.5.0
version: 2.5.1

description: An adapter that combines HTTP/2 and dio. Supports reusing connections, header compression, etc.
topics:
Expand All @@ -15,14 +15,18 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
dio: ^5.2.0
http2: ^2.1.0
meta: ^1.9.1
dio: ^5.2.0

dev_dependencies:
crypto: ^3.0.2
lints: any
test: ^1.16.4
crypto: ^3.0.2
path: ^1.8.0

# Shared test package.
dio_test:
path: ../../dio_test
git:
url: https://github.com/cfug/dio
path: dio_test

0 comments on commit 3bb5ba2

Please sign in to comment.