-
Notifications
You must be signed in to change notification settings - Fork 7
Ecosystem testing #320
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
Ecosystem testing #320
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
e12da94
Set up example workflow
mosuem 958da0d
on push
mosuem b3cddaa
on pr
mosuem a4d5a1a
Merge pull request #3 from mosuem/ecosystem_testing
mosuem 7001128
Fixes
mosuem 69b9fd7
Changes
mosuem 4f1cfce
fix
mosuem 746a771
add default
mosuem 84f165c
echos
mosuem 6c2d27a
fixes
mosuem fdbdc74
shoudl work
mosuem 1a5d865
fix path writing
mosuem b8a636f
mroe echos
mosuem 7286544
fix file
mosuem a26d9f5
add arg
mosuem 8587db3
add debug
mosuem 588a511
fix input
mosuem d9b7ef4
Write comment
mosuem e6cb0b2
Fix
mosuem e1ed12d
relax
mosuem 73fceb8
reqs
mosuem 6880f4e
run pub get
mosuem ccbe6de
fixes
mosuem 8d1c5be
fixes
mosuem d644d53
testing
mosuem ba9a622
pritn all labels
mosuem c0fa94f
in quotes
mosuem e0a4fd3
decode as list
mosuem aac6bf7
decode as list
mosuem 35698be
print args
mosuem 7237cd0
not use tojson
mosuem 451c8a8
as lines
mosuem caff617
Use pub activate
mosuem 26953d0
fix name
mosuem e25d764
Fix name
mosuem 4c51343
Fix schema key
mosuem c08942c
print comment
mosuem 173595b
name output
mosuem 8f7f46f
Fixes
mosuem 895ab30
add issue number
mosuem fa49b83
Update commenting
mosuem 11a7029
mkdir
mosuem 64bd0d3
Fix mkdir
mosuem 668fa88
More info
mosuem 9d6f6fe
Take package from github
mosuem 9eb29a6
fix args
mosuem 17bd7ed
fix quotes
mosuem 3965d10
fix issue
mosuem 7d25c72
use dart
mosuem 8df63fc
print exec
mosuem 6f1a7f8
use http instaed of git
mosuem b8c3bf7
Fix uri
mosuem bb40912
Fix semicolon
mosuem 9215e29
Fixes
mosuem dc79cf1
print stderr
mosuem 4e4dc37
small change
mosuem d770d53
sigurds fix
mosuem 05f6311
Fix name
mosuem c477c59
Add readme
mosuem fed28e5
typo
mosuem ca6036d
Add link
mosuem acd1b19
Add licenses
mosuem 0e4c0bc
Add testing
mosuem f4bcc4d
Changes as per review
mosuem 80ac9c3
Use unicode instead of emojis
mosuem 74b591c
Use local version for testing
mosuem abf8a07
Add quest testing workflow
mosuem 5ccf56a
Remove docs
mosuem 8431ba4
Rename wf
mosuem 01b8751
log gh clone
mosuem 0ad9653
set gh token
mosuem 2d9f388
print command
mosuem 2ed31d0
Use useFlutter
mosuem 43e2707
print files
mosuem a1677a9
add log
mosuem f371d33
order
mosuem 0218542
Fix quest wf
mosuem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "../../pkgs/quest/schema.json", | ||
"https://github.com/mosuem/my_app_old_web": { | ||
"level": "analyze" | ||
}, | ||
"https://github.com/mosuem/my_app_new_web": { | ||
"level": "test", | ||
"packages": { | ||
"exclude": "intl4x" | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Ecosystem test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
repos_file: | ||
description: 'Path to the file containing the list of repository names' | ||
type: string | ||
required: true | ||
local_debug: | ||
description: Whether to use a local version of ecosystem testing - only for debug | ||
default: false | ||
type: boolean | ||
required: false | ||
|
||
jobs: | ||
update_and_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 | ||
with: | ||
channel: main | ||
|
||
- run: echo "${{ toJSON(github.event.pull_request.labels.*.name) }}" | ||
|
||
- name: Install firehose | ||
run: dart pub global activate -s path pkgs/quest | ||
if: ${{ inputs.local_debug }} | ||
|
||
- run: dart pub global activate -s git https://github.com/dart-lang/ecosystem.git --git-ref main --git-path pkgs/quest | ||
if: ${{ !inputs.local_debug }} | ||
|
||
- name: Update package and test | ||
run: | | ||
dart pub global run quest ${{ inputs.repos_file }} ${{ github.repositoryUrl }} ${{ github.head_ref || github.ref_name }} "${{ toJSON(github.event.pull_request.labels.*.name) }}" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Output issue number | ||
run: | | ||
mkdir -p output | ||
echo ${{ github.event.number }} > output/issueNumber | ||
|
||
- name: Find Comment | ||
uses: peter-evans/find-comment@90e9b82d6319a7ae3f32bc0b434db48d6c376e55 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
comment-author: github-actions[bot] | ||
body-includes: '## Ecosystem testing' | ||
|
||
- name: Write comment id to file | ||
if: ${{ steps.fc.outputs.comment-id != 0 }} | ||
run: echo ${{ steps.fc.outputs.comment-id }} >> output/commentId | ||
|
||
- name: Upload markdown | ||
if: success() || failure() | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 | ||
with: | ||
name: output | ||
path: output/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Ecosystem test:Internal | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
test_ecosystem: | ||
uses: ./.github/workflows/ecosystem_test.yaml | ||
mosuem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
repos_file: .github/test_repos/repos.json | ||
local_debug: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: package:quest | ||
|
||
permissions: read-all | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/quest.yml' | ||
- 'pkgs/quest/**' | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/quest.yml' | ||
- 'pkgs/quest/**' | ||
schedule: | ||
- cron: '0 0 * * 0' # weekly | ||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/quest | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 | ||
with: | ||
channel: main | ||
|
||
- run: dart pub get | ||
|
||
- run: dart analyze --fatal-infos | ||
|
||
- run: dart format --output=none --set-exit-if-changed . | ||
|
||
- run: dart test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2024, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Quest: Ecosystem Testing for Dart Packages | ||
Embark your package on a quest of testing against a suite of applications. This helps identify potential breaking changes introduced by package updates, ensuring seamless integration across the ecosystem. | ||
|
||
## What does it do? | ||
It checks if your package upgrade would result in failures in the ecosystem. This is achieved by running the following pseudocode: | ||
```dart | ||
for (final app in applicationSuite) { | ||
if (app.dependencies.contains(package)) { | ||
pubGet(app); | ||
analyze(app); | ||
test(app); | ||
|
||
upgradePackage(app); | ||
|
||
pubGet(app); | ||
analyze(app); | ||
test(app); | ||
} | ||
} | ||
``` | ||
|
||
## How do I use it? | ||
1. Create a suite of repositories to test against at `.github/test_repos/repos.json`. Follow the schema specified [here](schema.json). | ||
```json | ||
{ | ||
"https://github.com/mosuem/my_app_old_web": { | ||
"level": "analyze" | ||
}, | ||
"https://github.com/mosuem/my_app_new_web": { | ||
"level": "test", | ||
"packages": { | ||
"exclude": "intl4x" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
2. Add a workflow file with the following contents: | ||
```yaml | ||
name: Ecosystem test | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
test_ecosystem: | ||
uses: dart-lang/ecosystem/.github/workflows/ecosystem_test.yaml@main | ||
with: | ||
repos_file: .github/test_repos/repos.json | ||
``` | ||
|
||
3. To show the markdown result as a comment, also add a workflow file | ||
```yaml | ||
name: Comment on the pull request | ||
|
||
on: | ||
# Trigger this workflow after the Health workflow completes. This workflow will have permissions to | ||
# do things like create comments on the PR, even if the original workflow couldn't. | ||
workflow_run: | ||
workflows: | ||
- Health | ||
- Publish | ||
- Ecosystem test | ||
types: | ||
- completed | ||
|
||
jobs: | ||
upload: | ||
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main | ||
permissions: | ||
pull-requests: write | ||
``` | ||
|
||
4. Profit! | ||
|
||
# Contributing | ||
Contributions are welcome! Please see the [contribution guidelines](../../CONTRIBUTING.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
linter: | ||
rules: | ||
- prefer_final_locals |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.