Skip to content

Overlay: report telemetry #2975

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 4 commits into from
Jul 21, 2025
Merged

Overlay: report telemetry #2975

merged 4 commits into from
Jul 21, 2025

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Jul 17, 2025

This PR adds telemetry fields for overlay analysis.

  • analysis_is_overlay
  • analysis_builds_overlay_base_database
  • overlay_base_database_download_size_bytes
  • overlay_base_database_download_duration_ms

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@cklin cklin marked this pull request as ready for review July 17, 2025 18:13
@Copilot Copilot AI review requested due to automatic review settings July 17, 2025 18:13
@cklin cklin requested a review from a team as a code owner July 17, 2025 18:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds telemetry tracking for overlay database analysis operations. The changes enable the CodeQL Action to collect and report statistics about overlay-base database downloads and analysis modes.

  • Modified the download function to return telemetry statistics instead of a boolean
  • Added new telemetry fields to track download size, duration, and analysis modes
  • Expanded test coverage for the updated download function behavior

Reviewed Changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/overlay-database-utils.ts Updated download function to return telemetry stats and measure database size/download time
src/overlay-database-utils.test.ts Added comprehensive test cases for the modified download function
src/init-action.ts Updated to capture and pass overlay database stats to telemetry reporting
src/analyze.ts Added telemetry flags to track overlay vs overlay-base analysis modes
lib/* Generated JavaScript files reflecting the TypeScript changes

@cklin cklin force-pushed the cklin/overlay-telemetry branch from 76a1b2d to 2b3bae6 Compare July 17, 2025 18:21
@cklin cklin requested a review from mbg July 17, 2025 19:03
Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

This generally looks good, assuming all the necessary backend work is also done to support this. Thanks also for including some tests.

There are no blocking issues. I flagged up a couple points that might be good to deal with before merging this though, as well as some other trivial points.

Comment on lines 331 to 333
logger.warning(
"Filesystem error while accessing downloaded overlay-base database",
);
Copy link
Member

Choose a reason for hiding this comment

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

tryGetFolderBytes will log a warning (since you don't set quiet=true) before returning undefined, so this will always lead to two warnings for the same problem, which I believe will show up as separate workflow annotations.

I'd suggest either removing this warning or setting quiet=true in the tryGetFolderBytes call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think both messages are worth preserving because they tell the user different things.

  • The warning from tryGetFolderBytes explains what went wrong. This is important if the user were to fix the underlying technical problem.
  • The warning here in downloadOverlayBaseDatabaseFromCache explains the consequence of the failure (that the downloaded overlay-base database cannot be accessed) so that the user can assess the severity and impact of the problem.

That said, I agree that they do not both have to be warnings. I downgraded this message to info.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it would be reasonable for tryGetFolderBytes to return the error rather than undefined and then leave it up to the caller to decide what to do with that (e.g. include it in a combined log message with the consequence + underlying problem).

Not something you need to act on if you're happy to downgrade this to an info-level message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I already downgraded the log from warning and info, and I am happy with that change.

@cklin cklin force-pushed the cklin/overlay-telemetry branch from 2b3bae6 to 39b0524 Compare July 18, 2025 15:02
Copy link
Member

@mbg mbg left a comment

Choose a reason for hiding this comment

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

Looks good now, thank you!

@cklin cklin merged commit eefe1b5 into main Jul 21, 2025
282 checks passed
@cklin cklin deleted the cklin/overlay-telemetry branch July 21, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy