-
Notifications
You must be signed in to change notification settings - Fork 0
feat: access providers in same scope #32
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
Open
nank1ro
wants to merge
21
commits into
main
Choose a base branch
from
feat/access-providers-in-same-scope
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
53d002c
feat: access providers in same scope
nank1ro aa4d153
refactor
nank1ro 11fe9ea
fix: tests
nank1ro 57ff372
fix: typos
nank1ro a654085
coverage: ignore coverage for unreachable states
nank1ro 15586f3
coverage: ignore line
nank1ro 05957a1
chore: fix typo
nank1ro 012b870
refactor: use smaller methods\
nank1ro 6d02e04
chore: coverage ignore indentation
nank1ro ad3f27f
docs: update dependencies
nank1ro f753a42
docs: update
nank1ro 083f710
perf: optimize ProviderScope with zero-cost debug validation (#34)
Copilot e848f11
refactors
nank1ro 57d7356
chore: remove mds
nank1ro 88a2f7b
chore: remove unused import
nank1ro 7e5806e
ci: update benchmark worflow
nank1ro 6f5585c
chore: remove debug mode comments
nank1ro d3f6751
tests: add circular dependency tests
nank1ro 80595ad
fix: typos
nank1ro 51ad98f
Merge branch 'main' into feat/access-providers-in-same-scope
nank1ro 30dba33
ci fixes
nank1ro 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,122 @@ | ||
| name: Provider Benchmarks | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "packages/disco/lib/**" | ||
| - "packages/disco/benchmark/**" | ||
| - ".github/workflows/benchmark.yaml" | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev | ||
| paths: | ||
| - "packages/disco/lib/**" | ||
| - "packages/disco/benchmark/**" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| name: Run Provider Benchmarks | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Flutter | ||
| uses: subosito/flutter-action@v2.18.0 | ||
| with: | ||
| channel: "stable" | ||
| cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: flutter pub get | ||
| working-directory: packages/disco | ||
|
|
||
| - name: Run benchmarks (Debug Mode - Worst Case) | ||
| working-directory: packages/disco | ||
| run: | | ||
| # Run benchmark, it will generate benchmark_results.md automatically | ||
| flutter test benchmark/provider_benchmark.dart | ||
|
|
||
| - name: Upload benchmark results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: benchmark-results | ||
| path: packages/disco/benchmark_results.md | ||
|
|
||
| - name: Update README with benchmark results | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') | ||
| run: | | ||
| # Read benchmark results | ||
| BENCHMARK_CONTENT=$(cat packages/disco/benchmark_results.md) | ||
|
|
||
| # Check if README already has a Benchmark section | ||
| if grep -q "^## Benchmark" packages/disco/README.md; then | ||
| # Remove everything from ## Benchmark to the end | ||
| sed -i '/^## Benchmark/,$d' packages/disco/README.md | ||
| fi | ||
|
|
||
| # Add benchmark section at the end | ||
| echo "" >> packages/disco/README.md | ||
| echo "## Benchmark" >> packages/disco/README.md | ||
| echo "" >> packages/disco/README.md | ||
| echo "$BENCHMARK_CONTENT" >> packages/disco/README.md | ||
|
|
||
| - name: Commit benchmark results to README | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') | ||
| run: | | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
| git add packages/disco/README.md | ||
| if git diff --staged --quiet; then | ||
| echo "No changes to commit" | ||
| else | ||
| git commit -m "chore: update benchmark results in README [skip ci]" | ||
| git push | ||
| fi | ||
|
|
||
| - name: Comment PR with results | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const results = fs.readFileSync('packages/disco/benchmark_results.md', 'utf8'); | ||
|
|
||
| // Check if we already commented | ||
| const comments = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| }); | ||
|
|
||
| const botComment = comments.data.find(comment => | ||
| comment.user.type === 'Bot' && | ||
| comment.body.includes('Provider Benchmark Results') | ||
| ); | ||
|
|
||
| if (botComment) { | ||
| // Update existing comment | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: botComment.id, | ||
| body: results | ||
| }); | ||
| } else { | ||
| // Create new comment | ||
| await github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: results | ||
| }); | ||
| } | ||
|
|
||
| - name: Display results | ||
| run: cat packages/disco/benchmark_results.md | ||
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.