Skip to content

Add policy languages and runtimes doc#1812

Merged
renuka-fernando merged 2 commits into
mainfrom
python-policy-engine
Apr 29, 2026
Merged

Add policy languages and runtimes doc#1812
renuka-fernando merged 2 commits into
mainfrom
python-policy-engine

Conversation

@renuka-fernando

Copy link
Copy Markdown
Contributor

Purpose

$subject

sehan-dissanayake and others added 2 commits April 29, 2026 10:47
Introduce a new gateway documentation page that explains policy authoring in Go and Python, the runtime architecture, policy anatomy (definition and implementation), build integration, and guidance for choosing a language. Also update docs/gateway/README.md to link to the new Policy Languages and Runtimes guide. This provides developers with guidance on Go (default) vs Python (beta) policies, execution model, and packaging/build workflows.
Add policy languages and runtimes doc
@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary

This PR adds comprehensive documentation for policy authoring and runtime execution on the API Gateway, introducing a new guide that covers Go and Python policy development.

Changes

Documentation additions:

  • New guide: docs/gateway/policy-languages-and-runtimes.md documenting how the Gateway Runtime executes policies in both Go and Python
  • Updated docs/gateway/README.md to link to the new guide

Content Overview

The new documentation covers:

  • Runtime Architecture: How the Gateway Runtime executes policies, with shared fundamentals across both languages
  • Policy Anatomy: Unified YAML schema for policy definitions (name, version, parameters, systemParameters) used by both languages
  • Implementation Details:
    • Go policies compiled directly into the Policy Engine via ext_proc protocol (zero IPC/serialization overhead)
    • Python policies executed by a separate Python Executor communicating over local gRPC via Unix Domain Socket
  • Project Structure: Representative layouts for both Go (including policy-definition.yaml, go.mod, policy.go) and Python (including pyproject.toml, requirements.txt, src/.../policy.py)
  • Build Integration: Integration fields in build.yaml for each language (gomodule for Go, pipPackage for Python)
  • Language Selection Guidance: Decision matrix and recommendations for choosing between Go and Python, with Go as the default and Python as beta

Impact

Provides clear guidance for developers on dual-language policy authoring, helping them understand runtime architecture, project structure, build processes, and language-specific considerations.

Walkthrough

This pull request adds documentation for policy language support in the Gateway Runtime. It introduces a new page explaining how the Gateway Runtime executes policies written in Go and Python. The documentation covers the shared YAML schema for policy definitions, describes the distinct execution models for each language (Go compiled directly into the Policy Engine versus Python executed via a separate Python Executor over gRPC), provides representative project layouts for both languages, and includes build configuration integration details and a decision matrix comparing language trade-offs.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete, providing only the Purpose section placeholder without required details from the template. Complete the PR description by filling in all required sections: Goals, Approach, User stories, Documentation, Automation tests, Security checks, Samples, Related PRs, and Test environment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding documentation about policy languages and runtimes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch python-policy-engine

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@renuka-fernando
renuka-fernando merged commit a42180b into main Apr 29, 2026
1 of 2 checks passed
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.

3 participants