Skip to content

Commit generated JSON-schema conformance policies + auto-update infra#285

Open
lmolkova wants to merge 3 commits into
open-telemetry:mainfrom
lmolkova:pr1-conformance-policy-gen
Open

Commit generated JSON-schema conformance policies + auto-update infra#285
lmolkova wants to merge 3 commits into
open-telemetry:mainfrom
lmolkova:pr1-conformance-policy-gen

Conversation

@lmolkova

@lmolkova lmolkova commented Jul 18, 2026

Copy link
Copy Markdown
Member

Add a make generate-conformance-policies target that emits the committed policies/_schemas.rego from the pinned semconv GenAI registry, so the schema policies are versioned instead of regenerated at test-run time.

Add the auto-conformance-policies workflow to regenerate and push the policies on Renovate branches when versions.env pins are bumped.

This lays down ground to generate span validation rego with weaver

Add a `make generate-conformance-policies` target that emits the committed
policies/_schemas.rego from the pinned semconv GenAI registry (via jq), so the
schema policies are versioned instead of regenerated at test-run time.
_setup_weaver.policies_dir() now returns the committed directory.

Add the auto-conformance-policies workflow to regenerate and push the policies
on Renovate branches when versions.env pins are bumped (Renovate's
postUpgradeTasks don't run on hosted Renovate).

Assisted-by: Claude Opus 4.8
@lmolkova
lmolkova requested a review from a team as a code owner July 18, 2026 21:36
Copilot AI review requested due to automatic review settings July 18, 2026 21:36
@lmolkova lmolkova added the Skip Changelog PR does not require a changelog entry label Jul 18, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 18, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-25 16:47:12 UTC.

  • Waiting on: Author
  • Next step: Address or respond to 2 review feedback items:
    • Inline threads: 1, 2
    • For each item, reply to move the discussion forward, e.g. link to the commit that addresses it, explain why no change is needed, or ask a follow-up question.

This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. If you believe this pull request is incorrectly routed as waiting on the author, comment /dashboard route:reviewers to route it from waiting on the author to waiting on reviewers. If the last refreshed time above predates your latest reply or push, the dashboard hasn't processed it yet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR shifts GenAI conformance JSON-schema advice policies from being generated at conformance test runtime to being committed and reproducible via a make generate-conformance-policies target, with automation to regenerate and push updated policies on Renovate branches when versions.env pins change.

Changes:

  • Update SEMCONV_GENAI_REF pin and adjust Renovate configuration to track the semconv-genai repo via git-refs digest updates.
  • Stop generating policies/_schemas.rego at runtime; commit it and add a Makefile target to regenerate it from the provisioned semconv registry cache.
  • Add an auto-regeneration GitHub Actions workflow for Renovate branches and update policy documentation/comments and .gitignore accordingly.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
versions.env Bumps the pinned semconv-genai commit SHA and adjusts the Renovate annotation.
util/opentelemetry-test-util-genai/src/opentelemetry/test_util_genai/_setup_weaver.py Removes runtime schema generation; policies_dir() now points at committed policies.
policies/genai_content_validation.rego Updates comments to reflect committed _schemas.rego generation via make.
policies/_schemas.rego New committed, generated Rego constants containing inlined semconv JSON schemas.
Makefile Adds generate-conformance-policies to regenerate policies/_schemas.rego from the cached registry using jq.
.gitignore Stops ignoring policies/_schemas.rego since it is now committed.
.github/workflows/auto-conformance-policies.yml Adds workflow to regenerate policies on Renovate branches and push the result back.
.github/renovate.json5 Updates custom manager logic to treat SEMCONV_GENAI_REF as a git-refs digest pin (branch as currentValue, SHA as currentDigest).

Comment thread .github/workflows/auto-conformance-policies.yml
Comment thread .github/workflows/auto-conformance-policies.yml
Comment thread .github/workflows/auto-conformance-policies.yml
- Gate the `apply` job on a `generate` job output so it skips entirely (rather
  than failing on a missing artifact) when no policy changes were produced.
- Pass `name: patch` to download-artifact so the patch extracts to
  runner.temp/patch instead of a per-artifact subdirectory.

Assisted-by: Claude Opus 4.8
Comment thread policies/_schemas.rego

@lmolkova lmolkova Jul 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this won't be necessary with next weaver release open-telemetry/weaver#1539, will address in a follow up

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Comment on lines +104 to +105
- name: Configure CLA-approved git bot
run: .github/scripts/use-cla-approved-github-bot.sh
Comment on lines +66 to +67
git add -N --ignore-removal policies
git diff > patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PR does not require a changelog entry

Development

Successfully merging this pull request may close these issues.

2 participants