Feature: Add remote Git catalogs, and renaming of "Hats" to "Presets"+ new integration tests + changlog#18
Merged
Conversation
Add GitCatalogService and instantiate during activation. Introduce commands: - copilotCatalog.dev.scanGitRepository (clone, scan, select catalogs, update config) - copilotCatalog.dev.refreshGitRepositories (initial support) Persist remote metadata and discovered catalog directories. Validate Git availability and restrict to HTTPS for initial MVP. Bump extension version to 0.3.6. Motivation: enable discovering and selectively importing catalog folders from external Git repos to streamline catalog curation and reuse.
This commit introduces a significant terminology change across the extension, renaming "Hats" to "Presets". This change is intended to make the feature's purpose more intuitive and align with more common industry language for saved configurations or templates. Key changes include: - Renaming all instances of "hat" and "hats" to "preset" and "presets" in the UI, commands, and internal code. - Updating associated icons and file names (e.g., `hat-dark.svg` to `preset-dark.svg`). - Renaming the example catalog directory from `hats` to `presets`. - Adding `.clinerules/` to `.gitignore`.
- Updated terminology in the codebase, documentation, and UI to replace "Hats" with "Presets". - Enhanced Git Catalog features including branch enumeration, commit locking, and interactive refresh flow. - Added new service APIs for managing presets. - Updated README and CHANGELOG to reflect changes and new features. - Added integration tests for new preset functionality.
This change reorganizes the options tree for better usability by moving Git-related commands into a dedicated submenu. - Creates a new 'Git Repositories' submenu under the 'Catalog' section. - Moves 'Scan Git Repository', 'Refresh Git Repositories', and 'List Git Remotes' from the 'Developer' section into the new submenu. - Renames 'Refresh' to 'Refresh All Catalogs' for clarity.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a comprehensive renaming of "Hats" to "Presets" throughout the extension, introduces powerful Git catalog features with branch management and commit locking capabilities, and adds integration testing infrastructure. The changes maintain backward compatibility while significantly enhancing the Git-based catalog functionality.
Key changes include:
- Complete "Hats" to "Presets" terminology update across all user-facing elements and internal code
- New Git catalog features: branch enumeration, commit locking, and interactive update management
- Integration test suite with real file system operations testing
Reviewed Changes
Copilot reviewed 16 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/testUtils.ts | Updates expected targets to use 'presets' instead of 'hats' directory |
| test/real.integration.test.ts | New integration test suite using actual FileService for real file system operations |
| test/presets.test.ts | Renamed from hats.test.ts with updated PresetService references |
| test/hats.test.ts | Removed file (renamed to presets.test.ts) |
| test/gitCatalog.integration.test.ts | New comprehensive test suite for Git catalog functionality including branch listing and commit locking |
| test/fileService.mock.ts | Enhanced mock with new directory deletion and recursive removal methods |
| src/utils/security.ts | Improved path sanitization regex patterns |
| src/tree/optionsTreeProvider.ts | Updated UI labels and added Git repository management options with tooltips |
| src/services/presetService.ts | Renamed from hatService.ts with complete terminology updates |
| src/services/gitCatalogService.ts | New service implementing Git catalog management with branch enumeration and commit locking |
| src/services/fileService.ts | Simplified implementation with new rm method and updated encoding specification |
| src/models.ts | Updated type definitions from Hat/HatSource to Preset/PresetSource |
| src/extension.ts | Major updates: integrated Git catalog service, renamed preset commands, added Git repository management commands |
| package.json | Version bump to 0.4.0, command renames, and updated test script |
| README.md | Documentation updates reflecting "Presets" terminology |
| CHANGELOG.md | Comprehensive changelog for v0.4.0 with all new features and changes |
Introduces the `PresetQuickPickItem` interface to provide strong typing for the preset selection UI. This removes the need for `any` type assertions when applying or deleting presets, improving type safety and code readability. Additionally, this change adds a validation step in the `GitCatalogService` to ensure that a `lockedCommit` in a remote catalog's configuration points to a valid commit object. This prevents errors if the `lockedCommit` references a tag that is not a commit or an invalid object.
The `verify-version-sync.js` script now errors and exits with a non-zero status code if a version mismatch is detected between `package.json` and `source.extension.vsixmanifest`. Previously, the script would automatically update the manifest, which could hide versioning issues in CI environments. The new behavior ensures that verification steps fail as expected. To retain the auto-fixing functionality, a `--fix` flag has been introduced. A corresponding `npm run fix:version` script has been added to `package.json` for convenience. Additionally, this commit includes: - Refactoring in `MockFileService` to use a more robust path comparison method. - Improved error handling in the integration test runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major update focused on renaming "Hats" to "Presets" throughout the extension, adding significant new Git Catalog features, and bumping the version to 0.4.0. It also includes new integration tests and updates to documentation and commands to reflect these changes.
Presets Rename and UI/Command Updates:
package.json,README.md,src/extension.ts, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]Git Catalog Enhancements:
git ls-remote --headswith a quick pick UI when adding a remote repository, and introduced the ability to lock a remote to a specific commit SHA, preventing automatic branch updates. (CHANGELOG.md, CHANGELOG.mdR10-R43)CHANGELOG.md, CHANGELOG.mdR10-R43)Testing and Integration:
test/real.integration.test.ts) that uses the actualFileServiceto verify file system operations, and updated thetest:integrationscript to run this new suite. (CHANGELOG.md,package.json, [1] [2]Versioning and Metadata:
lockedCommitfield and upgrade logic. (CHANGELOG.md,package.json, [1] [2]Documentation Improvements:
README.mdto reflect the rename to "Presets," revised usage instructions, sample structures, troubleshooting, and configuration examples accordingly. (README.md, [1] [2] [3] [4] [5] [6] [7]These changes collectively improve clarity, add powerful new Git Catalog features, and ensure the extension's terminology and documentation are consistent and up-to-date.