Skip to content
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

Merged
merged 38 commits into from
Mar 24, 2025

Conversation

shirasassoon
Copy link
Contributor

@shirasassoon shirasassoon commented Feb 26, 2025

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 new Parameter class to validate deployment configuration files.

Error Handling:

  • Added a new custom error class ParameterFileError in src/fabric_cicd/_common/_exceptions.py.

Environment Metadata:

  • Updated _update_compute_settings function in src/fabric_cicd/_items/_environment.py to include an additional item_name parameter. [1] [2]
  • Modified _update_compute_settings to handle both new and old parameter file formats, including validation of the parameter structure using check_parameter_structure.
  • Imported check_parameter_structure from fabric_cicd._parameter._utils in src/fabric_cicd/_items/_environment.py.

Parameter Validation:

  • Introduced a new Parameter class in src/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:

  • Added copyright and licensing information to src/fabric_cicd/_parameter/__init__.py and src/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 the fabric_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:

Updates to compute settings:

Refactoring for parameter validation:

  • src/fabric_cicd/fabric_workspace.py: Refactored _refresh_parameter_file to use ParameterValidation 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: Imported check_parameter_structure from the new utilities module.
  • src/fabric_cicd/fabric_workspace.py: Removed unused yaml import.This pull request includes several changes to the fabric_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:

Compute Settings Updates:

Logging and Validation Improvements:

  • src/fabric_cicd/fabric_workspace.py: Updated the _refresh_parameter_file method to use the new load_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.

@shirasassoon shirasassoon marked this pull request as ready for review March 18, 2025 15:05
@Copilot Copilot bot review requested due to automatic review settings March 18, 2025 15:05
@shirasassoon shirasassoon requested a review from a team as a code owner March 18, 2025 15:05
Copy link
Contributor

@Copilot 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 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.

JacobKnightley
JacobKnightley previously approved these changes Mar 24, 2025
@shirasassoon shirasassoon merged commit 561ab1f into microsoft:main Mar 24, 2025
6 checks passed
@shirasassoon shirasassoon deleted the refactor_parameterization branch March 24, 2025 22:09
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.

3 participants