185700 gemini log analyzer#5037
Conversation
|
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. |
bd1e1d9 to
fbf6fc6
Compare
fbf6fc6 to
b10a32c
Compare
e0a3c69 to
c1df029
Compare
|
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.
|
b6a9ec4 to
44651b4
Compare
44651b4 to
cfdf409
Compare
| int? get buildId => fields[fieldBuildId] != null | ||
| ? int.parse(fields[fieldBuildId]!.integerValue!) | ||
| : null; |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
| 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); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
you could allow someone working locally to test with their own key:
| 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'; |
There was a problem hiding this comment.
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")
| geminiLogAnalyzerKeyValue ?? 'fake-gemini-key'; | |
| geminiLogAnalyzerKeyValue ?? | |
| String.fromEnvironment('APP_DART_GEMINI_LOG_ANALYZER_KEY', defaultValue: 'fake-gemini-key'); |
jtmcdole
left a comment
There was a problem hiding this comment.
My comments don't apear to have been posted. Trying again.
Implemented API for analyzing failed logs with gemini
partial implementation of: flutter/flutter#185700