Skip to content

chore(logging): guarantee app metadata in log files [WPB-8645] #3902

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

Conversation

vitorhugods
Copy link
Member

@vitorhugods vitorhugods commented Mar 6, 2025

EpicWPB-8645 [Android] Infrastructure code and developer experience


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Most of the times, we don't get basic app information when reading the log files.

Causes

We launch an async coroutine that will initialise the LogFileWriter, and immediately log basic app information, like App version, OS version, Phone model, Commit hash, etc.

Solutions

Make it so that LogFileWriter.start() suspends until it actually starts. Then we can start printing basic information.

This is done by waiting for the first log lines to come before completing the LogFileWriter.start.


PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Updated `start` in `LogFileWriter` to suspend until log initialization is complete, ensuring logging consistency. Added coroutine synchronization using `Job` and adjusted the usage in `UserDebugViewModel` accordingly.
Copy link

sonarqubecloud bot commented Mar 6, 2025

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 45.67%. Comparing base (d38597e) to head (d630171).

Files with missing lines Patch % Lines
...main/kotlin/com/wire/android/util/LogFileWriter.kt 0.00% 6 Missing ⚠️
...in/com/wire/android/ui/debug/UserDebugViewModel.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3902      +/-   ##
=====================================================
- Coverage              45.69%   45.67%   -0.02%     
=====================================================
  Files                    473      473              
  Lines                  16126    16131       +5     
  Branches                2725     2725              
=====================================================
  Hits                    7368     7368              
- Misses                  7991     7996       +5     
  Partials                 767      767              
Files with missing lines Coverage Δ
...in/com/wire/android/ui/debug/UserDebugViewModel.kt 0.00% <0.00%> (ø)
...main/kotlin/com/wire/android/util/LogFileWriter.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d38597e...d630171. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Built wire-android-staging-compat-pr-3902.apk is available for download

@vitorhugods vitorhugods enabled auto-merge March 6, 2025 14:11
Copy link
Contributor

@saleniuk saleniuk left a comment

Choose a reason for hiding this comment

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

😍

@vitorhugods vitorhugods added this pull request to the merge queue Mar 6, 2025
Merged via the queue into release/candidate with commit 3c72501 Mar 6, 2025
13 of 14 checks passed
@vitorhugods vitorhugods deleted the chore/logs/guarantee-app-metadata-in-log-files branch March 6, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants