-
Notifications
You must be signed in to change notification settings - Fork 3
Main: update develop to latest. #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
21d364f
feat: add Coverity static analysis workflows and local dev tooling [R…
83f5ef3
Potential fix for pull request finding 'CodeQL / Code injection'
brendanobra 6f40028
Potential fix for pull request finding 'CodeQL / Workflow does not co…
brendanobra cfa71ca
Update coverity_local.sh
brendanobra d0afb58
Potential fix for pull request finding 'CodeQL / Workflow does not co…
brendanobra 1c6ad10
Potential fix for pull request finding 'CodeQL / Workflow does not co…
brendanobra 4f9c345
Update .github/workflows/native_full_build.yml
brendanobra 750934c
Update .github/workflows/coverity_component_full_scan.yml
brendanobra 89a339f
Fix incremental workflow PR feedback step gating
Copilot 66f6d4f
Potential fix for pull request finding 'CodeQL / Workflow does not co…
brendanobra dfe89d1
Potential fix for pull request finding 'CodeQL / Workflow does not co…
brendanobra 4f84181
Ensure Coverity full scan has config directory
Copilot 5f82519
Update .github/workflows/coverity_incremental_scan.yml
brendanobra d8e278d
Fix dispatch changeset logic and quote Coverity build command
Copilot 696bd31
Harden incremental changeset input parsing
Copilot fb6082b
Simplify incremental file-status filter
Copilot f637faa
Fix coverity_local usage examples for bash script
Copilot 5f51706
Address remaining feedback from review thread 4158491490
Copilot c05cf8b
Fix gcovr install compatibility across pip versions
Copilot 9e4abab
Merge branch 'main' into topic/RDKEMW-14544
brendanobra cf00cc8
Merge pull request #85 from rdkcentral/topic/RDKEMW-14544
brendanobra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --container-architecture linux/amd64 | ||
| -W .github/workflows/native_full_build.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Coverity Full Analysis Scan | ||
|
|
||
| # Reusable workflow — called by coverity_full_scan.yml. | ||
| # Runs a full cov-build + cov-analyze + cov-commit-defects cycle. | ||
| # Results are committed to the Coverity Connect server stream only; | ||
| # nothing is posted back to any pull request. | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| buildCommand: | ||
| description: 'Build Command' | ||
| required: true | ||
| type: string | ||
| branchName: | ||
| description: 'Branch Name' | ||
| required: true | ||
| type: string | ||
| customSetup: | ||
| description: 'Custom setup commands' | ||
| required: false | ||
| type: string | ||
| secrets: | ||
| COVERITY_APIKEY: | ||
| required: true | ||
| ARTIFACTORY_USER_APIKEY: | ||
| required: true | ||
| # GITHUB_TOKENCM: cross-org token — required if customSetup clones private repos | ||
| GITHUB_TOKENCM: | ||
| required: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| coverity_full_scan: | ||
| runs-on: comcast-ubuntu-latest | ||
| container: | ||
| # TODO (org admin): provision vars.DOCKER_REGISTRY in rdkcentral org | ||
| image: ${{ vars.DOCKER_REGISTRY }}/rdk-docker/docker-rdk-coverity:1.0.7 | ||
| credentials: | ||
| # TODO (org admin): provision vars.ARTIFACTORY_USER in rdkcentral org | ||
| username: ${{ vars.ARTIFACTORY_USER }} | ||
| password: ${{ secrets.ARTIFACTORY_USER_APIKEY }} | ||
|
|
||
| env: | ||
| # TODO (org admin): provision vars.COVERITY_URL and vars.COVERITY_USER in rdkcentral org | ||
| COVERITY_URL: ${{ vars.COVERITY_URL }} | ||
| COVERITY_USER: ${{ vars.COVERITY_USER }} | ||
| COVERITY_APIKEY: ${{ secrets.COVERITY_APIKEY }} | ||
| COVERITY_PROJECT_NAME: ${{ github.event.repository.name }} | ||
| COVERITY_STREAM_NAME: ${{ github.event.repository.name }}_${{ inputs.branchName }} | ||
| BUILD_COMMAND: ${{ inputs.buildCommand }} | ||
| GITHUB_TOKENCM: ${{ secrets.GITHUB_TOKENCM }} | ||
| COVERITY_UNSUPPORTED_COMPILER_INVOCATION: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Custom setup | ||
| if: ${{ inputs.customSetup }} | ||
| run: eval "${{ inputs.customSetup }}" | ||
|
brendanobra marked this conversation as resolved.
|
||
|
|
||
| - name: Coverity Full Analysis Scan | ||
| run: | | ||
| export PATH=$PATH:/opt/coverity/bin | ||
| set -x | ||
| cd $GITHUB_WORKSPACE | ||
| mkdir -p config | ||
| cov-configure --gcc | ||
| cov-build --dir coverity_dir $BUILD_COMMAND | ||
| cov-analyze --dir coverity_dir --one-tu-per-psf false --disable-spotbugs --aggressiveness-level low --enable DC.STRING_BUFFER --all | ||
|
|
||
| max_retries=3 | ||
| retries=0 | ||
| retry_timeout_sec=30 | ||
| success=false | ||
| while [ $retries -lt $max_retries ]; do | ||
| echo "Attempt $((retries + 1)) of $max_retries for cov-commit-defects" | ||
| if cov-commit-defects --dir coverity_dir --stream $COVERITY_STREAM_NAME \ | ||
| --url $COVERITY_URL --user $COVERITY_USER --password $COVERITY_APIKEY; then | ||
| success=true | ||
| break | ||
| fi | ||
| retries=$((retries + 1)) | ||
| sleep $((retries * retry_timeout_sec)) | ||
| done | ||
| $success || { echo "cov-commit-defects failed after $max_retries attempts"; exit 1; } | ||
136 changes: 136 additions & 0 deletions
136
.github/workflows/coverity_component_incremental_scan.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| name: Coverity Incremental Analysis Scan | ||
|
|
||
| # Reusable workflow — called by coverity_incremental_scan.yml. | ||
| # Runs cov-run-desktop against changed files only and posts findings | ||
| # as pull request comments via synopsys-sig/coverity-report-output-v7-json. | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| pullRequestNumber: | ||
| description: 'Pull Request Number' | ||
| required: true | ||
| type: string | ||
| buildCommand: | ||
| description: 'Build Command' | ||
| required: true | ||
| type: string | ||
| branchName: | ||
| description: 'Branch Name (target/base branch)' | ||
| required: true | ||
| type: string | ||
| customSetup: | ||
| description: 'Custom setup commands' | ||
| required: false | ||
| type: string | ||
| secrets: | ||
| COVERITY_APIKEY: | ||
| required: true | ||
| ARTIFACTORY_USER_APIKEY: | ||
| required: true | ||
| # GITHUB_TOKEN: used to post PR feedback comments | ||
| GITHUB_TOKEN: | ||
| required: true | ||
| # GITHUB_TOKENCM: cross-org token — required if customSetup clones private repos | ||
| GITHUB_TOKENCM: | ||
| required: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| coverity_incremental_scan: | ||
| runs-on: comcast-ubuntu-latest | ||
| container: | ||
| # TODO (org admin): provision vars.DOCKER_REGISTRY in rdkcentral org | ||
| image: ${{ vars.DOCKER_REGISTRY }}/rdk-docker/docker-rdk-coverity:1.0.7 | ||
| credentials: | ||
| # TODO (org admin): provision vars.ARTIFACTORY_USER in rdkcentral org | ||
| username: ${{ vars.ARTIFACTORY_USER }} | ||
| password: ${{ secrets.ARTIFACTORY_USER_APIKEY }} | ||
|
brendanobra marked this conversation as resolved.
|
||
|
|
||
| env: | ||
| # TODO (org admin): provision vars.COVERITY_URL and vars.COVERITY_USER in rdkcentral org | ||
| COVERITY_URL: ${{ vars.COVERITY_URL }} | ||
| COVERITY_USER: ${{ vars.COVERITY_USER }} | ||
| COVERITY_APIKEY: ${{ secrets.COVERITY_APIKEY }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| COVERITY_PROJECT_NAME: ${{ github.event.repository.name }} | ||
| COVERITY_STREAM_NAME: ${{ github.event.repository.name }}_${{ inputs.branchName }} | ||
| BUILD_COMMAND: ${{ inputs.buildCommand }} | ||
| COVERITY_UNSUPPORTED_COMPILER_INVOCATION: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ format('refs/pull/{0}/merge', inputs.pullRequestNumber) }} | ||
|
|
||
| - name: Custom setup | ||
| if: ${{ inputs.customSetup }} | ||
| run: | | ||
| echo "customSetup: ${{ inputs.customSetup }}" | ||
| eval "${{ inputs.customSetup }}" | ||
|
|
||
|
brendanobra marked this conversation as resolved.
|
||
| - name: Get Pull Request Changeset | ||
| id: changeset | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const pull_number = Number(${{ toJSON(inputs.pullRequestNumber) }}); | ||
| if (!Number.isInteger(pull_number) || pull_number <= 0) { | ||
| core.setFailed('Invalid pullRequestNumber input.'); | ||
| return; | ||
| } | ||
| const files = await github.paginate(github.rest.pulls.listFiles, { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number, | ||
| per_page: 100 | ||
| }); | ||
| const addedModified = files | ||
| .filter((file) => ['added', 'modified', 'renamed'].includes(file.status)) | ||
|
brendanobra marked this conversation as resolved.
|
||
| .map((file) => file.filename) | ||
| .join('\n'); | ||
| core.setOutput('added_modified', addedModified); | ||
|
|
||
| - name: Coverity Incremental Analysis Scan | ||
| id: incremental_scan | ||
| if: ${{ steps.changeset.outputs.added_modified != '' }} | ||
| env: | ||
| CHANGED_FILES_RAW: ${{ steps.changeset.outputs.added_modified }} | ||
| run: | | ||
| export PATH=$PATH:/opt/coverity/bin | ||
| set -x | ||
| cd $GITHUB_WORKSPACE | ||
| echo "Changed files: $CHANGED_FILES_RAW" | ||
| mapfile -t changed_files <<< "$CHANGED_FILES_RAW" | ||
| # Phase 1: capture build into the coverity_dir intermediate database | ||
| cov-run-desktop --dir coverity_dir \ | ||
| --url $COVERITY_URL --user $COVERITY_USER --password $COVERITY_APIKEY \ | ||
| --stream $COVERITY_STREAM_NAME \ | ||
| --build "$BUILD_COMMAND" | ||
| # Phase 2: analyze changed files only, compare against stream baseline | ||
| # --exit1-if-defects true: workflow fails on new defects (maintainers can bypass | ||
| # via GitHub branch protection "Allow specified actors to bypass required pull requests") | ||
| cov-run-desktop --dir coverity_dir \ | ||
| --url $COVERITY_URL --user $COVERITY_USER --password $COVERITY_APIKEY \ | ||
| --stream $COVERITY_STREAM_NAME \ | ||
| --present-in-reference false \ | ||
| --ignore-uncapturable-inputs true \ | ||
| --exit1-if-defects true \ | ||
| --json-output-v7 coverity_dir/coverity-results.json \ | ||
| --allow-suffix-match --set-new-defect-owner false \ | ||
| "${changed_files[@]}" | ||
|
|
||
| # Post findings as PR comments — raw Coverity output, no custom formatting | ||
| - name: Coverity Pull Request Feedback | ||
| if: ${{ always() && hashFiles('coverity_dir/coverity-results.json') != '' }} | ||
| uses: synopsys-sig/coverity-report-output-v7-json@v0.1.1 | ||
| with: | ||
| json-file-path: coverity_dir/coverity-results.json | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| coverity-url: ${{ vars.COVERITY_URL }} | ||
| coverity-project-name: ${{ github.event.repository.name }} | ||
| coverity-username: ${{ vars.COVERITY_USER }} | ||
| coverity-password: ${{ secrets.COVERITY_APIKEY }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Coverity Full Scan | ||
|
|
||
| # Triggers on merges to primary branches. | ||
| # Results committed to Coverity Connect server (maintainer-only access). | ||
| # Nothing is posted back to any pull request. | ||
| on: | ||
| push: | ||
| branches: [ main, develop, '+([0-9])\.+([0-9])\.x-maintenance' ] | ||
| paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| call-coverity-full-scan: | ||
| uses: ./.github/workflows/coverity_component_full_scan.yml | ||
| with: | ||
| branchName: ${{ github.ref_name }} | ||
| buildCommand: sh cov_build.sh | ||
| customSetup: sh build_dependencies.sh | ||
| secrets: | ||
| COVERITY_APIKEY: ${{ secrets.COVERITY_APIKEY }} | ||
| ARTIFACTORY_USER_APIKEY: ${{ secrets.ARTIFACTORY_USER_APIKEY }} | ||
| GITHUB_TOKENCM: ${{ secrets.RDKCM_RDKE }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Coverity Incremental Scan | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| # Triggers on pull requests targeting primary branches. | ||
| # Scans only changed compilable source files. | ||
| # Findings are posted as pull request comments. | ||
| # Merges are not blocked outright — maintainers can bypass via branch protection. | ||
| on: | ||
| pull_request: | ||
| branches: [ main, develop, '+([0-9])\.+([0-9])\.x-maintenance' ] | ||
| paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp'] | ||
| workflow_dispatch: | ||
| inputs: | ||
| pullRequestNumber: | ||
| description: 'Pull Request Number' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| call-coverity-incremental-scan: | ||
| uses: ./.github/workflows/coverity_component_incremental_scan.yml | ||
| with: | ||
| pullRequestNumber: ${{ github.event.inputs.pullRequestNumber || github.event.pull_request.number }} | ||
| branchName: ${{ github.event.pull_request.base.ref || github.ref_name }} | ||
| buildCommand: sh cov_build.sh | ||
| customSetup: sh build_dependencies.sh | ||
| secrets: | ||
| COVERITY_APIKEY: ${{ secrets.COVERITY_APIKEY }} | ||
| ARTIFACTORY_USER_APIKEY: ${{ secrets.ARTIFACTORY_USER_APIKEY }} | ||
| GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} | ||
| GITHUB_TOKENCM: ${{ secrets.RDKCM_RDKE }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Build Component in Native Environment | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, '+([0-9])\.+([0-9])\.x-maintenance' ] | ||
| paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp', 'CMakeLists.txt', 'cmake/**', 'build_dependencies.sh', 'cov_build.sh'] | ||
| pull_request: | ||
| branches: [ main, '+([0-9])\.+([0-9])\.x-maintenance' ] | ||
| paths: ['**/*.c', '**/*.cpp', '**/*.cc', '**/*.cxx', '**/*.h', '**/*.hpp', 'CMakeLists.txt', 'cmake/**', 'build_dependencies.sh', 'cov_build.sh'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| native-build: | ||
| name: Build firebolt-cpp-transport in native environment | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/rdkcentral/docker-rdk-ci:latest | ||
|
brendanobra marked this conversation as resolved.
|
||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install build dependencies | ||
| run: sh -x build_dependencies.sh | ||
|
|
||
| - name: Build | ||
| run: sh -x cov_build.sh | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} | ||
|
brendanobra marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.