Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Component Release

permissions:
contents: write

on:
pull_request:
types: [opened, edited, ready_for_review, closed]
branches:
- develop

jobs:
validate-version:
if: ${{ github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'ready_for_review' }}
runs-on: ubuntu-latest
steps:
- name: Validate PR description version field
env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: |
if ! echo "$PR_DESCRIPTION" | grep -qiE 'version[[:space:]]*:[[:space:]]*(major|minor|patch|none)'; then
echo "[release.yml] ERROR: Pull Request description must include a version field in the format 'version: major|minor|patch|none' (case-insensitive)"
exit 1
fi
echo "[release.yml] INFO: Validation passed: version field found."

dispatch-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Extract PR version field
id: version
env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: |
VERSION_TYPE=$(echo "$PR_DESCRIPTION" | grep -oiP 'version\s*:\s*\K(major|minor|patch|none)' | tr '[:upper:]' '[:lower:]')
if [[ -z "$VERSION_TYPE" ]]; then
echo "[release.yml] ERROR: No version data found in Pull Request description, defaulting to none."
VERSION_TYPE="none"
fi
echo "version_type=$VERSION_TYPE" >> $GITHUB_OUTPUT
echo "[release.yml] INFO: Detected version type: $VERSION_TYPE"

- name: Dispatch release to Device Management Repo
if: steps.version.outputs.version_type != 'none'
env:
VERSION_TYPE: ${{ steps.version.outputs.version_type }}
COMPONENT_REPO: ${{ github.repository }}
run: |
payload=$(jq -n \
--arg version_type "$VERSION_TYPE" \
--arg component_repo "$COMPONENT_REPO" \
'{ref: "main", inputs: {version_type: $version_type, component_repo: $component_repo}}')

curl -X POST \
-H "Authorization: token ${{ secrets.MGMT_REPO_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ secrets.MGMT_REPO }}/actions/workflows/component-release.yml/dispatches \
-d "$payload"
echo "[release.yml] INFO: Dispatched release workflow to management repo with version type: $VERSION_TYPE"
9 changes: 8 additions & 1 deletion c_sourcecode/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ bin_PROGRAMS = crashupload

# Common include directories
AM_CPPFLAGS = -I$(top_srcdir)/common \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/init \
-I$(top_srcdir)/src/config \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/scanner \
-I$(top_srcdir)/src/archive \
-I$(top_srcdir)/src/ratelimit \
-I$(top_srcdir)/src/rfcInterface \
-I$(top_srcdir)/src/rbusInterface \
-I$(top_srcdir)/src/upload \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/utils \
-I${top_srcdir}/src/t2Interface
-I$(top_srcdir)/src/t2Interface

# External library flags
AM_CFLAGS = $(LIBCURL_CFLAGS) $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/archive/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <fcntl.h>
#include "file_utils.h"
#include "telemetryinterface.h"
#include "../utils/logger.h"
#include "logger.h"

// For unit testing: allow static functions to be visible
#ifdef UNIT_TEST
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/archive/archive_crash.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef ARCHIVE_SMART_H
#define ARCHIVE_SMART_H

#include "../../common/types.h"
#include "types.h"
#include <archive.h>
#include <archive_entry.h>
#include <sys/resource.h>
Expand Down
8 changes: 4 additions & 4 deletions c_sourcecode/src/config/config_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
* SKELETON: Implementation needed
*/
#include "config_manager.h"
#include "../../common/errors.h"
#include "../utils/logger.h"
#include "../rfcInterface/rfcinterface.h"
#include "../rbusInterface/rbus_interface.h"
#include "errors.h"
#include "logger.h"
#include "rfcinterface.h"
#include "rbus_interface.h"

#include <stdio.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/config/config_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef CONFIG_MANAGER_H
#define CONFIG_MANAGER_H

#include "../../common/types.h"
#include "types.h"

