Skip to content

Conversation

@Abhinavpv28
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 1, 2026 07:43
@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner January 1, 2026 07:43
Copy link
Contributor

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 implements a major refactoring to support library usage of uploadSTBLogs. The changes flatten the RuntimeContext structure by removing nested groupings and consolidate multiple source files to simplify the codebase architecture.

Key Changes:

  • Flattened RuntimeContext structure eliminating nested paths, device, settings, endpoints, flags, and retry sub-structures
  • Consolidated log_collector.c into archive_manager.c and cleanup_manager.c into cleanup_handler.c
  • Combined individual strategy files (strategy_dcm.c, strategy_ondemand.c, strategy_reboot.c) into a unified strategies.c
  • Added library build support with new uploadstblogs_run() API and separated binary build with UPLOADSTBLOGS_BUILD_BINARY flag
  • Removed two test files (strategy_dcm_gtest.cpp, strategy_ondemand_gtest.cpp) and consolidated into strategies_gtest.cpp

Reviewed changes

Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uploadstblogs/unittest/*.cpp (11 files) Updated all test files to use flattened RuntimeContext structure (e.g., ctx.log_path instead of ctx.paths.log_path)
uploadstblogs/src/validation.c Updated directory validation to use flattened context fields
uploadstblogs/src/uploadstblogs.c Added uploadstblogs_run() API and wrapped main() with UPLOADSTBLOGS_BUILD_BINARY conditional
uploadstblogs/src/strategy_selector.c Updated strategy selection logic to use flattened flag and device type fields
uploadstblogs/src/strategies.c New file combining DCM, ONDEMAND, and REBOOT strategy implementations
uploadstblogs/src/retry_logic.c Updated retry logic to use flattened retry configuration fields
uploadstblogs/src/path_handler.c Updated path handling to use flattened endpoint and settings fields
uploadstblogs/src/event_manager.c Updated event emission to use flattened device type field
uploadstblogs/src/context_manager.c Major refactoring to populate flattened RuntimeContext fields
uploadstblogs/src/cleanup_handler.c Expanded to include cleanup_manager functionality with housekeeping functions
uploadstblogs/src/archive_manager.c Expanded to include log_collector functionality with collection functions
uploadstblogs/src/Makefile.am Added library build target and updated binary to link against library
uploadstblogs/include/*.h (4 files) Updated type definitions and API declarations for library support
unit_test.sh Updated test runner to reflect consolidated test files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant