Skip to content

Commit 150ae32

Browse files
committed
chore(middleware): merge main into HTTP response hook branch
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
2 parents 555ff32 + 48c449d commit 150ae32

212 files changed

Lines changed: 15463 additions & 4128 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.

‎.agents/skills/launch-openshell-gator/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For gator's PR/issue validation policy, load `gator-gate` inside the launched sa
2626
|---|---|
2727
| `scripts/agents/run.sh` | Manifest-driven OpenShell agent launcher. |
2828
| `scripts/agents/gator/agent.yaml` | Gator manifest: immutable payload version, default gateway, harness, providers, runtime, skills, and subagents. |
29-
| `scripts/agents/gator/Dockerfile` | Gator sandbox image source. Local launches build this image through OpenShell. |
29+
| `scripts/agents/gator/Dockerfile` | Gator sandbox image source. Local launches build it in gateway's Docker or Podman image store. |
3030
| `scripts/agents/gator/policy.yaml` | Sandbox policy for the gator agent. |
3131
| `scripts/agents/gator/bin/gh` | Gator-specific `gh` wrapper and same-SHA duplicate-post guard. |
3232
| `scripts/agents/gator/bin/review-feedback-ledger` | Builds tree-aware review scope, durable findings, convergence telemetry, and review-budget state. |
@@ -160,7 +160,7 @@ sandbox_name="gator-pr-${pr_number}-supervised"
160160
"Review and monitor PR #${pr_number} through the gator-gate workflow. Scope this invocation only to PR #${pr_number}."
161161
```
162162

163-
The launcher builds the gator sandbox image when needed, stages the immutable payload, imports provider profiles, configures provider credentials and refresh, creates and uploads the sandbox payload, then starts the agent supervisor with `sandbox exec`. It writes a background log under `scripts/agents/gator/logs/`.
163+
The launcher queries gateway's selected compute driver, builds gator image in matching Docker or Podman image store, stages immutable payload, imports provider profiles, configures provider credentials and refresh, creates and uploads sandbox payload, then starts agent supervisor with `sandbox exec`. It writes a background log under `scripts/agents/gator/logs/`. `CONTAINER_ENGINE`, when set, must match gateway driver.
164164

165165
### Launch An Issue Or Issue/PR Pair
166166

‎.github/workflows/conformance.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,6 @@ jobs:
178178
--copy conformance-input/openshell-conformance:/tmp/openshell-conformance \
179179
--copy nix/test-guest/conformance-plans/gateway-upgrade-restart.toml:/tmp/conformance-plan.toml \
180180
--provision openshell-rpm-latest-release \
181-
--provision gateway-rootless-podman \
181+
--provision gateway-podman \
182182
--provision openshell-rpm-gateway-upgrade \
183183
-- /tmp/openshell-conformance run --plan /tmp/conformance-plan.toml

‎.github/workflows/e2e-kubernetes-test.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ on:
4242
required: false
4343
type: string
4444
default: "e2e:kubernetes"
45+
test-name:
46+
description: "Rust e2e test target to run (sets OPENSHELL_E2E_KUBE_TEST)"
47+
required: false
48+
type: string
49+
default: ""
50+
kubernetes-features:
51+
description: "Cargo feature list for the Kubernetes e2e crate (uses script defaults when empty)"
52+
required: false
53+
type: string
54+
default: ""
4555
mise-version:
4656
description: "mise version to install on the bare Kubernetes e2e runner"
4757
required: false
@@ -128,6 +138,8 @@ jobs:
128138
OPENSHELL_E2E_KUBE_CONTEXT: kind-${{ env.KIND_CLUSTER_NAME }}
129139
OPENSHELL_E2E_KUBE_EXTRA_VALUES: ${{ inputs.extra-helm-values }}
130140
OPENSHELL_E2E_KUBE_EXTERNAL_POSTGRES_SECRET: ${{ inputs.external-postgres-secret }}
141+
OPENSHELL_E2E_KUBE_TEST: ${{ inputs.test-name }}
142+
OPENSHELL_E2E_KUBERNETES_FEATURES: ${{ inputs.kubernetes-features }}
131143
IMAGE_TAG: ${{ inputs.image-tag }}
132144
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
133145
E2E_TASK: ${{ inputs.e2e-task }}
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Trivy Changes
5+
6+
on:
7+
pull_request:
8+
merge_group:
9+
types: [checks_requested]
10+
workflow_dispatch:
11+
inputs:
12+
base_sha:
13+
description: Base commit SHA to compare
14+
required: true
15+
type: string
16+
head_sha:
17+
description: Candidate commit SHA to compare
18+
required: true
19+
type: string
20+
21+
permissions:
22+
contents: read
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
changes:
30+
name: Detect deployment configuration changes
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
pull-requests: read
35+
outputs:
36+
should_run: ${{ steps.default.outputs.should_run || steps.changed.outputs.any_modified }}
37+
steps:
38+
- id: default
39+
if: github.event_name != 'pull_request'
40+
run: echo "should_run=true" >> "$GITHUB_OUTPUT"
41+
42+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43+
if: github.event_name == 'pull_request'
44+
with:
45+
persist-credentials: false
46+
47+
- id: changed
48+
if: github.event_name == 'pull_request'
49+
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # v42.1.0
50+
with:
51+
# `any_modified` covers deletions, which `any_changed` omits, and a
52+
# failed diff has to fail the job: both otherwise report no relevant
53+
# change, and removing the scanner or a value fixture would skip the
54+
# scan behind a green status.
55+
fail_on_initial_diff_error: true
56+
files: |
57+
deploy/docker/**
58+
deploy/helm/**
59+
deploy/kube/**
60+
.trivyignore.yaml
61+
flake.nix
62+
flake.lock
63+
tasks/scripts/trivy-scan.sh
64+
tasks/scripts/trivy-scan-test.sh
65+
tasks/scripts/trivy-config-report.jq
66+
.github/workflows/trivy-scan.yml
67+
.github/workflows/trivy-changes.yml
68+
69+
scan:
70+
name: Scan changed deployment configuration
71+
needs: changes
72+
if: needs.changes.outputs.should_run == 'true'
73+
runs-on: ubuntu-latest
74+
timeout-minutes: 30
75+
env:
76+
BASE_REF: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || inputs.base_sha }}
77+
HEAD_REF: ${{ inputs.head_sha || github.sha }}
78+
defaults:
79+
run:
80+
shell: nix develop --command bash -euo pipefail {0}
81+
steps:
82+
- name: Check out candidate
83+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
84+
with:
85+
ref: ${{ env.HEAD_REF }}
86+
persist-credentials: false
87+
88+
- name: Check out baseline
89+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
90+
with:
91+
ref: ${{ env.BASE_REF }}
92+
path: .trivy-base
93+
persist-credentials: false
94+
95+
- name: Set up Nix
96+
uses: ./.github/actions/setup-nix
97+
98+
- name: Test report comparison
99+
run: tasks/scripts/trivy-scan-test.sh
100+
101+
- name: Validate candidate ignore policy
102+
run: tasks/scripts/trivy-scan.sh validate-ignore
103+
104+
# Ignore-policy changes take effect only after merge. Applying the
105+
# baseline policy to both scans prevents a candidate from exempting a new
106+
# finding in the same change that introduces it.
107+
- name: Prepare baseline ignore policy
108+
run: |
109+
if [ -f .trivy-base/.trivyignore.yaml ]; then
110+
cp .trivy-base/.trivyignore.yaml "$RUNNER_TEMP/trivy-baseline-ignore.yaml"
111+
else
112+
printf 'misconfigurations: []\n' >"$RUNNER_TEMP/trivy-baseline-ignore.yaml"
113+
fi
114+
115+
- name: Scan baseline
116+
env:
117+
TRIVY_SOURCE_ROOT: ${{ github.workspace }}/.trivy-base
118+
TRIVY_IGNORE_FILE: ${{ runner.temp }}/trivy-baseline-ignore.yaml
119+
TRIVY_REPORT_DIR: ${{ runner.temp }}/trivy-base
120+
run: |
121+
mkdir -p "$TRIVY_REPORT_DIR"
122+
"$GITHUB_WORKSPACE/tasks/scripts/trivy-scan.sh" config
123+
124+
- name: Scan candidate
125+
env:
126+
TRIVY_IGNORE_FILE: ${{ runner.temp }}/trivy-baseline-ignore.yaml
127+
TRIVY_REPORT_DIR: ${{ runner.temp }}/trivy-head
128+
run: |
129+
mkdir -p "$TRIVY_REPORT_DIR"
130+
tasks/scripts/trivy-scan.sh config
131+
132+
- name: Reject new high or critical findings
133+
run: |
134+
tasks/scripts/trivy-scan.sh gate-config-diff \
135+
"$RUNNER_TEMP/trivy-base" "$RUNNER_TEMP/trivy-head"
136+
137+
- name: Upload reports
138+
if: always()
139+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
140+
with:
141+
name: trivy-changes-${{ github.run_id }}
142+
path: |
143+
${{ runner.temp }}/trivy-base
144+
${{ runner.temp }}/trivy-head
145+
if-no-files-found: ignore
146+
retention-days: 14
147+
148+
result:
149+
name: OpenShell / Trivy Changes
150+
needs: [changes, scan]
151+
if: always()
152+
runs-on: ubuntu-latest
153+
steps:
154+
- name: Check scan result
155+
env:
156+
CHANGES_RESULT: ${{ needs.changes.result }}
157+
SHOULD_RUN: ${{ needs.changes.outputs.should_run }}
158+
SCAN_RESULT: ${{ needs.scan.result }}
159+
run: |
160+
set -euo pipefail
161+
if [ "$CHANGES_RESULT" != "success" ]; then
162+
echo "::error::Change detection concluded $CHANGES_RESULT."
163+
exit 1
164+
fi
165+
if [ "$SHOULD_RUN" = "true" ] && [ "$SCAN_RESULT" != "success" ]; then
166+
echo "::error::Trivy scan concluded $SCAN_RESULT."
167+
exit 1
168+
fi
169+
if [ "$SHOULD_RUN" != "true" ]; then
170+
echo "No Helm or Dockerfile changes to scan."
171+
fi

0 commit comments

Comments
 (0)