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 #173 Update Environment Deployment #157

Closed

Conversation

JacobKnightley
Copy link
Collaborator

This pull request includes significant changes to the src/fabric_cicd/_items/_environment.py file, focusing on simplifying the code and removing unnecessary functions. The changes include removing unused imports, refactoring the publish_environments function, and deleting several helper functions.

Code simplification and refactoring:

  • src/fabric_cicd/_items/_environment.py: Removed unused imports and redundant comments.
  • src/fabric_cicd/_items/_environment.py: Refactored the publish_environments function to use item_guid instead of item_name and simplified the publishing process by removing the _publish_environment_metadata function.
  • src/fabric_cicd/_items/_environment.py: Removed several helper functions (_check_environment_publish_state, _update_compute_settings, _get_repo_libraries, _add_libraries, _remove_libraries, _remove_library, _convert_environment_compute_to_camel) that were no longer needed after the refactor.

Behavioral change:

  • src/fabric_cicd/fabric_workspace.py: Updated the _publish_item function to exclude "Environment" from the shell_only_publish list, ensuring that environments are fully published.

@Copilot Copilot bot review requested due to automatic review settings March 14, 2025 00:39
@JacobKnightley JacobKnightley requested a review from a team as a code owner March 14, 2025 00:39
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 pull request simplifies and refactors the environment deployment code by removing unused imports and helper functions, and updating the publishing process to rely on item GUIDs. Key changes include:

  • Removal of unused imports and redundant comments in src/fabric_cicd/_items/_environment.py.
  • Refactoring of the publish_environments function to utilize item_guid and a simplified publish process.
  • Update to fabric_workspace.py to remove “Environment” from the shell-only publishing which ensures that environments are fully published.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/fabric_cicd/_items/_environment.py Refactored the environment publish function and removed helpers.
src/fabric_cicd/fabric_workspace.py Adjusted shell_only_publish logic to fully publish environments.
Comments suppressed due to low confidence (3)

src/fabric_cicd/_items/_environment.py:45

  • The refactoring removes the previous publish state check and retry logic, which could lead to unhandled errors if the publish endpoint call fails. Consider adding error handling or retry logic to account for potential failures.
fabric_workspace_obj.endpoint.invoke(

src/fabric_cicd/fabric_workspace.py:369

  • Removing 'Environment' from the shell_only_publish list changes the deployment behavior. Verify that this change aligns with the intended full publish requirement for environments.
shell_only_publish = item_type in ["Lakehouse"]

src/fabric_cicd/_items/_environment.py:34

  • [nitpick] The docstring for _publish_environment still mentions publishing compute settings and libraries, but the implementation only performs an endpoint invocation. Update the docstring to accurately reflect the current functionality.
def _publish_environment(fabric_workspace_obj: FabricWorkspace, item_guid: str) -> None:

@jmuziki jmuziki changed the title Update Environment Deployment Resolves #173 Update Environment Deployment Mar 20, 2025
@jmuziki jmuziki linked an issue Mar 20, 2025 that may be closed by this pull request
@jmuziki jmuziki closed this Mar 28, 2025
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.

Support new environment API
2 participants