feat: add support for YAML file includes and nested includes in context #1252
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Added YAML file include functionality to auth0-deploy-cli, allowing users to modularize their Auth0 configuration by splitting it into separate files and importing them using the !include directive.
New functionality:
Custom YAML type !include: Enables importing external YAML files within tenant configuration
resolveIncludes() function: Recursively processes YAML objects to resolve file includes with proper path resolution
Extended YAML schema: Modified the YAML context to support the new include syntax
Improved loadFile() method: Enhanced file path resolution with additional fallback mechanisms
This enables better organization of large Auth0 configurations by separating concerns into dedicated files while maintaining full compatibility with existing YAML functionality.
📚 References
This addresses the need for modular YAML configurations in auth0-deploy-cli, making it easier to manage complex Auth0 tenant setups by allowing configuration sections to be split across multiple files.
🔬 Testing
Automated tests added:
should process YAML with includes - Tests basic file inclusion functionality
should handle nested includes - Tests direct includes at root level
should error on missing include file - Tests error handling for missing files
Manual testing:
Create a main YAML file with !include directives
Create separate YAML files for each included section
Run a0deploy import -i tenant.yaml to verify includes are processed correctly
Verify that missing include files throw appropriate errors
Test coverage: All new functionality is covered by unit tests following existing patterns.