Repository navigation
task: coverity - #244
task: coverity#244jharlow-intel wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical build-tool and Coverity project configuration issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds scheduled/manual Coverity Scan integration for the C/Cython build and a README status badge.
Changes:
- Adds a GitHub Actions workflow for Coverity setup, build capture, and submission.
- Adds a Coverity Scan badge to
README.md.
File summaries
| File | Summary | Review findings |
|---|---|---|
README.md |
Adds the Coverity Scan status badge. | No findings. |
.github/workflows/coverity.yml |
Configures oneMKL installation, Coverity capture, and result submission. | Critical: Install meson-python, ninja, and cmake before the non-isolated build. Critical: Correct COVERITY_PROJECT to the registered project identifier (also on line 151). Nit: Update the outdated setup.py diagnostic comment. |
Review details
Suppressed comments (1)
.github/workflows/coverity.yml:152
- The Coverity upload API selects the project from the
projectquery parameter; passing it only as a multipart form field does not target the registered project. As written, this submission will not be associated withIntelPython/mkl-service; putCOVERITY_PROJECTin the upload URL instead.
--form project="${COVERITY_PROJECT}" \
https://scan.coverity.com/builds
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| COVERITY_PROJECT: IntelPython/mkl-service |
There was a problem hiding this comment.
IntelPython/mkl-service is the registered project name: the heading at https://scan.coverity.com/projects/intelpython-mkl-service reads "Coverity Scan: IntelPython/mkl-service", and intelpython-mkl-service is only the URL slug derived from it. mkl_fft's workflow sends IntelPython/mkl_fft the same way and its weekly scans pass. Kept the value and added a comment explaining the distinction in 9a06323.
| - name: Install build dependencies | ||
| # Cython is pinned here only (not in pyproject.toml) to keep the generated | ||
| # code stable between scans, so Coverity CIDs and their triage survive | ||
| run: pip install "setuptools>=77" "cython==3.3.0" "wheel>=0.45.1" |
There was a problem hiding this comment.
That is a valid point.
mkl-service is currently built using Meson
@jharlow-intel please update it
There was a problem hiding this comment.
Done in 9a06323: the step now runs pip install meson-python ninja cmake "cython==3.3.0" mkl-devel, the same tooling build-with-standard-clang.yml uses, and the oneAPI apt repo / setvars.sh steps are gone. Verified locally on current master in a fresh venv: pip install . --no-build-isolation --no-deps finds MKL through CMake, compiles all three extensions, and the test suite passes.
| # setup.py hard-requires MKLROOT and only raises a bare ValueError if | ||
| # it is unset, so surface what setvars.sh resolved it to. | ||
| echo "MKLROOT=${MKLROOT}" |
There was a problem hiding this comment.
Removed in 9a06323 along with the setvars.sh/MKLROOT lines. The diagnostic note now sits on the install step and describes the real lookup: meson.build's dependency('MKL', method: 'cmake') finds the mkl-devel wheel's CMake config because CMake's find_package searches PATH entries with bin/ stripped as install prefixes.
| - name: Install build dependencies | ||
| # Cython is pinned here only (not in pyproject.toml) to keep the generated | ||
| # code stable between scans, so Coverity CIDs and their triage survive | ||
| run: pip install "setuptools>=77" "cython==3.3.0" "wheel>=0.45.1" |
There was a problem hiding this comment.
That is a valid point.
mkl-service is currently built using Meson
@jharlow-intel please update it
| - name: Install Intel oneMKL | ||
| # Only oneMKL is needed: both conda recipes pin `c_compiler: gcc`, so the | ||
| # shipped packages are gcc builds and that is what Coverity should see. | ||
| # icx is exercised separately by build-with-clang.yml, and pulling the | ||
| # DPC++ compiler in here would analyze a configuration we do not ship. | ||
| timeout-minutes: 25 | ||
| run: sudo apt-get install -y intel-oneapi-mkl-devel |
There was a problem hiding this comment.
Do we need that step?
mkl-devel is already in [build-system].requires and meson.build finds MKL via CMake.
mkl_fft only does pip install mkl-devel in its Coverity workflow
There was a problem hiding this comment.
No, it is not needed. Dropped the apt repo and intel-oneapi-mkl-devel steps in 9a06323; the install step now does pip install ... mkl-devel like mkl_fft.
| source "${ONEAPI_ROOT}/setvars.sh" | ||
| # setup.py hard-requires MKLROOT and only raises a bare ValueError if | ||
| # it is unset, so surface what setvars.sh resolved it to. | ||
| echo "MKLROOT=${MKLROOT}" |
There was a problem hiding this comment.
I think this won't be necessary after you switch to meson
echo "MKLROOT=${MKLROOT}"
There was a problem hiding this comment.
Agreed, removed together with the setvars.sh sourcing in 9a06323.
| # `mkl-service` - Python package for run-time control of Intel® oneAPI Math Kernel Library (oneMKL). | ||
| [](https://github.com/IntelPython/mkl-service/actions/workflows/conda-package.yml) | ||
| [](https://github.com/IntelPython/mkl-service/actions/workflows/build-with-clang.yml) | ||
| [](https://scan.coverity.com/projects/intelpython-mkl-service) |
There was a problem hiding this comment.
Is the path to badge.svg correct?
In mkl_fft the link contains a numeric project ID
[](https://scan.coverity.com/projects/intelpython-mkl_fft)
There was a problem hiding this comment.
Yes, both forms resolve. https://scan.coverity.com/projects/intelpython-mkl-service/badge.svg returns HTTP 200 image/svg+xml and currently renders "coverity | pending" because no build has been uploaded yet. Coverity's embed snippet uses the numeric ID, which is what mkl_fft copied, but the slug form works and matches the link target, so I kept it.
- Install meson-python, ninja, cmake and mkl-devel from PyPI, as the other --no-build-isolation workflows do, instead of the oneAPI apt repo - Drop setvars.sh/MKLROOT; meson.build locates oneMKL through CMake - Refresh comments for the three extensions built by meson.build and document why COVERITY_PROJECT is the owner/repo name, not the URL slug - Pin actions/checkout and actions/setup-python to the SHAs master uses - List the workflow in .github/AGENTS.md
| on: | ||
| schedule: | ||
| - cron: "0 1 * * 1" # Mondays 01:00 UTC; well under the free build quota | ||
| workflow_dispatch: |
There was a problem hiding this comment.
There is no github.ref check, so a run started from a feature branch replaces the master results on the dashboard. Fix: add github.ref == 'refs/heads/master' to the job's if:.
| - name: Setup Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.12" |
There was a problem hiding this comment.
Can we bump python version? Can we use 3.14t?
| # _mkl_memory.c) are genuinely recompiled under cov-build. An editable | ||
| # install reusing a stale build/ would instead yield "No files were | ||
| # emitted", which the upload rejects. | ||
| cov-build --dir cov-int pip install . --no-build-isolation --no-deps 2>&1 | tee cov-build.log |
There was a problem hiding this comment.
Saving cov-build.log and cov-int/build-log.txt as artifacts (if: always()) would make post-merge failures possible to debug.
| - **build_pip.yml** — validates editable build | ||
| - **pre-commit.yml** — code quality checks (flake8, etc.) | ||
| - **openssf-scorecard.yml** — security posture scanning | ||
| - **coverity.yml** — weekly Coverity Scan static analysis of the C/Cython extensions (scan.coverity.com) |
There was a problem hiding this comment.
The root AGENTS.md workflow list also needs a coverity.yml entry.
https://scan.coverity.com/projects/intelpython-mkl-service?tab=overview
adding mkl-service to open-source coverity scanning w/ a github action workflow