Skip to content

Bug fixes for data collection#58

Merged
amrit110 merged 1 commit intomainfrom
bug_fixes
Mar 20, 2026
Merged

Bug fixes for data collection#58
amrit110 merged 1 commit intomainfrom
bug_fixes

Conversation

@amrit110
Copy link
Copy Markdown
Member

This pull request refactors the ActivityLogger class to improve the reliability and concurrency safety of bot activity logging. The main change is switching from a single log file to a per-run sidecar file approach, ensuring that concurrent workflow jobs do not overwrite each other's entries. The combined log is now rebuilt from all sidecars and historical entries, with robust deduplication and error handling. Several new methods have been introduced, and the logging workflow has been updated accordingly.

Logging architecture overhaul:

  • Changed logging from a single unified log file to writing each activity to a unique per-run sidecar file in GCS, preventing concurrent job overwrites. The combined log is rebuilt from all sidecars and historical entries. (ActivityLogger class and docstring, __init__, log_fix) [1] [2] [3]
  • Added new attributes to ActivityLogger for sidecar file prefixes and URIs, and updated initialization to support the new architecture. (__init__) [1] [2]

New GCS utility methods:

  • Introduced _gcs_upload, _gcs_read_json, _write_entry_sidecar, _list_entry_sidecars, and _rebuild_combined_log methods for handling file uploads, downloads, listing, and rebuilding the combined log from sidecars.

Logging workflow update:

  • Updated log_fix to write activity to a sidecar file first, then rebuild the combined log from all sidecars. The method now returns success if the sidecar write succeeds, regardless of combined log rebuild status. [1] [2] [3]

Error handling improvements:

  • Improved error handling and logging throughout GCS operations and log rebuilds to ensure durability and transparency in failure scenarios. [1] [2]

@amrit110 amrit110 self-assigned this Mar 19, 2026
@amrit110 amrit110 added the bug Something isn't working label Mar 19, 2026
@amrit110 amrit110 merged commit de548b8 into main Mar 20, 2026
9 checks passed
@amrit110 amrit110 deleted the bug_fixes branch March 20, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant