Skip to content

feat: CI support for governance_observability - #23

Merged
LeoRoccoBreedt merged 3 commits into
mainfrom
lrb/governance-observability-ci
Jul 1, 2026
Merged

feat: CI support for governance_observability#23
LeoRoccoBreedt merged 3 commits into
mainfrom
lrb/governance-observability-ci

Conversation

@LeoRoccoBreedt

@LeoRoccoBreedt LeoRoccoBreedt commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds run.sh with three labelled steps: agent tracing → use case team → data governance team
  • Fixes agent_tracing.py to hard-fail on missing OPIK_WORKSPACE at module load (matches behaviour of the other two scripts)
  • Adds .gitignore for generated governance_extract_*.json output files

Test plan

  • Ran locally against opik-examples workspace — all three steps passed, traces visible in Opik
  • CI passed against lrb/ci-workflows

🤖 Generated with Claude Code

@LeoRoccoBreedt
LeoRoccoBreedt changed the base branch from lrb/ci-workflows to main June 29, 2026 13:58
@fschlz

fschlz commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Review against current main (PR #16 merged). One blocker before this can go green.

Will fail the merged pr-test.yml dry-run job as-is

pr-test.yml runs a secrets-free dry-run job: bash run.sh with no credentials, expecting exit 0. This PR changes agent_tracing.py to:

WORKSPACE = os.environ["OPIK_WORKSPACE"]   # at module load

With no OPIK_WORKSPACE that raises KeyError on import → set -e → job fails. The description notes all three scripts hard-require creds, so the example currently has no creds-free path.

Fix: add a DRY_RUN guard to each script

agent_tracing.py, use_case_team.py, data_governance_team.py:

OPIK_WORKSPACE = os.environ.get("OPIK_WORKSPACE")
DRY_RUN = not (os.environ.get("OPIK_API_KEY") and OPIK_WORKSPACE)

When DRY_RUN, print locally and skip the Opik calls (the use-case template and other examples follow this pattern). Swap the hard os.environ["OPIK_WORKSPACE"] index for .get().

Good as-is

run.sh (set -e + export OPIK_PROJECT_NAME ✓) and the .gitignore. No .github/docs churn — clean.

Verify (no credentials)

cd use-cases/governance_observability && bash run.sh     # must exit 0
uv run ruff check . && uv run ruff format --check .

Also git rebase origin/main since the base moved.

LeoRoccoBreedt and others added 2 commits July 1, 2026 16:06
Adds run.sh with step-labelled execution of all three scripts.
Fixes agent_tracing.py to hard-fail on missing OPIK_WORKSPACE at
module load (consistent with use_case_team.py and data_governance_team.py).
Adds .gitignore for generated governance_extract_*.json output files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The reconciled pr-test.yml runs `bash run.sh` with no credentials (the
secrets-free dry-run job) and expects exit 0. The three scripts read
OPIK_WORKSPACE / OPIK_API_KEY at import and call the live Opik API
unconditionally, so they crashed without creds. Add the standard
DRY_RUN = not (OPIK_API_KEY and OPIK_WORKSPACE) gate: switch the hard
os.environ[...] lookups to .get() and short-circuit each __main__ with a
[DRY RUN] stub. Also apply ruff format (the lint job runs format --check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LeoRoccoBreedt
LeoRoccoBreedt force-pushed the lrb/governance-observability-ci branch from e2dcbf2 to d6b567e Compare July 1, 2026 14:31
@LeoRoccoBreedt
LeoRoccoBreedt marked this pull request as ready for review July 1, 2026 16:32
@LeoRoccoBreedt
LeoRoccoBreedt merged commit d7ad69a into main Jul 1, 2026
7 checks passed
@LeoRoccoBreedt
LeoRoccoBreedt deleted the lrb/governance-observability-ci branch July 1, 2026 16:34
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