Skip to content

Uninstall a module with a FileCopy resource shouldn't delete the entire directory #1135

@isc-jlou

Description

@isc-jlou

Describe the bug

If a module copy files into a shared directory and you uninstall that module, the shared directory would be deleted. As an example, HealthConnect.FHIRMeta and HealthConnect.FHIRMeta.R5 both copy files into /dev/fhir/fhir-metadata/. I have a solution module that only needs HealthConnect.FHIRMeta. When I uninstall my solution module, the entire /dev/fhir/fhir-metadata/ directory is deleted.

To Reproduce

Steps to reproduce the behavior:

  1. Run IPM command 'install HealthConnect.FHIRMeta'
  2. Verify the following 3 packages are copied into instance directory /dev/fhir/fhir-metadata/packages: hl7.fhir.r3.core, hl7.fhir.r4.core, hl7.fhir.us.core
  3. Run IPM command 'install HealthConnect.FHIRMeta.R5'
  4. Verify the following 1 package is copied into instance directory /dev/fhir/fhir-metadata/packages: hl7.fhir.r5.core
  5. Run IPM command 'uninstall HealthConnect.FHIRMeta'
  6. Verify the issue: the entire /dev/fhir/fhir-metadata/ directory is deleted.

Expected Behavior

A FileCopy resource has Overlay=1 should keep track of its files and only delete those on uninstall instead of the entire directory. In this example, /dev/fhir/fhir-metadata/ should exist with 1 package: hl7.fhir.r5.core. Also, if an overlay=1 FileCopy sees an identically named existing file, show a warning, but don't fail.

System information (please complete the following information):

  • IPM version: 0.10.4
  • IRIS version: IRIS for UNIX (Apple macOS for Apple Silicon) 2025.1.2 (Build 349U)
  • OS: Apple macOS for Apple Silicon
  • Docker or local: local

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions