Skip to content

RDKEMW-14533: MRG - Coverity inclusion changes#92

Closed
PreethiLakshmi91 wants to merge 1 commit into
rdkcentral:developfrom
PreethiLakshmi91:RDKEMW-14533_changes
Closed

RDKEMW-14533: MRG - Coverity inclusion changes#92
PreethiLakshmi91 wants to merge 1 commit into
rdkcentral:developfrom
PreethiLakshmi91:RDKEMW-14533_changes

Conversation

@PreethiLakshmi91
Copy link
Copy Markdown

Reason for change: Crash fix
Test Procedure: Device deepsleep causing the crash
Risks: Low
Priority: P2

Copilot AI review requested due to automatic review settings April 22, 2026 12:00
@PreethiLakshmi91 PreethiLakshmi91 requested a review from a team as a code owner April 22, 2026 12:00
Copy link
Copy Markdown
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 adds a new GitHub Actions workflow intended to build the project on Ubuntu (and, per naming, support a Coverity incremental scan flow).

Changes:

  • Add .github/workflows/native_full_build.yml to run autotools configure/build/install on ubuntu-22.04.
  • Upload the install prefix (output/) as a workflow artifact.

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

LDFLAGS="-L$PREFIX_PATH/lib" \
./configure \
--enable-gstreamer1=yes \
--enable-pi-build=yes \
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This workflow configures without enabling either --enable-rpc or --enable-rbusrpc. In this repo, src/main/Makefile.am only defines btMgrBus_SOURCES inside USE_RPC_IARM / USE_RPC_RBUS conditionals, and configure.ac defaults both conditionals to false when these flags aren’t provided. As-is, the build is likely to fail due to btMgrBus being built with no sources/objects; pass the appropriate enable flag (and install any needed deps) for the intended build variant.

Suggested change
--enable-pi-build=yes \
--enable-pi-build=yes \
--enable-rpc=yes \

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/native_full_build.yml Outdated
Comment on lines +1 to +16
name: BT-Core Coverity Incremental Analysis Scan

on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main

jobs:
native-build:
runs-on: ubuntu-22.04

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Workflow name/PR intent indicates a "Coverity Incremental Analysis Scan", but this workflow only builds and uploads artifacts and contains no Coverity invocation (e.g., cov-build/analysis/upload). Either add the missing Coverity steps or rename the workflow/job/file to match what it actually does to avoid confusion and incorrect CI expectations.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/native_full_build.yml Outdated
uses: actions/upload-artifact@v4
with:
name: bluetooth_mgr-native-build
path: output
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The workflow defines PREFIX_PATH as "${{ github.workspace }}/output", but the artifact upload step hardcodes "path: output". Use the same variable/path in both places so the upload stays correct if PREFIX_PATH changes (and to make the intent clearer).

Suggested change
path: output
path: ${{ env.PREFIX_PATH }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/native_full_build.yml Outdated
Comment on lines +1 to +8
name: BT-Core Coverity Incremental Analysis Scan

on:
push:
branches:
- develop
- main
pull_request:
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

PR description mentions a device deepsleep crash fix and related test procedure, but the only change in this PR is a new GitHub Actions workflow. If the workflow change is the intended fix, the PR description should be updated to reflect that; otherwise the code change(s) for the crash fix appear to be missing from this PR.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +57
- name: Configure
run: |
mkdir -p $PREFIX_PATH
CPPFLAGS="-I$PREFIX_PATH/include -I$PREFIX_PATH/include/cjson" \
LIBCJSON_CFLAGS="-I/usr/include/cjson" \
LDFLAGS="-L$PREFIX_PATH/lib" \
./configure \
--enable-gstreamer1=yes \
--enable-pi-build=yes \
--prefix=$PREFIX_PATH
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This workflow runs ./configure without first providing libbtrCore headers/libs. configure.ac hard-requires libbtrCore (AC_CHECK_LIB(btrCore, ...) will error) and README.txt describes building/installing btcore first and passing LDFLAGS/CPPFLAGS (including -lbtrCore). Add a step to build/install btcore (or install a package providing libbtrCore) and update CPPFLAGS/LDFLAGS accordingly so the workflow can actually configure/build successfully.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 22, 2026 12:18
Copy link
Copy Markdown
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


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

branches:
- develop
- main

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Consider explicitly setting minimal permissions: for this workflow (e.g., contents: read) to follow GitHub Actions least-privilege defaults, especially since this runs on pull_request events.

Suggested change
permissions:
contents: read

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,72 @@
name: BT-Mgr Coverity Incremental Analysis Scan
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

PR description mentions a crash fix (device deepsleep) and Coverity inclusion changes, but this PR only adds a GitHub Actions native build workflow and does not change runtime code. Please update the PR title/description (or include the missing functional changes) so reviewers and release notes accurately reflect the change.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,72 @@
name: BT-Mgr Coverity Incremental Analysis Scan
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

Workflow is named "BT-Mgr Coverity Incremental Analysis Scan", but there are no Coverity steps (no cov-build/cov-analyze, token/secrets, etc.). Either add the actual Coverity analysis steps or rename the workflow/job/file to reflect that it only performs a native build + artifact upload.

Suggested change
name: BT-Mgr Coverity Incremental Analysis Scan
name: BT-Mgr Native Full Build

Copilot uses AI. Check for mistakes.
- name: Prepare autotools
run: |
libtoolize --force
aclocal
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

aclocal is invoked twice back-to-back; the first call is redundant and can also mask the intent to include the m4 macro dir. Consider keeping only the aclocal -I m4 invocation (or use autoreconf -fi if you want the standard one-shot regeneration) to reduce CI time and confusion.

Suggested change
aclocal

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 22, 2026 12:26
Copy link
Copy Markdown
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


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

Comment thread .github/workflows/native_full_build.yml Outdated
Comment on lines +51 to +52
git clone https://github.com/rdkcentral/bluetooth.git

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

git clone https://github.com/rdkcentral/bluetooth.git pulls whatever the current default branch HEAD is, which makes builds non-reproducible and creates a supply-chain risk. Prefer pinning to a specific tag/commit, or (as other workflows here do) attempting to checkout the same branch as the PR/commit (with a fallback if the branch doesn’t exist). Also consider --depth 1 to avoid cloning full history.

Suggested change
git clone https://github.com/rdkcentral/bluetooth.git
BTRCORE_REPO="https://github.com/rdkcentral/bluetooth.git"
BTRCORE_BRANCH="${{ github.head_ref || github.ref_name }}"
BTRCORE_FALLBACK_BRANCH="main"
if git ls-remote --exit-code --heads "$BTRCORE_REPO" "$BTRCORE_BRANCH" >/dev/null 2>&1; then
git clone --depth 1 --branch "$BTRCORE_BRANCH" "$BTRCORE_REPO"
else
git clone --depth 1 --branch "$BTRCORE_FALLBACK_BRANCH" "$BTRCORE_REPO"
fi

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings May 14, 2026 07:25
Copy link
Copy Markdown
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

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

Comments suppressed due to low confidence (4)

cov_build.sh:21

  • cov_build.sh runs cmake .. from inside cov_build/, but this repo has no CMakeLists.txt — it's an Autotools project (configure.ac, Makefile.am). Both the Coverity branch and the fallback branch will fail. The script needs to use autotools (autoreconf -i && ../configure && make) for both the Coverity and fallback paths.
# If Coverity is available, use real cov-build
if command -v cov-build >/dev/null 2>&1; then
    echo "Coverity detected, running real analysis..."
    cov-build --dir cov-int cmake ..
    cov-build --dir cov-int make -j$(nproc)
else
    echo "Coverity not installed. Running normal build as fallback..."
    cmake ..
    make -j$(nproc)
fi

cov_build.sh:16

  • Calling cov-build twice with the same --dir cov-int for separate cmake and make invocations is not the standard Coverity usage. Typically you invoke cov-build --dir cov-int once around the actual compilation command (e.g. the make step), since cov-build intercepts compiler invocations. Wrapping cmake (a configuration step that runs no compilers) provides no value, and running two separate cov-build invocations into the same directory can produce inconsistent intermediate state. Consider running configuration normally and then a single cov-build --dir cov-int make -j$(nproc).
    cov-build --dir cov-int cmake ..
    cov-build --dir cov-int make -j$(nproc)

build_dependencies.sh:11

  • Using sudo inside a script that's also invoked from a GitHub Actions workflow (which already runs apt-get with sudo) is inconsistent and prevents the script from being used in container environments where sudo may not exist. Consider dropping sudo from this script and letting the caller decide, or detecting whether sudo is needed.
sudo apt-get update

# Install core dependencies
sudo apt-get install -y \

cov_build.sh:21

  • The job name and step descriptions advertise this as a "Coverity-style" static analysis run, but the script falls back silently to a plain make build when cov-build is not on PATH (which it never will be on a stock ubuntu-22.04 runner without a separately installed Coverity toolchain). The CI will report success without performing any static analysis, giving a false sense of coverage. Either install/set up Coverity in the workflow or fail the step explicitly when cov-build is unavailable.
else
    echo "Coverity not installed. Running normal build as fallback..."
    cmake ..
    make -j$(nproc)
fi

Comment thread build_dependencies.sh
Comment on lines +7 to +21
# Update system
sudo apt-get update

# Install core dependencies
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
git \
wget \
libglib2.0-dev \
libbluetooth-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev

Comment thread .github/workflows/native_full_build.yml Outdated
Comment on lines +39 to +55
- name: Build bluetooth_mgr
run: |
mkdir -p build
cd build
cmake ..
make -j$(nproc)

- name: Run Static Analysis (Coverity-style mock)
run: |
chmod +x cov_build.sh
./cov_build.sh

- name: Archive Build Artifacts
uses: actions/upload-artifact@v4
with:
name: bluetooth-mgr-build
path: build/
Comment thread cov_build.sh
Comment on lines +8 to +20
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}

