Skip to content

Closes #865 - Add get_changed_items() utility for git-based selective deployment#891

Open
vipulb91 wants to merge 2 commits intomicrosoft:mainfrom
vipulb91:feature/get-changed-items
Open

Closes #865 - Add get_changed_items() utility for git-based selective deployment#891
vipulb91 wants to merge 2 commits intomicrosoft:mainfrom
vipulb91:feature/get-changed-items

Conversation

@vipulb91
Copy link
Copy Markdown

Description

Briefly describe what this PR does and why.

Adds a new public utility function get_changed_items() to support git-based selective deployment of Fabric items.

Linked Issue (REQUIRED)

#865

Motivation

Closes #865. Users running CI/CD pipelines with fetchDepth: 2 (or similar shallow clones) want to deploy only the items that changed in a given commit/ref, rather than publishing all items every time.

## Approach (Option 2 — Decoupled) - Discussed in comment section with @shirasassoon

Rather than adding changed_only / git_compare_ref parameters directly to publish_all_items() and unpublish_all_orphan_items() (Option 1), this PR exposes the git-diff logic as a standalone utility function. This keeps the core publishing functions clean and allows users to compose the deployment logic themselves.

New API

from fabric_cicd import get_changed_items

changed = get_changed_items(repository_directory, git_compare_ref="HEAD~1")
# Returns a list of item names that were added/modified/renamed

if changed:
    publish_all_items(workspace, items_to_include=changed)

@vipulb91
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Add changed_only support for git-diff-based selective deployment

1 participant