Allow ecosystem and custom domains in strict mode network configuration#16732
Allow ecosystem and custom domains in strict mode network configuration#16732
Conversation
Modified strict mode validation to allow truly custom domains (domains not part of known ecosystems) while still enforcing ecosystem identifiers for domains that belong to known ecosystems. Changes: - Updated validateStrictFirewall to distinguish between ecosystem domains and custom domains - Only reject domains that belong to known ecosystems but are not specified as identifiers - Allow truly custom domains (e.g., api.example.com) in strict mode - Updated error messages to clarify that custom domains are allowed - Updated tests to reflect new behavior - Updated documentation to match implementation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot allow domain from know sets but suggest sets instead |
Per feedback, changed strict mode behavior: - BEFORE: Reject ecosystem domains (e.g., pypi.org) with error - AFTER: Allow ecosystem domains with warning suggesting ecosystem identifiers Changes: - Modified validateStrictFirewall to emit warnings instead of errors for ecosystem domains - Warnings suggest using ecosystem identifiers (e.g., 'pypi.org' → 'python') - Updated all tests to expect warnings instead of errors - Updated documentation to reflect new warning-based approach Truly custom domains remain allowed without warnings. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Changed strict mode to allow ecosystem domains (like Example warning output: Workflows now compile successfully with warnings instead of failing with errors. Commit: c85d988 |
There was a problem hiding this comment.
Pull request overview
This PR changes strict mode network validation from rejecting ecosystem domains with errors to allowing them with warnings, while continuing to allow truly custom domains. The goal is to improve usability by making strict mode less restrictive while still encouraging best practices through warnings.
Changes:
- Modified validation logic to emit warnings instead of errors for ecosystem domains like
pypi.org, suggesting ecosystem identifiers likepython - Updated 9 existing tests and added new comprehensive test suite covering custom domain behavior
- Updated reference documentation to reflect the new "recommendation" model rather than "requirement" model
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/workflow/strict_mode_validation.go | Changed validateStrictFirewall to allow all domains (ecosystem and custom) with warnings for ecosystem domains instead of errors |
| pkg/workflow/strict_mode_llm_gateway_test.go | Updated test expectations from errors to warnings, added comprehensive test coverage for custom domain scenarios |
| docs/src/content/docs/reference/network.md | Updated documentation from "requirement" to "recommendation" language, changed examples from errors (❌) to warnings (⚠) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Strict mode now allows both ecosystem domains and custom domains in
network.allowed, with warnings for ecosystem domains suggesting the use of ecosystem identifiers for better maintainability.Changes
Validation logic (
pkg/workflow/strict_mode_validation.go)validateStrictFirewallto allow all domains (ecosystem and custom) in strict mode'pypi.org' → 'python'for better readabilityapi.example.com,cdn.myservice.io)Tests (
pkg/workflow/strict_mode_llm_gateway_test.go)TestValidateStrictFirewall_CustomDomainBehaviorcovering custom domain scenariosDocumentation (
docs/src/content/docs/reference/network.md)Example
Warning message:
Behavior Change
Before: Ecosystem domains were rejected with an error, preventing compilation.
After: Ecosystem domains are allowed and workflows compile successfully, but a warning is emitted suggesting the use of ecosystem identifiers for better maintainability.
> [!WARNING]
>
>
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.