-
Notifications
You must be signed in to change notification settings - Fork 137
Eval1 #790
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
Draft
polina-c
wants to merge
36
commits into
flutter:main
Choose a base branch
from
polina-c:eval1
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.
Draft
Eval1 #790
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
e3c54df
-
polina-c 65c6189
Update smoke_test.dart
polina-c 9f7343b
-
polina-c a9f861f
Create eval.yaml
polina-c 3b678ac
-
polina-c fe8a7ff
Update pubspec.yaml
polina-c 33c1b58
Update eval.yaml
polina-c 12d791b
Update eval.yaml
polina-c 2fa640f
Update eval.yaml
polina-c 68caeed
Update eval.yaml
polina-c e0c5cab
Update eval.yaml
polina-c c2d1a21
Update eval.yaml
polina-c c61ac64
Merge branch 'eval' into eval1
polina-c b2ea20e
-
polina-c a3b6f01
-
polina-c 389d904
Update eval.yaml
polina-c 903aacb
Update eval.yaml
polina-c 793dceb
Update eval.yaml
polina-c dfeaf6e
Update eval.yaml
polina-c 1fd2c43
Update eval.yaml
polina-c 339047a
Revert "Update eval.yaml"
polina-c 820c52d
Update eval.yaml
polina-c 6a638b1
Update eval.yaml
polina-c 7e4ba7c
Update api_key.dart
polina-c f8a455c
Update eval.yaml
polina-c f3a8e83
Update eval.yaml
polina-c 08e8e81
Create test.yaml
polina-c 4fff8cf
Update test.yaml
polina-c 7684b2f
Update test.yaml
polina-c 0b58dd9
Update test.yaml
polina-c d4e230b
Update test.yaml
polina-c dff869c
Update test.yaml
polina-c ed589fa
Update test.yaml
polina-c b019d88
Update test.yaml
polina-c c1e0944
Update test.yaml
polina-c 7717039
Update test.yaml
polina-c 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,83 @@ | ||
| # Copyright 2025 The Flutter Authors. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
||
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
|
|
||
| name: Eval CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| schedule: | ||
| # Tests may fail due to new dependency releases. | ||
| # Regular execution provides early detection of such regressions. | ||
| - cron: '0 * * * *' # hourly | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| # Prevents the job from running on forks or fork PRs (which don't have access to secrets). | ||
| # if: github.repository == 'flutter/genui' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | ||
| name: examples/eval (${{ matrix.flutter_version }}) | ||
| environment: eval | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flutter_version: [beta, stable] | ||
| os: [ubuntu-latest] | ||
| steps: | ||
| - name: Check API key 1 | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| run: | | ||
| if [ -n "$GEMINI_API_KEY" ]; then | ||
| echo "GEMINI_API_KEY is set (${#GEMINI_API_KEY} chars)" | ||
| else | ||
| echo "GEMINI_API_KEY is NOT set" | ||
| fi | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
| - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 | ||
| with: | ||
| distribution: "zulu" | ||
| java-version: "17" | ||
| cache: "gradle" | ||
| - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 | ||
| with: | ||
| channel: ${{ matrix.flutter_version }} | ||
| cache: true | ||
| - name: Print Flutter version | ||
| run: flutter --version | ||
| - name: Cache Pub dependencies | ||
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 | ||
| with: | ||
| path: ${{ env.PUB_CACHE }} | ||
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }} | ||
| restore-keys: ${{ runner.os }}-pub- | ||
| - name: Install dependencies | ||
| working-directory: examples/eval | ||
| run: dart pub get | ||
| - name: Check API key | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| run: | | ||
| if [ -n "$GEMINI_API_KEY" ]; then | ||
| echo "GEMINI_API_KEY is set (${#GEMINI_API_KEY} chars)" | ||
| else | ||
| echo "GEMINI_API_KEY is NOT set" | ||
| fi | ||
| - name: Run tests | ||
| working-directory: examples/eval | ||
| env: | ||
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
| run: flutter test --dart-define=GEMINI_API_KEY=$GEMINI_API_KEY | ||
|
|
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,22 @@ | ||
| name: CI/CD Pipeline | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| environment: my-test-env | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
|
|
||
| - name: secret | ||
| env: | ||
| MY_TEST_VAR: ${{ secrets.MY_TEST_VAR }} | ||
| MY_VAR_NAME: ${{ vars.MY_VAR_NAME }} | ||
| run: | | ||
| echo "MY_TEST_VAR has ${#MY_TEST_VAR} chars" | ||
| echo 'Hi ${{ vars.MY_VAR_NAME }}' | ||
| echo "Hi $MY_VAR_NAME" |
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 @@ | ||
| # Eval | ||
|
|
||
| Project for tests that evaluate genui against real AI models. |
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,24 @@ | ||
| # Copyright 2025 The Flutter Authors. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
||
| name: eval | ||
| publish_to: "none" | ||
|
|
||
| environment: | ||
| sdk: ">=3.10.0 <4.0.0" | ||
| flutter: ">=3.35.7 <4.0.0" | ||
|
|
||
| resolution: workspace | ||
|
|
||
| dependencies: | ||
| flutter: | ||
| sdk: flutter | ||
| genui: ^0.7.0 | ||
|
|
||
| dev_dependencies: | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
| flutter: | ||
| uses-material-design: 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // Copyright 2025 The Flutter Authors. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| import 'test_infra/api_key.dart'; | ||
|
|
||
| void main() { | ||
| test('test can read api key "$geminiApiKeyName"', () { | ||
| final String key = apiKeyForEval(); | ||
| expect(key, isNotEmpty); | ||
| // ignore: avoid_print | ||
| print('API Key: ${key.substring(0, 2)}...${key.substring(key.length - 2)}'); | ||
| }); | ||
| } | ||
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,20 @@ | ||
| // Copyright 2025 The Flutter Authors. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:io'; | ||
|
|
||
| const geminiApiKeyName = 'GEMINI_API_KEY'; | ||
|
|
||
| /// API key for Google Generative AI (only needed if using google backend). | ||
| /// Get an API key from https://aistudio.google.com/app/apikey | ||
| /// Specify this when running the app with "-D GEMINI_API_KEY=$GEMINI_API_KEY" | ||
| const String geminiApiKey = String.fromEnvironment(geminiApiKeyName); | ||
|
|
||
| String apiKeyForEval() { | ||
| String apiKey = geminiApiKey.isEmpty | ||
| ? Platform.environment[geminiApiKeyName] ?? '' | ||
| : geminiApiKey; | ||
| if (apiKey.isEmpty) throw Exception('$geminiApiKeyName is not configured.'); | ||
| return apiKey; | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Printing parts of an API key to the console, even if redacted, is a security risk. This information could be captured in logs, especially in CI/CD environments, potentially exposing sensitive data. The
expect(key, isNotEmpty)check on the previous line is sufficient to validate that a key has been provided.