Skip to content

Feature/add gh rep branch catalogs#19

Merged
joninafta merged 10 commits into
mainfrom
feature/add-gh-rep-branch-catalogs
Sep 23, 2025
Merged

Feature/add gh rep branch catalogs#19
joninafta merged 10 commits into
mainfrom
feature/add-gh-rep-branch-catalogs

Conversation

@joninafta

Copy link
Copy Markdown
Contributor

No description provided.

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.
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 commit introduces `dotenv` and `dotenv-cli` to streamline the process of publishing the extension to the VS Code Marketplace.

New npm scripts, `publish:prerelease` and `publish:stable`, use `dotenv` to load a personal access token from a local `.env` file, simplifying the release workflow.

To prevent accidental exposure of secrets, the `.env` file has been added to `.vscodeignore`. Additionally, other build and packaging scripts have been updated for consistency.
Copilot AI review requested due to automatic review settings September 23, 2025 04:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Git-based catalog support for the ContextShare extension, allowing users to discover and manage AI resource catalogs from remote Git repositories. It also renames "Hats" to "Presets" throughout the codebase for better clarity.

Key changes:

  • New Git catalog service with branch enumeration, commit locking, and interactive refresh capabilities
  • Complete rename from "Hats" to "Presets" for resource bundling feature
  • Enhanced test coverage with real file system integration tests

Reviewed Changes

Copilot reviewed 20 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/services/gitCatalogService.ts New service for Git-based catalog discovery and management with branch tracking/locking
src/services/presetService.ts Renamed from hatService.ts with updated terminology throughout
src/extension.ts Added Git catalog commands and updated preset-related functionality
test/gitCatalog.integration.test.ts Comprehensive test suite for Git catalog functionality
test/real.integration.test.ts New integration tests using actual file system operations
src/utils/security.ts Fixed regex patterns in path sanitization

Comment thread src/utils/security.ts
@joninafta
joninafta enabled auto-merge (squash) September 23, 2025 04:36
@joninafta joninafta self-assigned this Sep 23, 2025
@joninafta
joninafta requested a review from Copilot September 23, 2025 04:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 20 out of 25 changed files in this pull request and generated no new comments.

@joninafta
joninafta disabled auto-merge September 23, 2025 04:43
@joninafta
joninafta merged commit b6ac78d into main Sep 23, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants