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
- Cleanup Phase:
- Read
.github/.copilot-collections.state (if it exists).
- Delete every file path listed in it.
- Install Phase:
- Perform the installation as usual.
- Keep a list of every file successfully written.
- 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).
Feature: State Tracking to Remove Stale Assets
Problem
Currently, the
install_collections.shscript 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
.github/.copilot-collections.state(if it exists)..github/.copilot-collections.state.Considerations