Skip to content

185700 gemini log analyzer#5037

Open
ievdokdm wants to merge 11 commits intoflutter:mainfrom
ievdokdm:185700-gemini-log-analyzer
Open

185700 gemini log analyzer#5037
ievdokdm wants to merge 11 commits intoflutter:mainfrom
ievdokdm:185700-gemini-log-analyzer

Conversation

@ievdokdm
Copy link
Copy Markdown
Contributor

Implemented API for analyzing failed logs with gemini
partial implementation of: flutter/flutter#185700

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Apr 30, 2026
@ievdokdm ievdokdm added the autosubmit Merge PR when tree becomes green via auto submit App. label Apr 30, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App. label Apr 30, 2026
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented Apr 30, 2026

autosubmit label was removed for flutter/cocoon/5037, because - The status or check suite common-validations has failed. Please fix the issues identified (or deflake) before re-applying this label.

@ievdokdm ievdokdm added autosubmit Merge PR when tree becomes green via auto submit App. CICD Run CI/CD and removed CICD Run CI/CD labels Apr 30, 2026
@ievdokdm ievdokdm added CICD Run CI/CD and removed CICD Run CI/CD labels Apr 30, 2026
@ievdokdm ievdokdm force-pushed the 185700-gemini-log-analyzer branch from bd1e1d9 to fbf6fc6 Compare April 30, 2026 22:41
@ievdokdm ievdokdm added CICD Run CI/CD and removed CICD Run CI/CD labels Apr 30, 2026
@ievdokdm ievdokdm force-pushed the 185700-gemini-log-analyzer branch from fbf6fc6 to b10a32c Compare May 1, 2026 17:44
@ievdokdm ievdokdm force-pushed the 185700-gemini-log-analyzer branch from e0a3c69 to c1df029 Compare May 1, 2026 17:57
@auto-submit
Copy link
Copy Markdown
Contributor

auto-submit Bot commented May 1, 2026

autosubmit label was removed for flutter/cocoon/5037, because - The status or check suite test-common-packages (dev/cocoon_code_health) has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App. label May 1, 2026
@ievdokdm ievdokdm force-pushed the 185700-gemini-log-analyzer branch from b6a9ec4 to 44651b4 Compare May 1, 2026 18:13
@ievdokdm ievdokdm force-pushed the 185700-gemini-log-analyzer branch from 44651b4 to cfdf409 Compare May 1, 2026 18:15
@ievdokdm ievdokdm added CICD Run CI/CD and removed CICD Run CI/CD labels May 1, 2026
Comment on lines +251 to +253
int? get buildId => fields[fieldBuildId] != null
? int.parse(fields[fieldBuildId]!.integerValue!)
: null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Should you use int.tryParse just to avoid throwing if the field is unparsable?
you could also cheat and just do: int.tryParse(fields[fieldBuildId]?.integerValue ?? '')


void updateFromBuild(bbv2.Build build) {
fields[fieldBuildNumber] = build.number.toValue();
fields[fieldBuildId] = Value(integerValue: build.id.toString());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fields[fieldBuildId] = Value(integerValue: build.id.toString());
fields[fieldBuildId] = build.id.toValue();

final prNumber = requestData[kPrParam] as int;
final buildId = requestData[kBuildIdParam] as int;

final slug = RepositorySlug(owner, repo);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we validate this slug is in the configured repos (there is a set in Config)? I get UnifiedCheckRun.getLatestPresubmitGuardForPrNum might also check, but it would be nice to have this explicit.

Future<void> main() async {
final cache = CacheService(inMemory: false);
final secretManager = FakeSecretManager();
secretManager.putString('APP_DART_GEMINI_LOG_ANALYZER_KEY', 'dummy_key');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could allow someone working locally to test with their own key:

Suggested change
secretManager.putString('APP_DART_GEMINI_LOG_ANALYZER_KEY', 'dummy_key');
secretManager.putString('APP_DART_GEMINI_LOG_ANALYZER_KEY', Platform.environment['APP_DART_GEMINI_LOG_ANALYZER_KEY'] ?? dummy_key);


@override
Future<String> get geminiLogAnalyzerKey async =>
geminiLogAnalyzerKeyValue ?? 'fake-gemini-key';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenKit supports web (according to pub.dev) so you could use the following. Note, this is different from Platform and is instead a dart compile option (-DAPP_DART_GEMINI_LOG_ANALYZER_KEY="$APP_DART_GEMINI_LOG_ANALYZER_KEY")

Suggested change
geminiLogAnalyzerKeyValue ?? 'fake-gemini-key';
geminiLogAnalyzerKeyValue ??
String.fromEnvironment('APP_DART_GEMINI_LOG_ANALYZER_KEY', defaultValue: 'fake-gemini-key');

Copy link
Copy Markdown
Member

@jtmcdole jtmcdole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments don't apear to have been posted. Trying again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants