-
Notifications
You must be signed in to change notification settings - Fork 102
185700 gemini log analyzer #5037
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
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0741efc
add `APP_DART_GEMINI_LOG_ANALYZER_KEY` secret
ievdokdm 9f73498
added `log_analysis` filed to `presubmit_jobs` collection
ievdokdm b3d038a
added `build_id` into `presubmit_job` document
ievdokdm faaab16
added genkit
ievdokdm 7ef51e4
implemented `analyze_logs` api
ievdokdm facad8a
fix error: UseTestLogging
ievdokdm 316b59b
dart format
ievdokdm 54961e1
added log analysis field to response
ievdokdm e23c2dc
added "Log Analisis" tab
ievdokdm 3841ea0
added `Analyze Logs with Gemini` button
ievdokdm cfdf409
improved promt
ievdokdm 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -104,12 +104,14 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| static const fieldSlug = 'slug'; | ||||||
| static const fieldJobName = 'job_name'; | ||||||
| static const fieldBuildNumber = 'build_number'; | ||||||
| static const fieldBuildId = 'build_id'; | ||||||
| static const fieldStatus = 'status'; | ||||||
| static const fieldAttemptNumber = 'attempt_number'; | ||||||
| static const fieldCreationTime = 'creation_time'; | ||||||
| static const fieldStartTime = 'start_time'; | ||||||
| static const fieldEndTime = 'end_time'; | ||||||
| static const fieldSummary = 'summary'; | ||||||
| static const fieldLogAnalysis = 'log_analysis'; | ||||||
|
|
||||||
| static AppDocumentId<PresubmitJob> documentIdFor({ | ||||||
| required RepositorySlug slug, | ||||||
|
|
@@ -168,22 +170,26 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| required int attemptNumber, | ||||||
| required int creationTime, | ||||||
| int? buildNumber, | ||||||
| int? buildId, | ||||||
| int? startTime, | ||||||
| int? endTime, | ||||||
| String? summary, | ||||||
| String? logAnalysis, | ||||||
| }) { | ||||||
| return PresubmitJob._( | ||||||
| { | ||||||
| fieldSlug: slug.fullName.toValue(), | ||||||
| fieldCheckRunId: checkRunId.toValue(), | ||||||
| fieldJobName: jobName.toValue(), | ||||||
| fieldBuildNumber: ?buildNumber?.toValue(), | ||||||
| fieldBuildId: ?buildId?.toValue(), | ||||||
| fieldStatus: status.value.toValue(), | ||||||
| fieldAttemptNumber: attemptNumber.toValue(), | ||||||
| fieldCreationTime: creationTime.toValue(), | ||||||
| fieldStartTime: ?startTime?.toValue(), | ||||||
| fieldEndTime: ?endTime?.toValue(), | ||||||
| fieldSummary: ?summary?.toValue(), | ||||||
| fieldLogAnalysis: ?logAnalysis?.toValue(), | ||||||
| }, | ||||||
| name: documentNameFor( | ||||||
| slug: slug, | ||||||
|
|
@@ -213,9 +219,11 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| creationTime: creationTime, | ||||||
| status: TaskStatus.waitingForBackfill, | ||||||
| buildNumber: null, | ||||||
| buildId: null, | ||||||
| startTime: null, | ||||||
| endTime: null, | ||||||
| summary: null, | ||||||
| logAnalysis: null, | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -240,13 +248,17 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| int? get buildNumber => fields[fieldBuildNumber] != null | ||||||
| ? int.parse(fields[fieldBuildNumber]!.integerValue!) | ||||||
| : null; | ||||||
| int? get buildId => fields[fieldBuildId] != null | ||||||
| ? int.parse(fields[fieldBuildId]!.integerValue!) | ||||||
| : null; | ||||||
| int? get startTime => fields[fieldStartTime] != null | ||||||
| ? int.parse(fields[fieldStartTime]!.integerValue!) | ||||||
| : null; | ||||||
| int? get endTime => fields[fieldEndTime] != null | ||||||
| ? int.parse(fields[fieldEndTime]!.integerValue!) | ||||||
| : null; | ||||||
| String? get summary => fields[fieldSummary]?.stringValue; | ||||||
| String? get logAnalysis => fields[fieldLogAnalysis]?.stringValue; | ||||||
|
|
||||||
| TaskStatus get status { | ||||||
| final rawValue = fields[fieldStatus]!.stringValue!; | ||||||
|
|
@@ -273,6 +285,14 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| set buildId(int? buildId) { | ||||||
| if (buildId == null) { | ||||||
| fields.remove(fieldBuildId); | ||||||
| } else { | ||||||
| fields[fieldBuildId] = buildId.toValue(); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| set summary(String? summary) { | ||||||
| if (summary == null) { | ||||||
| fields.remove(fieldSummary); | ||||||
|
|
@@ -281,8 +301,17 @@ final class PresubmitJob extends AppDocument<PresubmitJob> { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| set logAnalysis(String? logAnalysis) { | ||||||
| if (logAnalysis == null) { | ||||||
| fields.remove(fieldLogAnalysis); | ||||||
| } else { | ||||||
| fields[fieldLogAnalysis] = logAnalysis.toValue(); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| void updateFromBuild(bbv2.Build build) { | ||||||
| fields[fieldBuildNumber] = build.number.toValue(); | ||||||
| fields[fieldBuildId] = Value(integerValue: build.id.toString()); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| fields[fieldCreationTime] = build.createTime | ||||||
| .toDateTime() | ||||||
| .millisecondsSinceEpoch | ||||||
|
|
||||||
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.
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.
q: Should you use
int.tryParsejust to avoid throwing if the field is unparsable?you could also cheat and just do:
int.tryParse(fields[fieldBuildId]?.integerValue ?? '')