Skip to content

RDK-61009 : [RDKE] Port Log Backup Scripts to Source code - #100

Merged
shibu-kv merged 4 commits into
developfrom
feature/RDK-61009
Mar 26, 2026
Merged

RDK-61009 : [RDKE] Port Log Backup Scripts to Source code#100
shibu-kv merged 4 commits into
developfrom
feature/RDK-61009

Conversation

@Abhinavpv28

@Abhinavpv28 Abhinavpv28 commented Mar 22, 2026

Copy link
Copy Markdown
Contributor
  • Analyze comments and identify actionable items
  • Fix copyright headers in all feature files (change "Licenses" to "LICENSE file")
  • Fix copyright headers in all Python test files (change "Licenses file the" to "LICENSE file the")
  • Fix copyright headers in shell scripts (test/run_l2.sh, test/run_uploadstblogs_l2.sh)
  • Run code review - no issues found
  • Run CodeQL security scan - no alerts

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Abhinavpv28
Abhinavpv28 requested a review from a team as a code owner March 22, 2026 12:43
Copilot AI review requested due to automatic review settings March 22, 2026 12:43
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: a1af8b5
Report detail: https://gist.github.com/rdkcmf-jenkins/19a9174825e8d07066eb6a2582ae98c6'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: a1af8b5

Report detail: gist'

Comment thread backup_logs/src/backup_engine.c Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a new backup_logs/ component (C code + autotools integration) to perform log backup/rotation, copy/move “special files” based on a config file, and send a systemd notification upon completion. It also adds a GoogleTest-based unit test suite for the new module.

Changes:

  • Added the backup_logs program implementation (config loading, backup engine logic, special file handling, and systemd notification).
  • Integrated backup_logs into the top-level autotools build (configure.ac, Makefile.am), including a new backup_logs/Makefile.am.
  • Added a backup_logs/unittest test harness (gtest binaries, mocks, and autotools files) and a special_files.conf config file.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
special_files.conf Adds the list of “special files” intended for backup/copy/move.
configure.ac Generates build files for the new backup_logs subdir.
Makefile.am Adds backup_logs to top-level SUBDIRS.
backup_logs/Makefile.am Defines how to build/link the new backup_logs binary.
backup_logs/include/backup_types.h Introduces shared types/constants for the new module.
backup_logs/include/backup_logs.h Declares the main backup_logs entrypoints.
backup_logs/include/backup_engine.h Declares backup engine APIs for log rotation/backup.
backup_logs/include/config_manager.h Declares configuration loading APIs.
backup_logs/include/special_files.h Declares special-file config + execution APIs.
backup_logs/include/sys_integration.h Declares system integration APIs (systemd notify, etc.).
backup_logs/src/backup_logs.c Implements init/execute/cleanup/main for the backup program.
backup_logs/src/backup_engine.c Implements the core log-moving/rotation and common operations.
backup_logs/src/config_manager.c Implements config loading from RDK property APIs with defaults.
backup_logs/src/special_files.c Implements parsing and executing the special-files list.
backup_logs/src/sys_integration.c Implements sd_notify()-based systemd notification.
backup_logs/unittest/Makefile.am Defines how gtest binaries are built and wrapped.
backup_logs/unittest/configure.ac Autoconf setup intended for the unit test build.
backup_logs/unittest/mocks/config_manager_mocks.h Adds mock declarations for config_manager tests.
backup_logs/unittest/config_manager_gtest.cpp Adds config_manager unit tests with property mocks.
backup_logs/unittest/sys_integration_gtest.cpp Adds unit tests for systemd notification formatting/error paths.
backup_logs/unittest/special_files_gtest.cpp Adds unit tests for special-files parsing/execution logic.
backup_logs/unittest/backup_logs_gtest.cpp Adds unit tests for backup_logs init/execute/cleanup/main.
backup_logs/unittest/backup_engine_gtest.cpp Adds unit tests for backup engine behaviors and edge cases.

Comment thread backup_logs/src/config_manager.c Outdated
Comment thread backup_logs/include/sys_integration.h Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/unittest/sys_integration_gtest.cpp
Comment thread backup_logs/unittest/config_manager_gtest.cpp Outdated
Comment thread backup_logs/include/backup_engine.h Outdated
Comment thread backup_logs/unittest/special_files_gtest.cpp
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/unittest/config_manager_gtest.cpp Outdated
Comment thread backup_logs/unittest/backup_engine_gtest.cpp
Copilot AI review requested due to automatic review settings March 22, 2026 12:55
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 79bd4fb
Report detail: https://gist.github.com/rdkcmf-jenkins/0111804d8b45d316690ef02d9f5bd0e1'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: 79bd4fb

Report detail: gist'

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 10 comments.

Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/unittest/special_files_gtest.cpp
Comment thread backup_logs/src/special_files.c
Comment thread backup_logs/src/config_manager.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/unittest/backup_logs_gtest.cpp
Comment thread backup_logs/unittest/config_manager_gtest.cpp Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: b03a9e9
Report detail: https://gist.github.com/rdkcmf-jenkins/4939234a9fa1cb9f247f91ae202458b8'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: b03a9e9

Report detail: gist'

Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Copilot AI review requested due to automatic review settings March 22, 2026 16:04
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 091a1ca
Report detail: https://gist.github.com/rdkcmf-jenkins/f5c40de03f8b59d02020fb8583c5dc15'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: 091a1ca

Report detail: gist'

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 11 comments.

Comment thread backup_logs/src/special_files.c
Comment thread backup_logs/include/config_manager.h Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/unittest/config_manager_gtest.cpp Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/include/backup_engine.h Outdated
Comment thread backup_logs/unittest/backup_engine_gtest.cpp
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/include/sys_integration.h Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: c0bdb0b
Report detail: https://gist.github.com/rdkcmf-jenkins/ff62d023f4619cdf4ae56518b118d60d'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: c0bdb0b

Report detail: gist'

Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_logs.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c Outdated
Comment thread backup_logs/src/special_files.c Outdated
Comment thread backup_logs/src/backup_engine.c Outdated
Copilot AI review requested due to automatic review settings March 23, 2026 10:38
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: d3f85bb
Report detail: https://gist.github.com/rdkcmf-jenkins/01ae93898867675a3e67ad9c4dc0a4b3'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/dcm-agent/100/rdkcentral/dcm-agent

  • Commit: d3f85bb

Report detail: gist'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: f56af55
Report detail: https://gist.github.com/rdkcmf-jenkins/73ee07c1060ee98718364a7a72a17276'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: f56af55
Report detail: https://gist.github.com/rdkcmf-jenkins/b3a01aead8c29e2216ab7487f5007ef8'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: f56af55
Report detail: https://gist.github.com/rdkcmf-jenkins/0d88d34e57bf0f44b246622f5cf31f27'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: f56af55
Report detail: https://gist.github.com/rdkcmf-jenkins/764bae54db12136591f3017536074a1c'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 9b5a1fc
Report detail: https://gist.github.com/rdkcmf-jenkins/20730743e80b8eef7aa9b2c92584fa3f'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 9b5a1fc
Report detail: https://gist.github.com/rdkcmf-jenkins/9ed4435c567698188613f55c80ac2432'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: b37db99
Report detail: https://gist.github.com/rdkcmf-jenkins/a2422635c4c722ec9dc9c424d84b6c1e'

@Abhinavpv28 Abhinavpv28 changed the title Feature/rdk 61009 RDK-61009 : [RDKE] Port Log Backup Scripts to Source code Mar 23, 2026
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Comment thread backup_logs/src/backup_engine.c
Update configure.ac

Create backup_engine.c

Create backup_engine.h

Create backup_logs.c

Add config_load function for backup configuration

Implement configuration loading for backup logs.

Create special_files.c

Add sys_integration.c for systemd notifications

Create backup_logs.h

Create backup_types.h

Create config_manager.h

Create special_files.h

Add sys_integration.h header file with system functions

Add Makefile.am for backup_logs project

Create backup_utils.h

Create backup_utils.c

Update backup_logs.c

Update backup_logs.c

Update backup_logs.c

Update backup_engine.c

Delete backup_logs/src/backup_utils.c

Delete backup_logs/include/backup_utils.h

Update Makefile.am

Remove unused backup_utils.h include

Update config_manager.c

Update config_manager.c

Update config_manager.c

Update special_files.c

Update config_manager.c

Update backup_engine.c

Create special_files.conf

Update backup_logs.c

Update backup_logs.c

Update sys_integration.c

Update backup_logs.c

Update special_files.c

Update backup_logs.h

Update backup_logs.c

Update Makefile.am

Update backup_logs.c

Create configure.ac

Add Makefile.am for unit testing setup

Create special_files_gtest.cpp

Create config_manager_gtest.cpp

Update Makefile.am

Create config_manager_mocks.h

Create backup_logs_gtest.cpp

Create sys_integration_gtest.cpp

Update Makefile.am

Define CPPFLAGS for config_manager_gtest

Added CPPFLAGS for config manager tests with logging levels.

Update Makefile.am

Update backup_logs.c

Update backup_engine.h

Create backup_engine_gtest.cpp

Add backup_engine_gtest to Makefile.am

Update backup_engine.c

Update backup_engine.c

Update log file location to '/tmp/'

Change log file location from '/opt/logs/' to '/tmp/'.

Update config_manager.c

Update backup_engine.c

Check log_path length before building destination path

Update backup_logs.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_engine.c

Update backup_engine.c

Update backup_logs/include/sys_integration.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_logs/include/config_manager.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_engine.c

Update copyright year to 2026

Update backup_logs.c

Update config_manager.c

Update copyright information in special_files.c

Update sys_integration.c

Update backup_engine.h

Update backup_logs.h

Update backup_types.h

Update config_manager.h

Update backup_logs.h

Update backup_types.h

Update special_files.h

Update sys_integration.h

Update backup_engine_gtest.cpp

Revise copyright and license in backup_logs_gtest.cpp

Updated copyright information and license details.

Update config_manager_gtest.cpp

Update special_files_gtest.cpp

Update sys_integration_gtest.cpp

Update copyright year and holder in Makefile.am

Revise copyright and license in Makefile.am

Updated copyright information and license details.

Update configure.ac

Revise copyright and licensing information

Updated copyright information and license details in config_manager_mocks.h.

RDK-61009 : [RDKE] Port Log Backup Scripts to Source code (#95)

* Create backup_logs_requirements.md

* Create backup_logs_migration_HLD.md

* Create backup_logs_LLD.md

* Create backup_logs_flowcharts.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

RDK-60634 [dcm-agent] RDK Coverity Defect Resolution for Device Management (#81)

Co-authored-by: mtirum011 <madhubabu_tirumala@comcast.com>

tr69hostif 2.0.4 release changelog updates

Delete backup_logs/unittest/backup_engine_gtest.cpp

Create backup_engine_gtest.cpp

Update Makefile.am

Update Makefile.am

Clean up EXTRA_DIST in Makefile.am

Removed extra files from distribution in Makefile.am.

Update config_manager_gtest.cpp

Update backup_logs/include/sys_integration.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update sys_integration.h

Create test_backuplog_config_manager.py

Create test_backup_engine.py

Create test_backuplogs_system_integration.py

Create test_backuplogs_special_files.py

Create backup_logs_helper.py

Update backup_logs_helper.py

Update copyright year to 2026 in test_backup_engine.py

Update copyright year in test_backuplogs_special_files.py

Update copyright year in test_backuplog_config_manager.py

Update test_backuplogs_system_integration.py

Create backup_logs_engine.feature

Create backup_logs_config_manager.feature

Create backup_logs_sys_integration.feature

Create backup_logs_special_files.feature

Add tools and skills for agentic development (#102)

* Add tools and skills for agentic development

* Update .github/skills/triage-logs/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/quality-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/technical-documentation-writer/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/platform-portability-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/technical-documentation-writer/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/quality-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_logs.h

Update backup_types.h

Add tools and skills for agentic development (#102)

* Add tools and skills for agentic development

* Update .github/skills/triage-logs/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/quality-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/technical-documentation-writer/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/platform-portability-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/technical-documentation-writer/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/skills/quality-checker/SKILL.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_logs.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_engine_gtest.cpp

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update backup_engine.c

Update special_files.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update Makefile.am

Update Makefile.am
Comment thread test/functional-tests/features/backup_logs_config_manager.feature Outdated
@shibu-kv
shibu-kv merged commit c3159a8 into develop Mar 26, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants