Skip to content

Profile XML modifications not shown in changed-file filter #30

Description

@TsekNet

Problem

When a profile XML file is modified (not added or deleted), fleet-plan's --git mode does not report the change. Only new profiles and deleted profiles are shown.

Root Cause

Two issues in internal/diff/differ.go:

  1. buildSourceMap() does not include p.Path (the profile XML file path) in the source-to-name mapping. When git reports a changed XML file, filterResourceDiff cannot match it to any profile name, so the change is silently filtered out.

  2. diffProfiles() only detects added and deleted profiles. Since the Fleet API does not return profile content, there is no content comparison, so modifications to existing profiles are never detected.

Fix

  1. Add p.Path to buildSourceMap() for profiles, matching the pattern used for software packages and fleet-maintained apps.
  2. Pass changedFiles into diffProfiles() so that when a profile exists in both current and proposed state, but its XML path appears in the git changed-files list, it is reported as modified.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions