Skip to content
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

feat(ecau): add ability to export debug logs and HTTP responses for bug reports #591

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ROpdebee
Copy link
Owner

It's sometimes quite difficult to reproduce an ECAU issue, especially when it concerns specific providers. #521 and #547 (comment) come to mind. Moreover, we're doing some debug logging here and there, but those logs are not shown to the user, so we won't get them in bug reports.

These changes add a feature that enables users to download a log file for an ECAU run, including debug messages and provider responses. These could then be submitted alongside a bug report in case we can't reproduce an issue. When exporting the log, it also displays a warning about the domains in the recorded responses so that people don't accidentally leak user credentials that may be stored in the response.

We're also switching to a new request interface that unifies fetch and GM.xmlHttpRequest, which was necessary to log the responses.

@codecov
Copy link

codecov bot commented Oct 15, 2022

Codecov Report

Base: 98.48% // Head: 98.25% // Decreases project coverage by -0.22% ⚠️

Coverage data is based on head (54c8d9e) compared to base (1e4fa29).
Patch coverage: 95.06% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #591      +/-   ##
==========================================
- Coverage   98.48%   98.25%   -0.23%     
==========================================
  Files          58       65       +7     
  Lines        1386     1492     +106     
  Branches      221      238      +17     
==========================================
+ Hits         1365     1466     +101     
- Misses         13       16       +3     
- Partials        8       10       +2     
Impacted Files Coverage Δ
src/mb_enhanced_cover_art_uploads/fetch.ts 96.70% <50.00%> (ø)
src/lib/util/request/response.ts 75.00% <75.00%> (ø)
...rc/mb_enhanced_cover_art_uploads/providers/base.ts 96.72% <85.71%> (ø)
...rc/lib/util/request/observers/recordingObserver.ts 96.15% <96.15%> (ø)
src/lib/IA/ArchiveMetadata.ts 100.00% <100.00%> (ø)
src/lib/MB/URLs.ts 100.00% <100.00%> (ø)
src/lib/logging/collectorSink.ts 100.00% <100.00%> (ø)
src/lib/logging/logger.ts 100.00% <100.00%> (ø)
src/lib/util/array.ts 84.21% <100.00%> (+0.87%) ⬆️
src/lib/util/request/backendFetch.ts 100.00% <100.00%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ROpdebee
Copy link
Owner Author

/deploy-preview just to make sure deployments will still work

@github-actions
Copy link

This PR changes 3 built userscript(s):

See all changes

github-actions bot added a commit that referenced this pull request Oct 23, 2022
feat(ecau): add ability to export debug logs and HTTP responses for bug reports (#591)
github-actions bot added a commit that referenced this pull request Oct 23, 2022
feat(ecau): add ability to export debug logs and HTTP responses for bug reports (#591)
github-actions bot added a commit that referenced this pull request Oct 23, 2022
feat(ecau): add ability to export debug logs and HTTP responses for bug reports (#591)
ROpdebee added 10 commits June 9, 2023 13:18
We'll need this functionality if we want to collect debug logs even
though debug logging to the console is disabled.
We'll use this to attach a logging observer to log all network
requests, and to attach a request recording that logs request
options and responses for debugging information.
Creating separate recordings for the exact same requests was a bit
wasteful here. There are probably other opportunities for reuse
elsewhere in the test suite too.
@ROpdebee ROpdebee force-pushed the ecau-export-debug-logs branch from 54c8d9e to 5335048 Compare June 9, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant