Skip to content

fix: show cicd version is available message only for deploy command#223

Open
aviatco wants to merge 2 commits intomicrosoft:mainfrom
aviatco:dev/aviatcohen/lazyload-fabric-cicd
Open

fix: show cicd version is available message only for deploy command#223
aviatco wants to merge 2 commits intomicrosoft:mainfrom
aviatco:dev/aviatcohen/lazyload-fabric-cicd

Conversation

@aviatco
Copy link
Copy Markdown
Collaborator

@aviatco aviatco commented Apr 27, 2026

📥 Pull Request

✨ Description of new changes

This pull request fixes an issue where the "New cicd version available" message was shown outside of the intended context. Now, the message will only appear when the deploy command is used. Additionally, the import of certain fabric_cicd functions has been moved inside the relevant function for better scope management.

Bug fix:

  • The "New cicd version available" message is now shown only for the deploy command, preventing it from appearing in unrelated contexts. (.changes/unreleased/fixed-20260427-141642.yaml)

Code organization:

  • Moved the import of fabric_cicd functions (append_feature_flag, configure_external_file_logging, deploy_with_config, disable_file_logging) inside the deploy_with_config_file function in fab_fs_deploy_config_file.py to limit their scope and potentially improve performance. [1] [2]

Copilot AI review requested due to automatic review settings April 27, 2026 14:20
@aviatco aviatco requested a review from a team as a code owner April 27, 2026 14:20
Copy link
Copy Markdown
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 PR adjusts the Fabric CLI deploy flow so that fabric_cicd is only imported when the deploy command actually runs, preventing import-time side effects (like the “New cicd version available” message) from appearing during unrelated commands.

Changes:

  • Moved fabric_cicd imports from module scope into deploy_with_config_file(...) to avoid import-time side effects outside deploy.
  • Added a Changie “fixed” unreleased entry documenting the behavior change.

Reviewed changes

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

File Description
src/fabric_cli/commands/fs/deploy/fab_fs_deploy_config_file.py Delays fabric_cicd import until deploy execution to avoid cross-command side effects.
.changes/unreleased/fixed-20260427-141642.yaml Release note entry describing the bug fix.

Comment on lines +17 to 19
from fabric_cicd import append_feature_flag, configure_external_file_logging, deploy_with_config, disable_file_logging # type: ignore

try:
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

The local fabric_cicd import is placed before the try: block, so ImportError/ModuleNotFoundError (or other import-time errors) will bypass the existing error wrapping and surface as an unhandled exception/traceback. Move the import into the try: (or catch ImportError explicitly and raise a FabricCLIError) so failures are reported consistently as Deployment failed.

Suggested change
from fabric_cicd import append_feature_flag, configure_external_file_logging, deploy_with_config, disable_file_logging # type: ignore
try:
try:
from fabric_cicd import append_feature_flag, configure_external_file_logging, deploy_with_config, disable_file_logging # type: ignore

Copilot uses AI. Check for mistakes.

def deploy_with_config_file(args: Namespace) -> None:
"""deploy fabric items to a workspace using a configuration file and target environment - delegates to CICD library."""
from fabric_cicd import append_feature_flag, configure_external_file_logging, deploy_with_config, disable_file_logging # type: ignore
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

This change is meant to prevent the CICD "new version available" message from showing up for non-deploy commands (by avoiding import-time side effects). There doesn’t appear to be a regression test asserting that running another fs command (e.g., ls) does not trigger the fabric_cicd import / message; adding such a test would help prevent this from coming back.

Copilot uses AI. Check for mistakes.
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.

2 participants