# If Coverity is available, use real cov-build
if command -v cov-build >/dev/null 2>&1; then
echo "Coverity detected, running real analysis..."
cov-build --dir cov-int cmake ..
cov-build --dir cov-int make -j$(nproc)
else
echo "Coverity not installed. Running normal build as fallback..."
cmake ..
make -j$(nproc)
Reason for change: Crash fix
Test Procedure: Device deepsleep causing the crash
Risks: Low
Priority: P2

Signed-off-by: ppalan289 <preethi_palanisamy@comcast.com>
Copilot AI review requested due to automatic review settings May 14, 2026 07:53
Copy link
Copy Markdown
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (2)

.github/workflows/native_full_build.yml:60

  • The workflow is named "BT-Mgr Coverity Incremental Analysis Scan", but no Coverity step is actually executed here — the job only installs dependencies, runs autotools, configure, and make. There is no cov-build, no cov-analyze, no upload to Coverity Scan, and cov_build.sh (added in this same PR) is not invoked. Either rename the workflow to reflect that it is a plain native build, or add the actual Coverity analysis/upload steps so the name matches the behavior.
name: BT-Mgr Coverity Incremental Analysis Scan

on:
  push:
    branches:
      - develop
  pull_request:
    branches:
      - develop

jobs:
  native-build:
    runs-on: ubuntu-22.04

    env:
      PREFIX_PATH: ${{ github.workspace }}/output

    steps:
      - name: Checkout source
        uses: actions/checkout@v4

      - name: Install build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            build-essential \
            autoconf \
            automake \
            libtool \
            pkg-config \
            libunwind-dev \
            libglib2.0-dev \
            libdbus-1-dev \
            libgstreamer1.0-dev \
            libgstreamer-plugins-base1.0-dev \
            libbluetooth-dev \
            libcjson-dev

      - name: Prepare autotools
        run: |
          libtoolize --force
          aclocal
          aclocal -I m4
          automake --force-missing --add-missing
          autoconf

      - name: Configure
        run: |
          mkdir -p $PREFIX_PATH
          CPPFLAGS="-I$PREFIX_PATH/include -I$PREFIX_PATH/include/cjson" \
          LIBCJSON_CFLAGS="-I/usr/include/cjson" \
          LDFLAGS="-L$PREFIX_PATH/lib" \
          ./configure \
            --enable-gstreamer1=yes \
            --enable-pi-build=yes \
            --prefix=$PREFIX_PATH

      - name: Build
        run: |
          make -j$(nproc)

.github/workflows/native_full_build.yml:1

  • The workflow file is named native_full_build.yml but the workflow's name: is "BT-Mgr Coverity Incremental Analysis Scan". The filename and the displayed workflow name describe two different things (native build vs. Coverity incremental analysis). Pick one purpose and align the filename, the name: field, and the actual steps.
name: BT-Mgr Coverity Incremental Analysis Scan

@@ -0,0 +1,60 @@
name: BT-Mgr Coverity Incremental Analysis Scan
Comment thread cov_build.sh
Comment on lines +13 to +21
if command -v cov-build >/dev/null 2>&1; then
echo "Coverity detected, running real analysis..."
cov-build --dir cov-int cmake ..
cov-build --dir cov-int make -j$(nproc)
else
echo "Coverity not installed. Running normal build as fallback..."
cmake ..
make -j$(nproc)
fi
Comment thread cov_build.sh
Comment on lines +12 to +19
# If Coverity is available, use real cov-build
if command -v cov-build >/dev/null 2>&1; then
echo "Coverity detected, running real analysis..."
cov-build --dir cov-int cmake ..
cov-build --dir cov-int make -j$(nproc)
else
echo "Coverity not installed. Running normal build as fallback..."
cmake ..
Comment thread cov_build.sh
Comment on lines +8 to +10
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}
Comment thread build_dependencies.sh
Comment on lines +11 to +23
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
git \
wget \
libglib2.0-dev \
libbluetooth-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
python3 \
python3-pip \
lcov
Comment thread build_dependencies.sh
Comment on lines +5 to +11
echo "===== Installing bluetooth_mgr dependencies ====="

# Update system
sudo apt-get update

# Install core dependencies
sudo apt-get install -y \
Comment thread cov_build.sh
Comment on lines +1 to +23
#!/bin/bash

set -e

echo "===== Starting Coverity-like Build ====="

BUILD_DIR="cov_build"
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}
cd ${BUILD_DIR}

# If Coverity is available, use real cov-build
if command -v cov-build >/dev/null 2>&1; then
echo "Coverity detected, running real analysis..."
cov-build --dir cov-int cmake ..
cov-build --dir cov-int make -j$(nproc)
else
echo "Coverity not installed. Running normal build as fallback..."
cmake ..
make -j$(nproc)
fi

echo "===== Build Completed ====="
Comment on lines +41 to +45
libtoolize --force
aclocal
aclocal -I m4
automake --force-missing --add-missing
autoconf
@PreethiLakshmi91 PreethiLakshmi91 closed this by deleting the head repository May 15, 2026
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.

3 participants