-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolves #113 Refactor Parameterization #128
Resolves #113 Refactor Parameterization #128
Conversation
There was a problem hiding this 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 PR improves parameter handling and validation in the fabric_cicd package by introducing new utility functions for parameter file processing, refactoring parameter replacement mechanisms, and updating compute settings to support new parameter structures.
- Added a module for parameter file validation and log level management.
- Introduced several utility functions to load, validate, and process parameter files.
- Updated workspace and environment handling to incorporate the new parameterization logic.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/fabric_cicd/_parameterization/init.py | New module for parameter file validation and log level changes. |
src/fabric_cicd/_parameterization/_parameterization_utils.py | New utilities for loading and validating parameter files, with enhancements in structure checking and path processing. |
src/fabric_cicd/fabric_workspace.py | Refactored parameter file refresh and replacement functions to use ParameterValidation. |
src/fabric_cicd/_items/_environment.py | Updated compute settings to handle new parameter formats and improved logging. |
src/fabric_cicd/_parameterization/_validate_parameter_file.py | Added a wrapper function for validating the parameter.yml file. |
This pull request introduces several changes to the
fabric_cicd
package, focusing on error handling, environment metadata updates, and parameter validation. The key changes include the addition of a new custom error class, updates to the environment metadata handling, and the introduction of a newParameter
class to validate deployment configuration files.Error Handling:
ParameterFileError
insrc/fabric_cicd/_common/_exceptions.py
.Environment Metadata:
_update_compute_settings
function insrc/fabric_cicd/_items/_environment.py
to include an additionalitem_name
parameter. [1] [2]_update_compute_settings
to handle both new and old parameter file formats, including validation of the parameter structure usingcheck_parameter_structure
.check_parameter_structure
fromfabric_cicd._parameter._utils
insrc/fabric_cicd/_items/_environment.py
.Parameter Validation:
Parameter
class insrc/fabric_cicd/_parameter/_parameter.py
to load and validate parameter files used for deployment configurations. This class includes methods for validating the existence, structure, and content of parameter files.Licensing:
src/fabric_cicd/_parameter/__init__.py
andsrc/fabric_cicd/_parameter/_parameter.py
. [1] [2]These changes enhance the robustness of the
fabric_cicd
package by improving error handling, ensuring accurate environment metadata updates, and validating deployment configurations.This pull request introduces several changes to improve parameter handling and validation in thefabric_cicd
package. The most important changes include adding new utility functions for parameter validation, updating compute settings to handle new parameter structures, and refactoring existing methods to incorporate these new utilities.Parameter handling improvements:
src/fabric_cicd/_parameterization/_parameterization_utils.py
: Added utility functions for loading, validating, and processing parameter files, as well as checking parameter structures and replacements.src/fabric_cicd/_parameterization/__init__.py
: Introduced a new module to provide tools for validating aParameter.yml
file and changing the log level.Updates to compute settings:
src/fabric_cicd/_items/_environment.py
: Modified_update_compute_settings
to handle new parameter structures and include theitem_name
argument for better parameter matching. [1] [2] [3]Refactoring for parameter validation:
src/fabric_cicd/fabric_workspace.py
: Refactored_refresh_parameter_file
to useParameterValidation
for loading and validating parameters. Updated_replace_parameters
to handle both new and old parameter structures and include additional arguments for better parameter matching. [1] [2] [3]Additional changes:
src/fabric_cicd/_items/_environment.py
: Importedcheck_parameter_structure
from the new utilities module.src/fabric_cicd/fabric_workspace.py
: Removed unusedyaml
import.This pull request includes several changes to thefabric_cicd
module, focusing on enhancing parameterization utilities, updating compute settings, and improving logging and validation mechanisms. The most important changes include adding new utility functions for parameter handling, modifying compute settings updates, and introducing a new logging configuration.Parameterization Utilities Enhancements:
src/fabric_cicd/_parameterization/_parameterization_utils.py
: Added new utility functions for loading parameters, validating YAML content, checking parameter structures, processing input paths, and determining replacement conditions.src/fabric_cicd/_parameterization/__init__.py
: Added a new module to provide tools for validating aParameter.yml
file and changing log levels.src/fabric_cicd/_parameterization/_validate_parameter_file.py
: Introduced a wrapper function to validate aparameter.yml
file using theParameterValidation
class.Compute Settings Updates:
src/fabric_cicd/_items/_environment.py
: Modified the_update_compute_settings
function to handle new and old parameter file formats and include theitem_name
argument. [1] [2] [3]Logging and Validation Improvements:
src/fabric_cicd/fabric_workspace.py
: Updated the_refresh_parameter_file
method to use the newload_parameters_to_dict
utility function and replaced the_replace_parameters
method with_replace_parameters_v2
for improved parameter replacement handling. [1] [2] [3]These changes aim to enhance the robustness and flexibility of the
fabric_cicd
module, particularly in handling parameter files and updating compute settings.