bool get_opt_out_status(void);
/**
Expand Down
12 changes: 6 additions & 6 deletions c_sourcecode/src/init/system_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/

#include "system_init.h"
#include "../../common/errors.h"
#include "../../common/constants.h"
#include "../config/config_manager.h"
#include "../utils/logger.h"
#include "../platform/platform.h"
#include "../t2Interface/telemetryinterface.h"
#include "errors.h"
#include "constants.h"
#include "config_manager.h"
#include "logger.h"
#include "platform.h"
#include "telemetryinterface.h"
#include <stdio.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/init/system_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef SYSTEM_INIT_H
#define SYSTEM_INIT_H

#include "../../common/types.h"
#include "types.h"

#include <fcntl.h>
#include <sys/stat.h>
Expand Down
24 changes: 12 additions & 12 deletions c_sourcecode/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
* SKELETON: Function bodies need implementation
*/

#include "../common/types.h"
#include "../common/constants.h"
#include "../common/errors.h"
#include "init/system_init.h"
#include "config/config_manager.h"
#include "utils/prerequisites.h"
#include "utils/lock_manager.h"
#include "scanner/scanner.h"
#include "archive/archive_crash.h"
#include "utils/cleanup_batch.h"
#include "utils/logger.h"
#include "types.h"
#include "constants.h"
#include "errors.h"
#include "system_init.h"
#include "config_manager.h"
#include "prerequisites.h"
#include "lock_manager.h"
#include "scanner.h"
#include "archive_crash.h"
#include "cleanup_batch.h"
#include "logger.h"
#include <signal.h>
#include "file_utils.h"
#include "ratelimit.h"
#include "systemutils.h"
#include "upload.h"
#include "t2Interface/telemetryinterface.h"
#include "telemetryinterface.h"

int lock_dir_prefix = 0;

Expand Down
4 changes: 2 additions & 2 deletions c_sourcecode/src/platform/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* SKELETON: Implementation needed
*/
#include "platform.h"
#include "../../common/errors.h"
#include "../utils/logger.h"
#include "errors.h"
#include "logger.h"

/* function NormalizeMac - gets the eSTB MAC address of the device.

Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/platform/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef PLATFORM_H
#define PLATFORM_H

#include "../../common/types.h"
#include "types.h"
#include "rdk_fwdl_utils.h"
#include "system_utils.h"
#include "file_utils.h"
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/ratelimit/ratelimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <fcntl.h>
#include <limits.h>
#include "ratelimit.h"
#include "../utils/logger.h"
#include "logger.h"

int set_time(const char *deny_file, int type)
{
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/rbusInterface/rbus_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include "rbus_interface.h"
#include "../utils/logger.h"
#include "logger.h"

#ifdef RBUS_API_ENABLED
#include "rbus/rbus.h"
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/rfcInterface/rfcinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include "rfcinterface.h"
#include "../utils/logger.h"
#include "logger.h"

#ifndef GTEST_ENABLE
#include "rdk_fwdl_utils.h"
Expand Down
4 changes: 2 additions & 2 deletions c_sourcecode/src/scanner/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#include <errno.h>
#include <time.h>
#include <fnmatch.h>
#include "../../common/types.h"
#include "types.h"
#include "file_utils.h"
#include "scanner.h"
#include "telemetryinterface.h"
#include "../utils/logger.h"
#include "logger.h"

// For unit testing: allow static functions to be visible
#ifdef UNIT_TEST
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/scanner/scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef SCANNER_H
#define SCANNER_H

#include "../../common/types.h"
#include "types.h"
#include <ctype.h>
/**
* @brief Find and sort dump files
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/t2Interface/telemetryinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "telemetryinterface.h"
#include <stdio.h>
#include "../utils/logger.h"
#include "logger.h"

#ifdef T2_EVENT_ENABLED
#include <telemetry_busmessage_sender.h>
Expand Down
4 changes: 2 additions & 2 deletions c_sourcecode/src/upload/upload.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string.h>
#include <curl/curl.h>
#include <time.h>
#include "../rfcInterface/rfcinterface.h"
#include "rfcinterface.h"
#include "upload.h"
#ifndef GTEST_ENABLE
#include "common_device_api.h"
Expand All @@ -30,7 +30,7 @@
#include "ratelimit.h"
#include <unistd.h>
#include "telemetryinterface.h"
#include "../utils/logger.h"
#include "logger.h"

#define MAX_RETRIES 3
#define TIMEOUT_SECONDS 45
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/utils/cleanup_batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <unistd.h>
#include <fnmatch.h>
#include "cleanup_batch.h"
#include "../../common/errors.h"
#include "errors.h"
#include "logger.h"

// For unit testing: allow static functions to be visible
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/utils/cleanup_batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <limits.h>
#include <errno.h>
#include <time.h>
#include "../../common/types.h"
#include "types.h"

/* ---------- File list structure for sorting by mtime ---------- */

Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/utils/prerequisites.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
#include "prerequisites.h"
#include "cleanup_batch.h"
#include "../../common/errors.h"
#include "errors.h"

