Skip to content

Commit 3c7d41d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into rhoai-3.6-ea.1
2 parents 50485be + cd82232 commit 3c7d41d

55 files changed

Lines changed: 830 additions & 814 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/trivy-scan-action/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
trivy-version:
2727
description: 'Version of Trivy to use'
2828
required: false
29-
default: '0.70.0'
29+
default: '0.73.0'
3030
podman-socket:
3131
description: 'Path to Podman socket (required for image scans)'
3232
required: false

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# GitHub image registry used for storing $(CONTAINER_ENGINE)'s cache
6161
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
6262
# https://github.com/aquasecurity/trivy
63-
TRIVY_VERSION: 0.70.0
63+
TRIVY_VERSION: 0.73.0
6464
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
6565
TRIVY_SCAN_FS_JSON: '{}'
6666
# Makefile variables

.github/workflows/code-quality.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,18 @@ jobs:
7878
permissions:
7979
contents: read
8080
packages: read
81+
code-quality: write # upload coverage to GitHub Code Quality
8182
runs-on: ubuntu-26.04
8283
steps:
8384
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8485
with:
8586
persist-credentials: false # https://github.com/actions/checkout/issues/2312
8687
# Full history so tests/test_pylock_downgrade.py can `git show origin/main:…/pylock.toml`.
8788
fetch-depth: 0
89+
# Check out the PR head (not the merge commit) so coverage maps to head.sha, which is
90+
# what upload-code-coverage attributes the report to (matches the action's README
91+
# example). On push, head.sha is empty -> falls back to github.sha (unchanged).
92+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
8893

8994
- name: Login to GitHub Container Registry
9095
if: ${{ github.repository != 'opendatahub-io/notebooks' }}
@@ -142,6 +147,28 @@ jobs:
142147
flags: python
143148
fail_ci_if_error: false
144149

150+
# --- GitHub Code Quality: native code coverage on PRs (complements Codecov) ---
151+
# One-time repo setup: Settings > Security > Code quality > Enable code quality.
152+
# Needs (1) a Cobertura XML report -- coverage.xml, produced above by pytest-cov
153+
# via PYTEST_ADDOPTS -- and (2) code-quality:write, granted on this job's perms.
154+
# Fork PRs and merge_group runs are skipped by the action itself (read-only token).
155+
# Feature docs: https://docs.github.com/en/code-security/code-quality
156+
# Setup guide: https://docs.github.com/en/code-security/how-tos/maintain-quality-code/set-up-code-coverage
157+
# Enable feature: https://docs.github.com/en/code-security/how-tos/maintain-quality-code/enable-code-quality
158+
# Upload action: https://github.com/actions/upload-code-coverage
159+
# NOTE: on push/workflow_dispatch this action interpolates github.ref_name/github.ref into a
160+
# shell run: (upstream script injection: https://github.com/actions/upload-code-coverage/issues/26).
161+
# Only reachable with write access (which already grants CI code execution), so no marginal
162+
# risk here; the fix belongs upstream (pass those values via env:).
163+
- name: Upload Python coverage to GitHub Code Quality
164+
if: ${{ !cancelled() && steps.install-deps.conclusion == 'success' }}
165+
uses: actions/upload-code-coverage@1c15be36fc3733ba839b1dd643bd9556e4426dc1 # v1.4.1
166+
with:
167+
file: coverage.xml
168+
language: Python
169+
label: code-coverage/python
170+
fail-on-error: false # non-blocking, matching the Codecov steps
171+
145172
- name: Upload test results to Codecov
146173
if: ${{ !cancelled() && steps.install-deps.conclusion == 'success' }}
147174
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
@@ -153,8 +180,13 @@ jobs:
153180
runs-on: ubuntu-26.04
154181
permissions:
155182
contents: read
183+
code-quality: write # upload coverage to GitHub Code Quality
156184
steps:
157185
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
186+
with:
187+
persist-credentials: false # don't leave the (code-quality:write) token in .git/config for PR code
188+
# PR head (not the merge commit) so Go coverage maps to head.sha (see pytest-tests note).
189+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
158190

159191
- name: Set up Go
160192
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
@@ -174,6 +206,20 @@ jobs:
174206
run: gotestsum --junitfile=junit-go.xml -- -coverprofile=coverage-go.out -covermode=atomic ./...
175207
working-directory: scripts/buildinputs
176208

209+
- name: Convert Go coverage to Cobertura XML
210+
id: go-cobertura
211+
if: ${{ !cancelled() }}
212+
continue-on-error: true # optional coverage tooling must not fail the go-tests job
213+
# upload-code-coverage only accepts Cobertura; Codecov reads the native .out directly.
214+
# GitHub's documented Go recipe (see the "set-up-code-coverage" guide, language table):
215+
# go test -coverprofile=cover.out && gocover-cobertura < cover.out > coverage.xml
216+
# https://docs.github.com/en/code-security/how-tos/maintain-quality-code/set-up-code-coverage
217+
# https://github.com/boumenot/gocover-cobertura
218+
run: |
219+
go install github.com/boumenot/gocover-cobertura@v1.5.0
220+
"$(go env GOPATH)/bin/gocover-cobertura" < coverage-go.out > coverage-go.xml
221+
working-directory: scripts/buildinputs
222+
177223
- name: Upload Go coverage to Codecov
178224
if: ${{ !cancelled() }}
179225
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
@@ -184,6 +230,16 @@ jobs:
184230
flags: go
185231
fail_ci_if_error: false
186232

233+
# See the upstream-injection note on the Python upload above (github.com/actions/upload-code-coverage/issues/26).
234+
- name: Upload Go coverage to GitHub Code Quality
235+
if: ${{ !cancelled() && steps.go-cobertura.outcome == 'success' }}
236+
uses: actions/upload-code-coverage@1c15be36fc3733ba839b1dd643bd9556e4426dc1 # v1.4.1
237+
with:
238+
file: scripts/buildinputs/coverage-go.xml
239+
language: Go
240+
label: code-coverage/go
241+
fail-on-error: false # non-blocking, matching the Codecov steps
242+
187243
- name: Upload Go test results to Codecov
188244
if: ${{ !cancelled() }}
189245
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1

.github/workflows/security.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ name: Security
55
push:
66
branches:
77
- main
8+
- stable
9+
- 'rhoai-*'
810
pull_request:
11+
schedule:
12+
- cron: '0 5 * * 3'
913
workflow_dispatch:
1014
jobs:
1115
build:
1216
name: Trivy scan (fs)
17+
if: github.event_name != 'schedule'
1318
runs-on: ubuntu-26.04
1419
permissions:
1520
contents: read
@@ -18,6 +23,50 @@ jobs:
1823

1924
- name: Checkout code
2025
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
28+
29+
- name: Trivy scan
30+
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
31+
with:
32+
version: 'v0.73.0'
33+
scan-type: 'fs'
34+
trivy-config: trivy.yaml
35+
format: 'sarif'
36+
output: 'trivy-results.sarif'
37+
exit-code: '0'
38+
39+
- name: Update Security tab
40+
uses: github/codeql-action/upload-sarif@d1ba80a13dd99fba24a470575428917156a28b43 # v4.37.5
41+
with:
42+
sarif_file: 'trivy-results.sarif'
43+
44+
scheduled-scan:
45+
name: Trivy scan (fs) [${{ matrix.ref }}]
46+
# `schedule` only ever fires against the default branch, so a plain cron
47+
# trigger would never re-scan the rhoai-* release branches once they go
48+
# quiet. Sweep the active ones explicitly instead. Those branches only
49+
# exist on the downstream repo, so skip this on forks/upstream.
50+
if: github.event_name == 'schedule' && github.repository == 'red-hat-data-services/notebooks'
51+
runs-on: ubuntu-26.04
52+
permissions:
53+
contents: read
54+
security-events: write
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
ref: [main, rhoai-3.5, rhoai-3.4, rhoai-3.3, rhoai-2.25]
59+
steps:
60+
61+
- name: Checkout code
62+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
63+
with:
64+
ref: ${{ matrix.ref }}
65+
persist-credentials: false
66+
67+
- name: Resolve checked-out commit
68+
id: commit
69+
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
2170

2271
- name: Trivy scan
2372
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
@@ -33,3 +82,8 @@ jobs:
3382
uses: github/codeql-action/upload-sarif@d1ba80a13dd99fba24a470575428917156a28b43 # v4.37.5
3483
with:
3584
sarif_file: 'trivy-results.sarif'
85+
# Required here (unlike the push/pull_request job above): matrix.ref
86+
# points at a branch other than the one that triggered this run, so
87+
# the commit info can't be inferred from github context.
88+
ref: refs/heads/${{ matrix.ref }}
89+
sha: ${{ steps.commit.outputs.sha }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
pass_filenames: false
3131
# https://github.com/astral-sh/ruff-pre-commit
3232
- repo: https://github.com/astral-sh/ruff-pre-commit
33-
rev: v0.15.20
33+
rev: v0.16.2
3434
hooks:
3535
- id: ruff-check
3636
types_or: [python, pyi, jupyter]

base-images/copr/src/copr_rebuild/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class BuildResult(BaseModel):
7777

7878
def main():
7979
"""Generate the JSON schema for the Manifest model."""
80-
import json # noqa: PLC0415
81-
from pathlib import Path # noqa: PLC0415
80+
import json # ruff: ignore[import-outside-top-level]
81+
from pathlib import Path # ruff: ignore[import-outside-top-level]
8282

8383
out = Path(__file__).parent / "manifest_schema.json"
8484
schema = {

base-images/cpu/c9s-python-3.12/Dockerfile.cpu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ARG TARGETARCH
22

3-
FROM quay.io/centos/centos:stream9@sha256:e389f09f8af8baade5be5de6dbf70d8b5975ddc54641858f35552ea3c98ac872 AS buildscripts
3+
FROM quay.io/centos/centos:stream9@sha256:04bad0b08ac68a63b1810ea78a9d2ed4fb431e11d9c4c3916418edd4932856bd AS buildscripts
44
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
55
COPY base-images/utils/fix-permissions base-images/utils/rpm-file-permissions /mnt/usr/bin/
66

77
####################
88
# base #
99
####################
10-
FROM quay.io/centos/centos:stream9@sha256:e389f09f8af8baade5be5de6dbf70d8b5975ddc54641858f35552ea3c98ac872 AS base
10+
FROM quay.io/centos/centos:stream9@sha256:04bad0b08ac68a63b1810ea78a9d2ed4fb431e11d9c4c3916418edd4932856bd AS base
1111

1212
ARG PYTHON_VERSION=3.12
1313
ENV PYTHON=python${PYTHON_VERSION}

base-images/cuda/12.9/c9s-python-3.12/Dockerfile.cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG TARGETARCH
22

3-
FROM quay.io/centos/centos:stream9@sha256:e389f09f8af8baade5be5de6dbf70d8b5975ddc54641858f35552ea3c98ac872 AS buildscripts
3+
FROM quay.io/centos/centos:stream9@sha256:04bad0b08ac68a63b1810ea78a9d2ed4fb431e11d9c4c3916418edd4932856bd AS buildscripts
44
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
55
COPY base-images/utils/fix-permissions /mnt/usr/bin/
66

base-images/cuda/13.0/c9s-python-3.12/Dockerfile.cuda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG TARGETARCH
22

3-
FROM quay.io/centos/centos:stream9@sha256:e389f09f8af8baade5be5de6dbf70d8b5975ddc54641858f35552ea3c98ac872 AS buildscripts
3+
FROM quay.io/centos/centos:stream9@sha256:04bad0b08ac68a63b1810ea78a9d2ed4fb431e11d9c4c3916418edd4932856bd AS buildscripts
44
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
55
COPY base-images/utils/fix-permissions /mnt/usr/bin/
66

base-images/rocm/7.14/c9s-python-3.12/Dockerfile.rocm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG TARGETARCH
22

3-
FROM quay.io/centos/centos:stream9@sha256:e389f09f8af8baade5be5de6dbf70d8b5975ddc54641858f35552ea3c98ac872 AS buildscripts
3+
FROM quay.io/centos/centos:stream9@sha256:04bad0b08ac68a63b1810ea78a9d2ed4fb431e11d9c4c3916418edd4932856bd AS buildscripts
44
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
55
COPY base-images/utils/fix-permissions /mnt/usr/bin/
66

0 commit comments

Comments
 (0)