$npx -y skills add opendatahub-io/ai-helpers --skill maas-nightly-qe-impactAssess whether a Models-as-a-Service autofix change requires follow-up in opendatahub-tests or ods-ci nightly QE pipelines. Runs as a Jira autofix post_review extension for the Model as a Service component. Appends a Nightly QE Impact section to the PR description and writes info
| 1 | # MaaS Nightly QE Impact |
| 2 | |
| 3 | Notify the merge team when a MaaS autofix may require follow-up in downstream |
| 4 | nightly test or CI repos. This skill is **informational only** — it does not |
| 5 | block merge or trigger re-iteration. |
| 6 | |
| 7 | ## Step 1: Confirm context |
| 8 | |
| 9 | 1. Read `.autofix-context/ticket.json` for the ticket key and summary. |
| 10 | If the file is missing or malformed, write an empty findings file and stop. |
| 11 | 2. Read `autofix-output/.autofix-verdict.json`. If `verdict` is not `committed`, |
| 12 | write an empty findings file and stop: |
| 13 | |
| 14 | ```bash |
| 15 | mkdir -p .autofix-context/extension-findings |
| 16 | echo '[]' > .autofix-context/extension-findings/maas-nightly-qe-impact.json |
| 17 | ``` |
| 18 | |
| 19 | 3. Load the static trigger catalog from |
| 20 | `${CLAUDE_SKILL_DIR}/references/impact-triggers.md` and repo paths from |
| 21 | `${CLAUDE_SKILL_DIR}/references/repo-locations.md`. |
| 22 | |
| 23 | ## Step 2: Analyze the code change |
| 24 | |
| 25 | Collect the diff against the target branch: |
| 26 | |
| 27 | ```bash |
| 28 | TARGET=$(git rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's|^origin/||') |
| 29 | BASE="origin/${TARGET:-main}" |
| 30 | git diff --name-only "${BASE}...HEAD" 2>/dev/null || git diff --name-only HEAD~1 |
| 31 | git diff "${BASE}...HEAD" 2>/dev/null | head -2000 |
| 32 | ``` |
| 33 | |
| 34 | Classify changed files against the trigger catalog. Flag a category when the |
| 35 | diff touches matching paths or introduces matching concepts (env vars, CRD |
| 36 | fields, namespace names, API routes, NetworkPolicy selectors, deployment |
| 37 | names). |
| 38 | |
| 39 | **High-signal patterns** (learned from |
| 40 | [models-as-a-service#1051](https://github.com/opendatahub-io/models-as-a-service/pull/1051)): |
| 41 | |
| 42 | - Namespace moves (`INFRA_NAMESPACE`, `odh-ai-gateway-infra`, |
| 43 | `redhat-ai-gateway-infra`, controller vs infra namespace) |
| 44 | - Secret relocation (`maas-db-config`, cross-namespace DB URLs) |
| 45 | - Renamed reconciler fields (`MaaSAPINamespace` → `InfraNamespace`) |
| 46 | - NetworkPolicy label selectors affecting Gateway ↔ maas-api traffic |
| 47 | - Deploy/script changes under `scripts/deploy.sh`, `scripts/setup-database.sh`, |
| 48 | `scripts/validate-deployment.sh` |
| 49 | - New or changed API endpoints under `/v1/` or `/internal/v1/` |
| 50 | - CRD schema changes for MaaS resources (Tenant, MaaSAuthPolicy, etc.) |
| 51 | |
| 52 | If no triggers match, write empty findings, append a brief "no downstream QE |
| 53 | changes expected" note to the PR description (Step 4), and stop. |
| 54 | |
| 55 | ## Step 3: Hybrid repo search (when triggers match) |
| 56 | |
| 57 | Shallow-clone downstream repos and search for related references: |
| 58 | |
| 59 | ```bash |
| 60 | REPO_DIR="${TMPDIR:-/tmp}/maas-qe-repos" |
| 61 | mkdir -p "$REPO_DIR" |
| 62 | |
| 63 | clone_if_missing() { |
| 64 | local url="$1" name="$2" |
| 65 | if [ ! -d "$REPO_DIR/$name/.git" ]; then |
| 66 | git clone --depth 1 "$url" "$REPO_DIR/$name" |
| 67 | fi |
| 68 | } |
| 69 | |
| 70 | clone_if_missing "https://github.com/opendatahub-io/opendatahub-tests.git" opendatahub-tests |
| 71 | clone_if_missing "https://github.com/red-hat-data-services/ods-ci.git" ods-ci |
| 72 | ``` |
| 73 | |
| 74 | Build search terms from the diff (namespace names, env var names, deployment |
| 75 | names, secret names, API paths). Search both clones: |
| 76 | |
| 77 | ```bash |
| 78 | # Example — replace TERMS with tokens extracted from the diff |
| 79 | for term in INFRA_NAMESPACE maas-db-config odh-ai-gateway-infra; do |
| 80 | echo "=== opendatahub-tests: $term ===" |
| 81 | grep -rl "$term" "$REPO_DIR/opendatahub-tests/tests/model_serving/maas_billing" 2>/dev/null | head -10 |
| 82 | echo "=== ods-ci: $term ===" |
| 83 | grep -rl "$term" "$REPO_DIR/ods-ci/ods_ci" 2>/dev/null | head -10 |
| 84 | done |
| 85 | ``` |
| 86 | |
| 87 | Map hits to concrete follow-up actions using `repo-locations.md`. Prefer |
| 88 | specific file paths and GitHub links over generic advice. |
| 89 | |
| 90 | ## Step 4: Update PR description |
| 91 | |
| 92 | Read the current `change_description` from `autofix-output/.autofix-verdict.json`. |
| 93 | Append (do not replace) a section using this template: |
| 94 | |
| 95 | ```markdown |
| 96 | ## Nightly QE Impact |
| 97 | |
| 98 | > **For merge team:** Review before merging. Follow-up PRs may be needed in |
| 99 | > downstream QE repos — this autofix PR does not include those changes. |
| 100 | |
| 101 | | Area | Action needed | Repo | Links | |
| 102 | |------|---------------|------|-------| |
| 103 | | ... | Yes / No / Investigate | opendatahub-tests / ods-ci | file paths or PR template | |
| 104 | |
| 105 | ### Summary |
| 106 | |
| 107 | <1-3 sentences explaining what changed and why nightlies might break> |
| 108 | |
| 109 | ### Recommended follow-up |
| 110 | |
| 111 | - [ ] <specific change in opendatahub-tests, with file path> |
| 112 | - [ ] <specific change in ods-ci, with file path> |
| 113 | |
| 114 | ### Reference |
| 115 | |
| 116 | - Triggered by: <ticket key> |
| 117 | - Example incident: [models-as-a-service#1051](https:/ |