Skip to content

Conversation

@Abhinavpv28
Copy link
Contributor

No description provided.

@Abhinavpv28 Abhinavpv28 requested a review from a team as a code owner January 11, 2026 18:14
Copilot AI review requested due to automatic review settings January 11, 2026 18:14
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 refactors the uploadSTBLogs codebase by flattening the RuntimeContext structure and consolidating related functionality into fewer source files. The changes eliminate nested structures (paths, flags, endpoints, device, settings, retry) in favor of direct field access, improving code readability and maintainability.

Changes:

  • Flattened RuntimeContext structure fields from nested (e.g., ctx->paths.log_path) to direct (e.g., ctx->log_path)
  • Consolidated strategy implementations from separate files (strategy_dcm.c, strategy_ondemand.c, strategy_reboot.c) into a single strategies.c file
  • Merged log collection functionality from log_collector.c into archive_manager.c
  • Combined cleanup functionality from cleanup_manager.c into cleanup_handler.c
  • Added new API functions uploadstblogs_run() and uploadstblogs_execute() with conditional main() compilation
  • Updated validation logic to check RRD flag before validating PREV_LOG_PATH
  • Enhanced path handler to support RRD-specific HTTP results files

Reviewed changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uploadstblogs/unittest/validation_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/upload_engine_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/strategy_selector_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/strategy_ondemand_gtest.cpp Deleted - functionality moved to strategies_gtest.cpp
uploadstblogs/unittest/strategy_handler_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/strategy_dcm_gtest.cpp Deleted - functionality moved to strategies_gtest.cpp
uploadstblogs/unittest/strategies_gtest.cpp New consolidated test file for all strategy tests
uploadstblogs/unittest/retry_logic_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/path_handler_gtest.cpp Updated context field references and parameter names
uploadstblogs/unittest/mocks/mock_file_operations.h Added copy_file mock method
uploadstblogs/unittest/mocks/mock_file_operations.cpp Implemented copy_file mock
uploadstblogs/unittest/log_collector_gtest.cpp Updated includes and context field references
uploadstblogs/unittest/event_manager_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/context_manager_gtest.cpp Updated context field references from nested to flat structure
uploadstblogs/unittest/cleanup_handler_gtest.cpp Updated includes and added mock initialization
uploadstblogs/unittest/archive_manager_gtest.cpp Updated context field references and added log collection tests
uploadstblogs/unittest/Makefile.am Updated binary names and source file references
uploadstblogs/src/validation.c Updated context field references and added RRD flag check for PREV_LOG_PATH validation
uploadstblogs/src/uploadstblogs.c Updated context field references, added uploadstblogs_run() API, and conditional main() compilation
uploadstblogs/src/strategy_selector.c Updated context field references from nested to flat structure
uploadstblogs/src/strategy_reboot.c Deleted - functionality moved to strategies.c
uploadstblogs/src/strategy_ondemand.c Deleted - functionality moved to strategies.c
uploadstblogs/src/strategy_handler.c Updated context field references from nested to flat structure
uploadstblogs/src/strategy_dcm.c Deleted - functionality moved to strategies.c
uploadstblogs/src/strategies.c New consolidated file containing all strategy implementations
uploadstblogs/src/retry_logic.c Updated context field references from nested to flat structure
uploadstblogs/src/path_handler.c Updated context field references and added RRD-specific output file support
uploadstblogs/src/log_collector.c Deleted - functionality moved to archive_manager.c
uploadstblogs/src/event_manager.c Updated context field references and added RRD flag checks for maintenance events
uploadstblogs/src/context_manager.c Updated context field references from nested to flat structure
uploadstblogs/src/cleanup_manager.c Deleted - functionality moved to cleanup_handler.c
uploadstblogs/src/cleanup_handler.c Updated to include cleanup_manager functionality and support RRD-specific cleanup
uploadstblogs/src/archive_manager.c Updated to include log_collector functionality

💡 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