Skip to content

Commit 33e1adc

Browse files
authored
Merge branch 'opendatahub-io:main' into main
2 parents d24d6d2 + 6d75d55 commit 33e1adc

83 files changed

Lines changed: 3329 additions & 1981 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.

.coderabbit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ reviews:
77
request_changes_workflow: false
88
high_level_summary: true
99
high_level_summary_placeholder: '@coderabbitai summary'
10-
high_level_summary_in_walkthrough: true
10+
high_level_summary_in_walkthrough: false
1111
auto_title_placeholder: '@coderabbitai'
1212
auto_title_instructions: ''
1313
review_status: true
@@ -25,7 +25,7 @@ reviews:
2525
auto_assign_reviewers: false
2626
poem: false
2727
labeling_instructions: []
28-
path_filters: []
28+
path_filters: ["!.github/**"]
2929
path_instructions: []
3030
abort_on_close: true
3131
disable_cache: false

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@
99

1010
# Global rule:
1111
* @opendatahub-io/opendatahub-tests-contributors
12+
13+
# Test directory specific rules
14+
tests/model_explainability/ @adolfo-ab @sheltoncyril
15+
tests/model_registry/ @dbasunag @lugi0 @fege
16+
tests/model_serving/ @mwaykole @Raghul-M
17+
tests/rag/ @jgarciao @jiripetrlik
18+
tests/workbenches @jstourac @andyatmiami

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,6 @@ cython_debug/
169169

170170
# AI Assistant Config Files
171171
CLAUDE.md
172+
173+
# Must-Gather Artifacts
174+
must-gather-collected/

.pre-commit-config.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ minimum_pre_commit_version: 3.3.0
22
default_install_hook_types: [pre-commit, commit-msg]
33

44
default_language_version:
5-
python: python3.12
5+
python: python3.13
66

77
repos:
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: "v5.0.0"
9+
rev: "v6.0.0"
1010
hooks:
1111
- id: check-merge-conflict
1212
- id: debug-statements
@@ -36,7 +36,7 @@ repos:
3636
exclude: .*/__snapshots__/.*|.*-input\.json$
3737

3838
- repo: https://github.com/astral-sh/ruff-pre-commit
39-
rev: v0.12.7
39+
rev: v0.12.10
4040
hooks:
4141
- id: ruff
4242
- id: ruff-format
@@ -70,3 +70,10 @@ repos:
7070
args:
7171
- --subject-min-length=10
7272
- --subject-max-length=80
73+
- repo: local
74+
hooks:
75+
- id: check-prohibited-patterns
76+
name: Check for prohibited code patterns
77+
entry: python scripts/check_incorrect_wrapper_usage.py
78+
language: python
79+
pass_filenames: false

Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13
1+
FROM fedora:42
22

33
ARG USER=odh
44
ARG HOME=/home/$USER
@@ -11,18 +11,17 @@ ENV UV_NO_CACHE=1
1111
ENV BIN_DIR="$HOME_DIR/.local/bin"
1212
ENV PATH="$PATH:$BIN_DIR"
1313

14-
RUN apt-get update \
15-
&& apt-get install -y ssh gnupg software-properties-common curl gpg wget vim apache2-utils rsync\
16-
&& apt-get clean autoclean \
17-
&& apt-get autoremove --yes \
18-
&& rm -rf /var/lib/{apt,dpkg,cache,log}/
14+
# Install Python 3.13 and other dependencies using dnf
15+
RUN dnf update -y \
16+
&& dnf install -y python3.13 python3.13-pip ssh gnupg curl gpg wget vim httpd-tools rsync openssl openssl-devel\
17+
&& dnf clean all \
18+
&& rm -rf /var/cache/dnf
1919

2020
# Install grpcurl
21-
RUN curl -sSL "https://github.com/fullstorydev/grpcurl/releases/download/v1.9.2/grpcurl_1.9.2_linux_x86_64.tar.gz" --output /tmp/grpcurl_1.2.tar.gz \
21+
RUN curl -sSL "https://github.com/fullstorydev/grpcurl/releases/download/v1.9.2/grpcurl_1.9.2_linux_x86_64.tar.gz" --output /tmp/grpcurl_1.2.tar.gz \
2222
&& tar xvf /tmp/grpcurl_1.2.tar.gz --no-same-owner \
2323
&& mv grpcurl /usr/bin/grpcurl
2424

25-
2625
RUN useradd -ms /bin/bash $USER
2726
USER $USER
2827
WORKDIR $HOME_DIR

docs/DEVELOPER_GUIDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ The project utilizes [openshift-python-wrapper](https://github.com/RedHatQE/open
6666
Please refer to the [documentation](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/README.md)
6767
and the [examples](https://github.com/RedHatQE/openshift-python-wrapper/tree/main/examples) for more information.
6868

69+
For any missing resources, please generate a new resource using
70+
[class_generator tool](https://github.com/RedHatQE/openshift-python-wrapper/blob/main/class_generator/README.md) and
71+
create a PR against wrapper. Calls to cluster resources from tests, utils and fixtures must always use
72+
openshift-python-wrapper resource or oc command
73+
(when wrapper resource is not relevant. e.g. must-gather generation)
74+
6975

7076
## Conftest
7177
- Top level [conftest.py](../conftest.py) contains pytest native fixtures.

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ markers =
1818
fuzzer: Mark tests that use fuzzing and are probably going to generate unanticipated failures.
1919
ocp_interop: Interop testing with Openshift.
2020
downstream_only: Tests that are specific to downstream
21+
cluster_health: Tests that verifies that cluster is healthy to begin testing
2122

2223
# Model server
2324
modelmesh: Mark tests which are model mesh tests

renovate.json

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
":dependencyDashboard",
4+
"config:recommended",
5+
":dependencyDashboardApproval",
56
":maintainLockFilesWeekly",
67
":prHourlyLimitNone"
78
],
@@ -10,10 +11,29 @@
1011
"enabled": true
1112
},
1213
"baseBranches": ["main"],
14+
"recreateWhen": "never",
15+
"timezone": "America/New_York",
1316
"packageRules": [
1417
{
15-
"matchPackagePatterns": ["*"],
16-
"groupName": "python-dependencies"
17-
}
18+
"groupName": "Python dependencies (minor and patch)",
19+
"matchUpdateTypes": ["minor", "patch"],
20+
"matchFileNames": ["pyproject.toml"],
21+
"schedule": ["before 7am on monday"],
22+
"prPriority": 7
23+
},
24+
{
25+
"groupName": "Python dependencies (major)",
26+
"matchUpdateTypes": ["major"],
27+
"matchFileNames": ["pyproject.toml"],
28+
"schedule": ["after 7pm on thursday"],
29+
"prPriority": 10
30+
},
31+
{
32+
"groupName": "GitHub Actions",
33+
"matchManagers": ["github-actions"],
34+
"matchFileNames": [".github/workflows/**"],
35+
"schedule": ["before 6pm on wednesday"],
36+
"prPriority": 5
37+
}
1838
]
1939
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# We use wrapper library to interact with openshift cluster kinds.
2+
# This script looks for calls bypassing wrapper library: https://github.com/RedHatQE/openshift-python-wrapper/
3+
# created with help from claude
4+
import os
5+
import re
6+
import sys
7+
from pathlib import Path
8+
9+
PROHIBITED_PATTERNS = [
10+
r"\.get\((.*)api_version=(.*),\)",
11+
r"\.resources\.get\((.*)kind=(.*),\)",
12+
r"client\.resources\.get(.*)kind=(.*)",
13+
]
14+
KIND_PATTERN = r'kind="(.*)"'
15+
16+
17+
def find_all_python_files(root_dir: Path) -> list[str]:
18+
skip_folders = {".tox", "venv", ".pytest_cache", "site-packages", ".git", ".local"}
19+
20+
py_files = [
21+
file_name
22+
for file_name in Path(os.path.abspath(root_dir)).rglob("*.py")
23+
if not any(any(folder_name in part for folder_name in skip_folders) for part in file_name.parts)
24+
]
25+
return [str(file_name) for file_name in py_files]
26+
27+
28+
def check_file_for_violations(filepath: str) -> dict[str, set[str]]:
29+
with open(filepath, "r") as f:
30+
content = f.read()
31+
violations = set()
32+
kinds = set()
33+
for line_num, line in enumerate(content.split("\n"), 1):
34+
line = line.strip()
35+
for pattern in PROHIBITED_PATTERNS:
36+
if re.search(pattern, line):
37+
kind_match = re.search(KIND_PATTERN, line)
38+
if kind_match:
39+
kinds.add(kind_match.group(1))
40+
violation_str = f"{filepath}:{line_num} - {line}"
41+
violations.add(violation_str)
42+
43+
return {"violations": violations, "kind": kinds}
44+
45+
46+
if __name__ == "__main__":
47+
all_violations = set()
48+
all_kinds = set()
49+
all_files = find_all_python_files(root_dir=Path(__file__).parent.parent)
50+
for filepath in all_files:
51+
result = check_file_for_violations(filepath=filepath)
52+
if result["violations"]:
53+
all_violations.update(result["violations"])
54+
if result["kind"]:
55+
all_kinds.update(result["kind"])
56+
if all_violations:
57+
print("Prohibited patterns found:")
58+
for violation in all_violations:
59+
print(f" {violation}")
60+
if all_kinds:
61+
print(
62+
"\n\nPlease check if the following kinds exists in "
63+
"https://github.com/RedHatQE/openshift-python-wrapper/tree/main/ocp_resources:"
64+
)
65+
print(
66+
"For details about why we need such resources in openshift-python-wrapper, please check: "
67+
"https://github.com/opendatahub-io/opendatahub-tests/blob/main/docs/DEVELOPER_GUIDE.md#"
68+
"interacting-with-kubernetesopenshift-apis"
69+
)
70+
for kind in all_kinds:
71+
print(f" {kind}")
72+
if all_kinds or all_violations:
73+
sys.exit(1)
74+
sys.exit(0)
File renamed without changes.

0 commit comments

Comments
 (0)