Skip to content

Feature: State Tracking to Remove Stale Assets #5

Description

@srbouffard

Feature: State Tracking to Remove Stale Assets

Problem

Currently, the install_collections.sh script only adds or overwrites files. If an asset is removed from a collection (or renamed), the old file remains in the consumer's repository as a "dangling" file.

Proposed Solution

Implement a state tracking mechanism using a file named .github/.copilot-collections.state.

Logic

  1. Cleanup Phase:
    • Read .github/.copilot-collections.state (if it exists).
    • Delete every file path listed in it.
  2. Install Phase:
    • Perform the installation as usual.
    • Keep a list of every file successfully written.
  3. Commit Phase:
    • Write the list of installed files to .github/.copilot-collections.state.

Considerations

  • The state file should be committed to the consumer repo so it persists across CI runs.
  • We must handle the case where a user manually deletes the state file (fallback to "add/overwrite only" mode).

Metadata

Metadata

Assignees

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