-
Notifications
You must be signed in to change notification settings - Fork 46
feat: observability #378
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
Merged
Merged
feat: observability #378
Changes from 14 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
2440d69
feat: implement sentry logger
HannesVDB c445f41
feat: added debug actions
HannesVDB 73bc672
feat: added monitoring:
HannesVDB 84a4817
feat: added log type
HannesVDB 1a7ecc6
feat: fix deprications
HannesVDB d50a308
feat: update goledns
HannesVDB 4f8e55e
feat: fix tests
HannesVDB 9aa8ff0
feat: update package + remove widgetbook from tests
HannesVDB 0fb91db
fix analyzer
HannesVDB 481bcf3
re-enable coverage
HannesVDB 24eb230
setup coverage
HannesVDB 20df598
added treshold for widget tests
HannesVDB 4ab3ada
try to fix this
HannesVDB dba4cfa
feat: fix coverage item
HannesVDB 8f447a8
Update rename
HannesVDB 1bc3e97
feat: re-enabel the pr flow
HannesVDB 1e93d77
feat: reenable git_reset
HannesVDB 669e399
Cleanup
HannesVDB 0ccd4fc
feat: move to values
HannesVDB e5bf2f8
pr comment
HannesVDB e30c50c
pr comment
HannesVDB 7f0fdfd
analyzer
HannesVDB 6d3ef4f
fix test
HannesVDB 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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "flutter": "3.24.0" | ||
| "flutter": "3.38.9" | ||
| } |
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 was deleted.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| import 'dart:io'; | ||
|
|
||
| void main() { | ||
| printMessage('Start filtering the lcov.info file'); | ||
| final file = File('coverage/lcov.info'); | ||
| if (!file.existsSync()) { | ||
| printMessage('"lcov.info" does not exist'); | ||
| return; | ||
| } | ||
| const endOfRecord = 'end_of_record'; | ||
| final sections = <LcovSection>[]; | ||
| final lines = file.readAsLinesSync(); | ||
| LcovSection? currentSection; | ||
| for (final line in lines) { | ||
| if (line.endsWith('.dart')) { | ||
| final filePath = line.replaceAll('SF:', ''); | ||
| currentSection = LcovSection() | ||
| ..header = line | ||
| ..filePath = filePath; | ||
| } else if (line == endOfRecord) { | ||
| final currentSectionTmp = currentSection; | ||
| if (currentSectionTmp != null) { | ||
| currentSectionTmp.footer = line; | ||
| sections.add(currentSectionTmp); | ||
| } | ||
| } else { | ||
| currentSection?.body.add(line); | ||
| } | ||
| } | ||
| final filteredSections = getFilteredSections(sections); | ||
| final sb = StringBuffer(); | ||
| for (final section in filteredSections) { | ||
| sb.write(section.toString()); | ||
| } | ||
| file.writeAsStringSync(sb.toString()); | ||
| printMessage('Filtered the lcov.info file'); | ||
| } | ||
|
|
||
| class LcovSection { | ||
| String? filePath; | ||
| String? header; | ||
| final body = <String>[]; | ||
| String? footer; | ||
|
|
||
| String? getBodyString() { | ||
| final filePathTmp = filePath; | ||
| if (filePathTmp == null) return null; | ||
| final file = File(filePathTmp); | ||
| final content = file.readAsLinesSync(); | ||
| final sb = StringBuffer(); | ||
| getFilteredBody(body, content).forEach((item) => sb..write(item)..write('\n')); | ||
| return sb.toString(); | ||
| } | ||
|
|
||
| @override | ||
| String toString() { | ||
| return '$header\n${getBodyString()}$footer\n'; | ||
| } | ||
| } | ||
|
|
||
| List<LcovSection> getFilteredSections(List<LcovSection> sections) { | ||
| return sections.where((section) { | ||
| final header = section.header; | ||
| if (header == null) return false; | ||
| if (header.endsWith('.g.dart')) { | ||
| return false; | ||
| } else if (header.endsWith('dummy_service.dart')) { | ||
| return false; | ||
| } else if (header.startsWith('SF:lib/vendor/')) { | ||
| return false; | ||
| } else if (header.startsWith('SF:lib/util/locale')) { | ||
| return false; | ||
| } else if (header.contains('widgetbook/')) { | ||
| return false; | ||
| } | ||
| return true; | ||
| }).toList(); | ||
| } | ||
|
|
||
| List<String> getFilteredBody(List<String> body, List<String> lines) { | ||
| return body.where((line) { | ||
| if (line.startsWith('DA:')) { | ||
| final sections = line.split(','); | ||
| final lineNr = int.parse(sections[0].replaceAll('DA:', '')); | ||
| final callCount = int.parse(sections[1]); | ||
| if (callCount == 0) { | ||
| final fileLine = lines[lineNr - 1].trim(); | ||
| if (excludedLines.contains(fileLine)) { | ||
| return false; | ||
| } | ||
| for (final line in excludedStartsWithLines) { | ||
| if (fileLine.trim().startsWith(line)) { | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return true; | ||
| }).toList(); | ||
| } | ||
|
|
||
| const excludedLines = [ | ||
| 'AppConstants._();', | ||
| 'EnvUtils._();', | ||
| 'FlutterTemplateLogger._();', | ||
| 'FlutterTemplateThemeData._();', | ||
| 'Keys._();', | ||
| 'LicenseUtil._();', | ||
| 'ThemeAssets._();', | ||
| 'ThemeColors._();', | ||
| 'ThemeDimens._();', | ||
| 'ThemeDurations._();', | ||
| 'ThemeFonts._();', | ||
| 'ThemeTextStyles._();', | ||
| ]; | ||
|
|
||
| const excludedStartsWithLines = [ | ||
| 'IntColumn get ', | ||
| 'TextColumn get ', | ||
| 'BoolColumn get ', | ||
| 'DateTimeColumn get ', | ||
| ]; | ||
|
|
||
| void printMessage(String message) { | ||
| // ignore: avoid_print | ||
| print(message); | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <testsuites> | ||
| <testsuite name="fastlane.lanes"> | ||
|
|
||
|
|
||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="0: Verifying fastlane version" time="0.000183"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="1: is_ci" time="8.0e-05"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="2: install_provisioning_profiles" time="0.105418"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="3: is_ci" time="0.000176"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="4: echo No\ build\ nr\ set,\ USING\ DEFAULT\ \(1\)" time="0.006442"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="5: clean_build_artifacts" time="0.000139"> | ||
|
|
||
| </testcase> | ||
|
|
||
|
|
||
| <testcase classname="fastlane.lanes" name="6: cobertura convert -i coverage/lcov.info -o coverage/coverage.xml" time="0.270353"> | ||
|
|
||
| </testcase> | ||
|
|
||
| </testsuite> | ||
| </testsuites> |
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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" | ||
| #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.$(CONFIGURATION).xcconfig" | ||
| #include "Generated.xcconfig" |
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,32 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| import lldb | ||
|
|
||
| def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): | ||
| """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" | ||
| base = frame.register["x0"].GetValueAsAddress() | ||
| page_len = frame.register["x1"].GetValueAsUnsigned() | ||
|
|
||
| # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the | ||
| # first page to see if handled it correctly. This makes diagnosing | ||
| # misconfiguration (e.g. missing breakpoint) easier. | ||
| data = bytearray(page_len) | ||
| data[0:8] = b'IHELPED!' | ||
|
|
||
| error = lldb.SBError() | ||
| frame.GetThread().GetProcess().WriteMemory(base, data, error) | ||
| if not error.Success(): | ||
| print(f'Failed to write into {base}[+{page_len}]', error) | ||
| return | ||
|
|
||
| def __lldb_init_module(debugger: lldb.SBDebugger, _): | ||
| target = debugger.GetDummyTarget() | ||
| # Caveat: must use BreakpointCreateByRegEx here and not | ||
| # BreakpointCreateByName. For some reasons callback function does not | ||
| # get carried over from dummy target for the later. | ||
| bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") | ||
| bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) | ||
| bp.SetAutoContinue(True) | ||
| print("-- LLDB integration loaded --") |
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,5 @@ | ||
| # | ||
| # Generated file, do not edit. | ||
| # | ||
|
|
||
| command script import --relative-to-command-file flutter_lldb_helper.py |
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.
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.