Skip to content

Commit df5bb31

Browse files
authored
fix: installation of versioned bundle with github type
Adding the versionning and proper display in marketplace viewer
1 parent a7c79d3 commit df5bb31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+9326
-538
lines changed

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ Connect to various prompt sources:
205205
### 📦 Bundle Management
206206

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

@@ -339,8 +341,10 @@ Click filter buttons to show only:
339341
```
340342
Click on any bundle tile to see:
341343
- Full description
344+
- Current version and available versions
342345
- Content breakdown (prompts, instructions, etc.)
343346
- Installation information
347+
- Update availability status
344348
- Tags and metadata
345349
- List of included files
346350
```
@@ -350,9 +354,9 @@ Click on any bundle tile to see:
350354
#### From Marketplace
351355

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

357361
#### From Tree View
358362

@@ -443,6 +447,35 @@ Features:
443447
Right-click source in tree view → "Remove Source"
444448
```
445449

450+
### Managing Bundle Versions
451+
452+
Prompt Registry uses semantic versioning to track and manage bundle versions.
453+
454+
#### Version Consolidation
455+
456+
When multiple versions of the same bundle exist (e.g., from GitHub releases), they are automatically consolidated:
457+
458+
- **Latest Version Shown**: The marketplace displays only the latest version of each bundle
459+
- **Version History**: All available versions are tracked and accessible
460+
- **Smart Grouping**: Bundles from the same repository are grouped by owner/repo identity
461+
462+
#### Update Detection
463+
464+
The extension automatically detects when updates are available:
465+
466+
```bash
467+
# Check for updates
468+
Right-click installed bundle → "Check for Updates"
469+
470+
# Update to latest version
471+
Click "Update" button in marketplace or tree view
472+
```
473+
474+
**Update Indicators:**
475+
- 🔄 **Update Available** - Newer version detected
476+
-**Up to Date** - Latest version installed
477+
- 📦 **Not Installed** - Bundle not yet installed
478+
446479
### Working with Profiles
447480

448481
Profiles help organize bundles by project, team, or environment.
@@ -563,6 +596,7 @@ Ctrl+Shift+P → "View: Show Prompt Registry Explorer"
563596
- View all installed bundles by scope (User/Workspace)
564597
- Right-click for actions: View Details, Update, Uninstall, Check Updates
565598
- See installation status and version information
599+
- Visual indicators for available updates
566600
567601
**👥 My Profiles**
568602
- Manage profile-based installations
@@ -760,6 +794,8 @@ graph TB
760794
### Key Components
761795

762796
- **Registry Manager**: Orchestrates sources, bundles, and installations
797+
- **Version Consolidator**: Groups multiple bundle versions and selects latest
798+
- **Version Manager**: Semantic versioning operations and comparisons
763799
- **Bundle Installer**: Handles extraction, validation, and installation
764800
- **Copilot Sync**: Syncs bundles to GitHub Copilot directories
765801
- **Adapters**: Source-specific implementations (GitHub, GitLab, etc.)
@@ -955,7 +991,13 @@ prompt-registry/
955991
- 🔄 Community ratings and reviews
956992
- 🔄 Repository level installation support
957993
- 🔄 MCP Support (experimental at the moment)
958-
994+
- ✅ Bundle versioning with semantic version support
995+
- ✅ Version consolidation (group multiple versions)
996+
- ✅ Update detection and notifications
997+
- 🔄 Automatic bundle updates
998+
- 🔄 Version rollback
999+
- 🔄 Dependency management
1000+
- 🔄 Bundle analytics
9591001
9601002
### Future
9611003

docs/TESTING_STRATEGY.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,29 @@ E2E Tests: 20% of coverage
130130
- Tag validation
131131
- Error aggregation
132132

133+
#### **Property-Based Tests**
134+
-`GitHubAdapter.property.test.ts` - 1250+ lines
135+
- Authentication priority order (15 properties)
136+
- Auth error cache invalidation
137+
- Exhaustion summary and method listing
138+
- Content-Type validation
139+
- HTML error recognition and extraction
140+
- Graceful JSON parsing
141+
- Comprehensive error logging
142+
- Token sanitization in logs
143+
- Error-specific suggestions
144+
- Uses shared helpers from `test/helpers/propertyTestHelpers.ts`
145+
146+
#### **Test Helpers**
147+
-`test/helpers/propertyTestHelpers.ts` - Shared utilities
148+
- `ErrorCheckers` - Error message validation patterns
149+
- `LoggerHelpers` - Logger interaction utilities
150+
- `PropertyTestConfig` - Centralized test configuration
151+
- `createMockHttpResponse` - HTTP response mocking
152+
- `stubHttpsWithResponse` - HTTPS module stubbing
153+
- `TestGenerators` - Fast-check data generators
154+
- Reusable across all adapter property tests
155+
133156
---
134157

135158
### **2. Integration Tests** (~/src/test/integration/)
@@ -181,6 +204,66 @@ E2E Tests: 20% of coverage
181204
| **nock** | HTTP mocking | ✅ Installed |
182205
| **c8** | Coverage reporting | ✅ Installed |
183206
| **@vscode/test-electron** | VSCode testing | ✅ Installed |
207+
| **fast-check** | Property-based testing | ✅ Installed |
208+
| **sinon** | Test mocking and stubbing | ✅ Installed |
209+
210+
### **Shared Test Helpers**
211+
212+
The project includes reusable test utilities in `test/helpers/`:
213+
214+
- **`propertyTestHelpers.ts`** - Property-based test utilities
215+
- `ErrorCheckers` - Validates error message patterns (HTML detection, auth issues, parsing errors)
216+
- `LoggerHelpers` - Manages logger stub interactions (reset, collect calls, search logs)
217+
- `PropertyTestConfig` - Centralized configuration (run counts, timeouts, fast-check options)
218+
- `createMockHttpResponse` - Creates mock HTTP responses with proper event handling
219+
- `stubHttpsWithResponse` - Stubs HTTPS module for isolated testing
220+
- `TestGenerators` - Fast-check generators (tokens, URLs, status codes, content types)
221+
222+
**Usage Example**:
223+
```typescript
224+
import { ErrorCheckers, LoggerHelpers, PropertyTestConfig } from '../helpers/propertyTestHelpers';
225+
226+
// Use shared error checkers
227+
if (ErrorCheckers.indicatesAuthIssue(error)) { ... }
228+
229+
// Use logger helpers
230+
const loggerHelpers = new LoggerHelpers(loggerStub);
231+
loggerHelpers.resetHistory();
232+
if (loggerHelpers.hasLogContaining('authentication')) { ... }
233+
234+
// Use shared configuration
235+
test('My Property Test', async function() {
236+
this.timeout(PropertyTestConfig.TIMEOUT);
237+
await fc.assert(
238+
fc.asyncProperty(...),
239+
{ numRuns: PropertyTestConfig.RUNS.STANDARD, ...PropertyTestConfig.FAST_CHECK_OPTIONS }
240+
);
241+
});
242+
```
243+
244+
### **Logging in Tests**
245+
246+
The Logger supports configurable log levels via the `LOG_LEVEL` environment variable:
247+
248+
- **Environment Variable**: `LOG_LEVEL=ERROR` (must be set when running tests)
249+
- **Suppressed Levels**: `DEBUG`, `INFO`, `WARN` are suppressed when `LOG_LEVEL=ERROR`
250+
- **Rationale**: Keeps test output clean and focused on test results
251+
- **Error Logs**: Only ERROR level logs appear, which helps identify actual issues
252+
- **Override**: Can be changed by setting `LOG_LEVEL` to `DEBUG`, `INFO`, `WARN`, or `NONE`
253+
254+
**Running Tests with Suppressed Logging**:
255+
```bash
256+
# Always prefix test commands with LOG_LEVEL=ERROR
257+
LOG_LEVEL=ERROR npm test
258+
LOG_LEVEL=ERROR npm run test:unit
259+
LOG_LEVEL=ERROR npm run test:integration
260+
LOG_LEVEL=ERROR npm run test:coverage
261+
```
262+
263+
**Property-Based Tests**:
264+
- Use `verbose: false` in fast-check options to minimize output
265+
- Only log meaningful information when tests fail
266+
- Avoid logging during successful test iterations
184267

185268
### **Test Scripts**
186269

0 commit comments

Comments
 (0)