Skip to content

Support Python src-layout package policies#1795

Merged
renuka-fernando merged 2 commits intowso2:python-policy-enginefrom
sehan-dissanayake:python-policy-version-support
Apr 28, 2026
Merged

Support Python src-layout package policies#1795
renuka-fernando merged 2 commits intowso2:python-policy-enginefrom
sehan-dissanayake:python-policy-version-support

Conversation

@sehan-dissanayake
Copy link
Copy Markdown
Contributor

Add detection and discovery support for Python policies using the industry-standard src layout and pyproject.toml. DetectRuntime now recognizes pyproject.toml and treats such projects as Python. Local Python packages are built into wheels, extracted, and validated via a new discoverLocalPythonPackagePolicy flow; flat/extracted module directories are handled by buildSimplePythonDiscoveredPolicy. Adjust validation and source collection to use PythonSourceDir (and fall back to the project root for requirements.txt when needed). Added tests for runtime detection and discovering a src-layout package policy, and minor doc/comment tweaks.

Add detection and discovery support for Python policies using the industry-standard src layout and pyproject.toml. DetectRuntime now recognizes pyproject.toml and treats such projects as Python. Local Python packages are built into wheels, extracted, and validated via a new discoverLocalPythonPackagePolicy flow; flat/extracted module directories are handled by buildSimplePythonDiscoveredPolicy. Adjust validation and source collection to use PythonSourceDir (and fall back to the project root for requirements.txt when needed). Added tests for runtime detection and discovering a src-layout package policy, and minor doc/comment tweaks.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@renuka-fernando has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 16 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b58ee954-8d1c-4cef-9c95-545228d54b8d

📥 Commits

Reviewing files that changed from the base of the PR and between eb01166 and c345976.

📒 Files selected for processing (8)
  • gateway/gateway-builder/internal/buildfile/generator.go
  • gateway/gateway-builder/internal/buildfile/generator_test.go
  • gateway/gateway-builder/internal/discovery/discovery_test.go
  • gateway/gateway-builder/internal/discovery/manifest.go
  • gateway/gateway-builder/internal/discovery/policy.go
  • gateway/gateway-builder/internal/discovery/python_module.go
  • gateway/gateway-builder/internal/policyengine/generator.go
  • gateway/gateway-builder/internal/validation/structure.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Make sanitizePipSpec exported as SanitizePipSpec with documentation and use it throughout the python discovery code to redact credentials in pip specs and logs. Update the build manifest generator to call discovery.SanitizePipSpec when writing PipPackage entries so private index and VCS credentials are replaced with a <redacted-credentials> placeholder. Add tests to verify credential redaction for both private index URLs and VCS specs.
@renuka-fernando
Copy link
Copy Markdown
Contributor

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

✅ Actions performed

Full review triggered.

@renuka-fernando renuka-fernando self-assigned this Apr 28, 2026
@renuka-fernando renuka-fernando merged commit 85a8cb9 into wso2:python-policy-engine Apr 28, 2026
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.

2 participants