Skip to content

Fixes #980 - Fix empty items_to_include list causing full deployment#986

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-empty-list-deployment
Open

Fixes #980 - Fix empty items_to_include list causing full deployment#986
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-empty-list-deployment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Description

Passing items_to_include=[] to publish_all_items deploys everything instead of nothing. Root cause: truthiness checks (if not items_to_include) treat None and [] identically, but they have different semantics—None means "no filter" while [] means "include nothing."

Fixes:

  • publish.py: Three checks changed from truthiness (if items_to_include:, if not items_to_include) to explicit is None checks
  • _base_publisher.py: get_items_to_publish() now returns empty dict for [] instead of all items
  • test_publish.py: Added test_empty_items_to_include_skips_all_items
# Before: [] is falsy, so this block is skipped — items_to_include never set on workspace
if items_to_include:
    fabric_workspace_obj.items_to_include = items_to_include

# After: only skip when caller didn't pass the parameter at all
if items_to_include is not None:
    fabric_workspace_obj.items_to_include = items_to_include

Linked Issue (REQUIRED)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • releases.astral.sh
    • Triggering command: /home/REDACTED/.local/bin/uv uv sync --dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Agent-Logs-Url: https://github.com/microsoft/fabric-cicd/sessions/dd81c437-41a6-48ee-87c9-35cf31629590

Co-authored-by: shirasassoon <66449905+shirasassoon@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deployment issue when passing empty list to items_to_include Fixes #924 - Fix empty items_to_include list causing full deployment May 13, 2026
Copilot AI requested a review from shirasassoon May 13, 2026 07:34
@shirasassoon shirasassoon changed the title Fixes #924 - Fix empty items_to_include list causing full deployment Fixes #980 - Fix empty items_to_include list causing full deployment May 13, 2026
@shirasassoon shirasassoon marked this pull request as ready for review May 13, 2026 07:57
Copilot AI review requested due to automatic review settings May 13, 2026 07:57
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 fixes a behavioral bug in selective publishing/unpublishing where passing items_to_include=[] was treated the same as None, causing the library to deploy (or consider) all items instead of none. It aligns items_to_include handling with the established semantics: None = no filter, [] = include nothing.

Changes:

  • Update items_to_include checks from truthiness to explicit is None checks in publish_all_items() and unpublish_all_orphan_items().
  • Fix core publisher filtering so items_to_include=[] returns an empty publish set (instead of all items).
  • Add a regression test ensuring items_to_include=[] results in all repository items being marked skip_publish=True.

Reviewed changes

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

Show a summary per file
File Description
src/fabric_cicd/publish.py Uses explicit is None checks so [] is treated as “include nothing” rather than “no filter”.
src/fabric_cicd/_items/_base_publisher.py Fixes get_items_to_publish() to return an empty dict for items_to_include=[].
tests/test_publish.py Adds regression coverage for items_to_include=[] skipping all items.
src/fabric_cicd/fabric_workspace.py Minor formatting change (single-line endpoint call).
.changes/unreleased/fixed-20260513-105123.yaml Adds changelog fragment describing the fix.

Comment thread src/fabric_cicd/publish.py
Comment thread tests/test_publish.py
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.

[BUG] Pass empty list to items_to_include cause full deployment

3 participants