Skip to content

Fixes #716 Improve environment-mapping behavior in optional config fields#734

Merged
shirasassoon merged 11 commits intomicrosoft:mainfrom
shirasassoon:fix_optional_settings_config_deployment
Feb 2, 2026
Merged

Fixes #716 Improve environment-mapping behavior in optional config fields#734
shirasassoon merged 11 commits intomicrosoft:mainfrom
shirasassoon:fix_optional_settings_config_deployment

Conversation

@shirasassoon
Copy link
Contributor

Fixes #716
This pull request improves environment-specific configuration handling and validation for deployment configs. It clarifies documentation, centralizes logic for extracting environment-specific values, and enhances validation to distinguish between required and optional fields—logging errors, warnings, or debug messages as appropriate. Tests are updated to reflect these changes.

Environment-specific configuration and validation improvements:

  • Updated documentation in docs/how_to/config_deployment.md to clearly explain environment-specific configuration, distinguishing required and optional fields and their validation/logging behaviors.
  • Validation logic in src/fabric_cicd/_common/_config_validator.py now differentiates required fields (which cause errors if missing for an environment) from optional fields (which log warnings or debug messages), and includes new fields in the validation matrix. [1] [2] [3]

Configuration extraction and code simplification:

  • Introduced the get_config_value helper in src/fabric_cicd/_common/_config_utils.py to centralize logic for retrieving environment-specific or single values, reducing repetition and improving maintainability. This helper is now used in all relevant settings extraction functions. [1] [2] [3]

Testing updates:

  • Expanded and updated tests in tests/test_config_validator.py to cover new fields, verify required/optional logic, and ensure correct error/warning/debug behaviors for missing environment mappings. [1] [2] [3]

@shirasassoon shirasassoon requested a review from a team as a code owner January 15, 2026 12:28
Copilot AI review requested due to automatic review settings January 15, 2026 12:28
@shirasassoon shirasassoon changed the title Fixes #716 Deployment failure when using folder_exclude_regex Fixes #716 Improve environment-mapping behavior in optional config fields Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes issue #716 related to deployment failures when using folder_exclude_regex by improving environment-specific configuration handling. The changes introduce a clearer distinction between required and optional configuration fields, centralizing value extraction logic, and enhancing validation to provide appropriate logging (errors, warnings, or debug messages) based on field importance.

Changes:

  • Introduced get_config_value helper function to centralize environment-specific value extraction logic
  • Enhanced validation to distinguish required fields (causing errors) from optional fields (logging warnings/debug)
  • Updated documentation to clearly explain environment-specific configuration behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/fabric_cicd/_common/_config_utils.py Added get_config_value helper and refactored extraction functions to use centralized logic
src/fabric_cicd/_common/_config_validator.py Enhanced _validate_environment_exists to differentiate required/optional fields with appropriate logging
docs/how_to/config_deployment.md Added comprehensive documentation on environment-specific configuration and field requirements
tests/test_config_validator.py Updated tests to validate required/optional field behavior and logging
tests/test_deploy_with_config.py Added comprehensive tests for get_config_value and environment-specific settings extraction

@shirasassoon
Copy link
Contributor Author

Thank you @aviatco and @ayeshurun for reviewing. I've addressed the comments. Please review updated PR when you have a chance. Thanks

@shirasassoon shirasassoon merged commit 79fb1b6 into microsoft:main Feb 2, 2026
6 checks passed
@shirasassoon shirasassoon deleted the fix_optional_settings_config_deployment branch February 2, 2026 07:30
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.

Deployment failure when using folder_exclude_regex

3 participants