Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ Connect to various prompt sources:
### 📦 Bundle Management

- **Install/Uninstall**: Manage bundles through UI or commands
- **Version Control**: Track installed versions
- **Version Tracking**: Track installed versions with semantic versioning
- **Version Consolidation**: Multiple versions of the same bundle are grouped, showing only the latest
- **Update Detection**: Automatically detect when newer versions are available
- **Auto-Sync**: Automatic synchronization with GitHub Copilot
- **Conflict Resolution**: Handle duplicate bundles gracefully

Expand Down Expand Up @@ -339,8 +341,10 @@ Click filter buttons to show only:
```
Click on any bundle tile to see:
- Full description
- Current version and available versions
- Content breakdown (prompts, instructions, etc.)
- Installation information
- Update availability status
- Tags and metadata
- List of included files
```
Expand All @@ -350,9 +354,9 @@ Click on any bundle tile to see:
#### From Marketplace

1. **Browse** - Find a bundle in the marketplace
2. **Review** - Click the tile to view details
3. **Install** - Click the **Install** button
4. **Verify** - Check the installed badge appears
2. **Review** - Click the tile to view details and version information
3. **Install** - Click the **Install** button (or **Update** if a newer version is available)
4. **Verify** - Check the installed badge appears with version number

#### From Tree View

Expand Down Expand Up @@ -443,6 +447,35 @@ Features:
Right-click source in tree view → "Remove Source"
```

### Managing Bundle Versions

Prompt Registry uses semantic versioning to track and manage bundle versions.

#### Version Consolidation

When multiple versions of the same bundle exist (e.g., from GitHub releases), they are automatically consolidated:

- **Latest Version Shown**: The marketplace displays only the latest version of each bundle
- **Version History**: All available versions are tracked and accessible
- **Smart Grouping**: Bundles from the same repository are grouped by owner/repo identity

#### Update Detection

The extension automatically detects when updates are available:

```bash
# Check for updates
Right-click installed bundle → "Check for Updates"

# Update to latest version
Click "Update" button in marketplace or tree view
```

**Update Indicators:**
- 🔄 **Update Available** - Newer version detected
- ✅ **Up to Date** - Latest version installed
- 📦 **Not Installed** - Bundle not yet installed

### Working with Profiles

Profiles help organize bundles by project, team, or environment.
Expand Down Expand Up @@ -563,6 +596,7 @@ Ctrl+Shift+P → "View: Show Prompt Registry Explorer"
- View all installed bundles by scope (User/Workspace)
- Right-click for actions: View Details, Update, Uninstall, Check Updates
- See installation status and version information
- Visual indicators for available updates

**👥 My Profiles**
- Manage profile-based installations
Expand Down Expand Up @@ -760,6 +794,8 @@ graph TB
### Key Components

- **Registry Manager**: Orchestrates sources, bundles, and installations
- **Version Consolidator**: Groups multiple bundle versions and selects latest
- **Version Manager**: Semantic versioning operations and comparisons
- **Bundle Installer**: Handles extraction, validation, and installation
- **Copilot Sync**: Syncs bundles to GitHub Copilot directories
- **Adapters**: Source-specific implementations (GitHub, GitLab, etc.)
Expand Down Expand Up @@ -955,7 +991,13 @@ prompt-registry/
- 🔄 Community ratings and reviews
- 🔄 Repository level installation support
- 🔄 MCP Support (experimental at the moment)

- ✅ Bundle versioning with semantic version support
- ✅ Version consolidation (group multiple versions)
- ✅ Update detection and notifications
- 🔄 Automatic bundle updates
- 🔄 Version rollback
- 🔄 Dependency management
- 🔄 Bundle analytics

### Future

Expand Down
83 changes: 83 additions & 0 deletions docs/TESTING_STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,29 @@ E2E Tests: 20% of coverage
- Tag validation
- Error aggregation

#### **Property-Based Tests**
- ✅ `GitHubAdapter.property.test.ts` - 1250+ lines
- Authentication priority order (15 properties)
- Auth error cache invalidation
- Exhaustion summary and method listing
- Content-Type validation
- HTML error recognition and extraction
- Graceful JSON parsing
- Comprehensive error logging
- Token sanitization in logs
- Error-specific suggestions
- Uses shared helpers from `test/helpers/propertyTestHelpers.ts`

#### **Test Helpers**
- ✅ `test/helpers/propertyTestHelpers.ts` - Shared utilities
- `ErrorCheckers` - Error message validation patterns
- `LoggerHelpers` - Logger interaction utilities
- `PropertyTestConfig` - Centralized test configuration
- `createMockHttpResponse` - HTTP response mocking
- `stubHttpsWithResponse` - HTTPS module stubbing
- `TestGenerators` - Fast-check data generators
- Reusable across all adapter property tests

---

### **2. Integration Tests** (~/src/test/integration/)
Expand Down Expand Up @@ -181,6 +204,66 @@ E2E Tests: 20% of coverage
| **nock** | HTTP mocking | ✅ Installed |
| **c8** | Coverage reporting | ✅ Installed |
| **@vscode/test-electron** | VSCode testing | ✅ Installed |
| **fast-check** | Property-based testing | ✅ Installed |
| **sinon** | Test mocking and stubbing | ✅ Installed |

### **Shared Test Helpers**

The project includes reusable test utilities in `test/helpers/`:

- **`propertyTestHelpers.ts`** - Property-based test utilities
- `ErrorCheckers` - Validates error message patterns (HTML detection, auth issues, parsing errors)
- `LoggerHelpers` - Manages logger stub interactions (reset, collect calls, search logs)
- `PropertyTestConfig` - Centralized configuration (run counts, timeouts, fast-check options)
- `createMockHttpResponse` - Creates mock HTTP responses with proper event handling
- `stubHttpsWithResponse` - Stubs HTTPS module for isolated testing
- `TestGenerators` - Fast-check generators (tokens, URLs, status codes, content types)

**Usage Example**:
```typescript
import { ErrorCheckers, LoggerHelpers, PropertyTestConfig } from '../helpers/propertyTestHelpers';

// Use shared error checkers
if (ErrorCheckers.indicatesAuthIssue(error)) { ... }

// Use logger helpers
const loggerHelpers = new LoggerHelpers(loggerStub);
loggerHelpers.resetHistory();
if (loggerHelpers.hasLogContaining('authentication')) { ... }

// Use shared configuration
test('My Property Test', async function() {
this.timeout(PropertyTestConfig.TIMEOUT);
await fc.assert(
fc.asyncProperty(...),
{ numRuns: PropertyTestConfig.RUNS.STANDARD, ...PropertyTestConfig.FAST_CHECK_OPTIONS }
);
});
```

### **Logging in Tests**

The Logger supports configurable log levels via the `LOG_LEVEL` environment variable:

- **Environment Variable**: `LOG_LEVEL=ERROR` (must be set when running tests)
- **Suppressed Levels**: `DEBUG`, `INFO`, `WARN` are suppressed when `LOG_LEVEL=ERROR`
- **Rationale**: Keeps test output clean and focused on test results
- **Error Logs**: Only ERROR level logs appear, which helps identify actual issues
- **Override**: Can be changed by setting `LOG_LEVEL` to `DEBUG`, `INFO`, `WARN`, or `NONE`

**Running Tests with Suppressed Logging**:
```bash
# Always prefix test commands with LOG_LEVEL=ERROR
LOG_LEVEL=ERROR npm test
LOG_LEVEL=ERROR npm run test:unit
LOG_LEVEL=ERROR npm run test:integration
LOG_LEVEL=ERROR npm run test:coverage
```

**Property-Based Tests**:
- Use `verbose: false` in fast-check options to minimize output
- Only log meaningful information when tests fail
- Avoid logging during successful test iterations

### **Test Scripts**

Expand Down
Loading