#include <stdio.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion c_sourcecode/src/utils/prerequisites.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef PREREQUISITES_H
#define PREREQUISITES_H

#include "../../common/types.h"
#include "types.h"
#include "rdk_fwdl_utils.h"
#include "system_utils.h"

Expand Down
13 changes: 8 additions & 5 deletions unittest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ check_PROGRAMS = config_manager_gtest platform_gtest scanner_gtest archive_gtest
# Common include directories
AM_CPPFLAGS = \
-I$(top_srcdir)/../c_sourcecode/src \
-I$(top_srcdir)/../c_sourcecode/src/init \
-I$(top_srcdir)/../c_sourcecode/src/config \
-I$(top_srcdir)/../c_sourcecode/common \
-I$(top_srcdir)/../c_sourcecode/include \
-I$(top_srcdir)/../c_sourcecode/src/utils \
-I$(top_srcdir)/../c_sourcecode/src/platform \
-I$(top_srcdir)/../c_sourcecode/src/scanner \
-I$(top_srcdir)/../c_sourcecode/src/archive \
-I$(top_srcdir)/../c_sourcecode/src/utils \
-I$(top_srcdir)/../c_sourcecode/src/ratelimit \
-I$(top_srcdir)/../c_sourcecode/src/rfcInterface \
-I$(top_srcdir)/../c_sourcecode/src/rbusInterface \
-I$(top_srcdir)/../c_sourcecode/src/upload \
-I$(top_srcdir)/../c_sourcecode/src/t2Interface \
-I$(top_srcdir)/../c_sourcecode/src/utils \
-I$(top_srcdir)/../c_sourcecode/src/t2Interface \
-I$(top_srcdir)/../c_sourcecode/common \
-I$(top_srcdir)/../c_sourcecode/include \
-I/usr/include \
-I/usr/local/include

Expand Down
6 changes: 3 additions & 3 deletions unittest/archive_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
using namespace std;

extern "C" {
#include "../c_sourcecode/src/archive/archive_crash.h"
#include "../c_sourcecode/common/types.h"
#include "../c_sourcecode/common/errors.h"
#include "archive_crash.h"
#include "types.h"
#include "errors.h"

#if 0
// Forward declarations for static functions (with UNIT_TEST flag)
Expand Down
10 changes: 5 additions & 5 deletions unittest/config_manager_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
#include <unistd.h>

extern "C" {
#include "../c_sourcecode/src/config/config_manager.h"
#include "../c_sourcecode/common/types.h"
#include "../c_sourcecode/common/errors.h"
#include "../c_sourcecode/common/constants.h"
#include "config_manager.h"
#include "types.h"
#include "errors.h"
#include "constants.h"

// Mock function declarations
int mock_getIncludePropertyData(const char* param, char* value, int len);
Expand Down Expand Up @@ -712,7 +712,7 @@ TEST_F(ConfigManagerTest, GetPrivacyControlMode_RbusStubBehavior) {
// ============================================================================

extern "C" {
#include "../c_sourcecode/src/rfcInterface/rfcinterface.h"
#include "rfcinterface.h"
}

TEST_F(ConfigManagerTest, WriteRFCProperty_StringType_ReturnsNotApplicable) {
Expand Down
2 changes: 1 addition & 1 deletion unittest/lock_manager_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <sys/wait.h>

extern "C" {
#include "../c_sourcecode/src/utils/lock_manager.h"
#include "lock_manager.h"

// Forward declarations for internal functions not in header
int acquire_process_lock_or_wait(const char *lock_path, int wait_time);
Expand Down
Loading
Loading