Skip to content

ci: add PR test, scheduled runs, and compliance check workflows - #16

Merged
fschlz merged 7 commits into
mainfrom
lrb/ci-workflows
Jun 30, 2026
Merged

ci: add PR test, scheduled runs, and compliance check workflows#16
fschlz merged 7 commits into
mainfrom
lrb/ci-workflows

Conversation

@LeoRoccoBreedt

@LeoRoccoBreedt LeoRoccoBreedt commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the legacy `e2e-tests.yml` and `test-scripts-matrix.yml` with three focused workflows and documents the conventions in `CONTRIBUTING.md`. Infrastructure only — no example code changes. A follow-up PR adds `run.sh` to the first example to prove the pipeline end-to-end.

What changed

Deleted

  • `.github/workflows/e2e-tests.yml`
  • `.github/workflows/test-scripts-matrix.yml`

Added / updated

File What it does
`pr-test.yml` Detects changed example folders with `run.sh`, runs each in a matrix job with real Opik credentials and `OPIK_EXAMPLES_MODEL`. Blocks PR on failure.
`scheduled.yml` Weekly curated run (Monday 06:00 UTC) on Python 3.12. Folder list in `.github/scheduled.json`. Supports `workflow_dispatch`.
`compliance.yml` Secrets-free check on new example folders: `run.sh` with `set -e` + `OPIK_PROJECT_NAME`, `pyproject.toml`, `README.md`, `OPIK_EXAMPLES_MODEL` if `litellm` is a dep.
`.github/scheduled.json` Curated folder list for scheduled runs (empty for now — folders added after local testing). Maintainer-managed.
`CONTRIBUTING.md` Documents `run.sh` convention, litellm/`OPIK_EXAMPLES_MODEL` pattern, CI credential expectations, both `OPIK_PROJECT_NAME` patterns (shell export vs config module).

What to review

  1. `pr-test.yml` folder detection — shell handles `integrations/` (3-level path) differently from other buckets (2-level). Worth a close read.
  2. `compliance.yml` scope — only enforces on new folders added in the PR, not existing ones. Intentional.
  3. `CONTRIBUTING.md` — clarity for external contributors on the litellm and `OPIK_EXAMPLES_MODEL` convention.

Tested

The full CI flow was validated end-to-end by retargeting PR #19 (f1_radio_rag) at this branch and triggering `pr-test.yml`. The matrix job ran successfully: ingested 30 radio messages into ChromaDB, retrieved context, called Claude Haiku, and logged a trace to the `f1-radio-rag` project in Opik.

GitHub secrets/variables required before workflows go live

Name Type Value
`OPIK_API_KEY` Secret service account key
`ANTHROPIC_API_KEY` Secret for Haiku
`OPIK_WORKSPACE` Variable `opik-examples`
`OPIK_EXAMPLES_MODEL` Variable `anthropic/claude-haiku-4-5-20251001`
`OPIK_ENVIRONMENT` Variable `ci`

🤖 Generated with Claude Code

LeoRoccoBreedt and others added 3 commits June 25, 2026 14:30
Replaces legacy e2e-tests.yml and test-scripts-matrix.yml with three focused workflows:

- pr-examples-test.yml: detects changed example folders that have run_examples.sh,
  runs each in a matrix job using real Opik credentials and a cheap model
  (OPIK_EXAMPLES_MODEL). Blocks the PR on failure.

- scheduled-examples.yml: weekly curated run (Monday 06:00 UTC) across Python 3.12
  and 3.13. Example list lives in .github/ci-examples.json and is easy to edit.
  Also supports workflow_dispatch.

- example-compliance-check.yml: secrets-free check on new example folders — enforces
  run_examples.sh with set -e and OPIK_PROJECT_NAME, pyproject.toml (no requirements.txt),
  README.md, and OPIK_EXAMPLES_MODEL if litellm is a dependency.

Updates CONTRIBUTING.md to document the run_examples.sh convention, the
litellm/OPIK_EXAMPLES_MODEL pattern for LLM-calling examples, and CI credential
expectations.

Required GitHub secrets/variables before workflows go live:
  Secrets: OPIK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY
  Variables: OPIK_WORKSPACE, OPIK_EXAMPLES_MODEL, OPIK_ENVIRONMENT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es.sh export

Scripts (single .py, no config module) set it via export in run_examples.sh.
Use-cases and guides with a config.py define it as a Python constant and pass
it explicitly to opik.track(). The compliance check accepts either pattern.

Updates CONTRIBUTING.md and the step summary to document both approaches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clarifies inclusion criteria (self-contained, cheap, no GPU, no seed data)
and that contributors do not need to add their example to the scheduled list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clearer name — each example folder has exactly one run.sh scoped to that
folder, so there is no ambiguity about what it runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LeoRoccoBreedt
LeoRoccoBreedt marked this pull request as ready for review June 26, 2026 10:38
Address review of #16 (high/medium/low) and make the templates + scaffold
consistent with the conventions this PR introduces, so a freshly scaffolded
example passes its own compliance check.

pr-test.yml: split the single test job into detect-changes (+has_secrets) /
lint / dry-run / live-run. lint + dry-run are secrets-free, so fork PRs (which
GitHub withholds secrets from) get real signal; live-run is gated on secrets
being present. Add a concurrency group + per-job timeouts; quote the matrix
folder.

scheduled.yml: guard run-examples on a non-empty list — an empty matrix array
errored ("Matrix vector 'folder' does not contain any values"), so the weekly
cron and workflow_dispatch failed with the empty scheduled.json. Add a timeout;
quote the folder.

compliance.yml: match a quoted litellm dependency instead of a bare substring;
group the step-summary redirects (shellcheck SC2129). actionlint now clean.

scheduled.json: add a trailing newline.

templates: add run.sh to both templates — it doubles as the secrets-free
dry-run smoke test CI runs. use-case config.py now reads OPIK_EXAMPLES_MODEL,
so a fresh use-case scaffold satisfies the new litellm compliance rule.
scaffold.py rewrites run.sh's command on --command override and no longer
prints a phantom "run-all" next step.

CONTRIBUTING.md: dry-run is required again (the secrets-free CI job enforces
it); fix the "CI always has real Opik credentials" claim (false for forks);
fix the run.sh snippet; add ruff check/format to the checklist.

.github: add pull_request_template.md (embeds the checklist), CODEOWNERS
(workflows + scheduled.json are maintainer-managed), dependabot for actions.

Verified: actionlint clean on all three workflows; scaffolded use-case and
script projects pass ruff check + format and `bash run.sh` exits 0 in DRY_RUN
with no credentials; compliance positive and negative cases behave as expected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@fschlz fschlz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good overall
I pushed some changes to harden the CI flow

@fschlz
fschlz merged commit f48e7d8 into main Jun 30, 2026
1 check passed
@fschlz
fschlz deleted the lrb/ci-workflows branch June 30, 2026 01:07
LeoRoccoBreedt added a commit that referenced this pull request Jul 1, 2026
## Summary

Adds CI support to `use-cases/f1_radio_rag` — the first example to go
through the new PR test workflow (from PR #16).

## What changed

- `run.sh` — runs `ingest` then `ask`, logging one RAG trace to Opik.
Lightweight alternative to the full eval suite for CI.
- `config.py` — reads `OPIK_EXAMPLES_MODEL` so CI routes to a cheap
model (`openai/gpt-4o-mini`). Removes `LLM_READY` guard — missing keys
now fail loudly via litellm rather than silently skipping.
- `cli.py` — removes the `LLM_READY` dry-run branch in `ask`.

## Tested locally

Ran `bash run.sh` with real credentials. Trace appeared in Opik
workspace under project `f1-radio-rag`.

**Depends on PR #16 merging first** for the PR test workflow to fire.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants