diff --git a/CHANGELOG.md b/CHANGELOG.md index d27e4e3..f4e7ed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Version Extraction Script** (`scripts/extract-version.sh`) - Dynamically extracts version from template and current dates - **Documentation Update Script** (`scripts/update-versions.sh`) - Automatically updates version references in README.md - **Master Version Management** (`scripts/manage-versions.sh`) - Unified interface for version show/check/sync/update operations -- **Comprehensive Automated Testing Infrastructure** - Complete test framework for all repository scripts with 54 tests (Fixes #16) - - **Test Runner** (`tests/test-runner.sh`) - Main test execution framework with isolated environments and detailed reporting - - **Script-Specific Test Suites** - Dedicated test files for each script covering unit, integration, and error scenarios - - **GitHub Actions Workflow** (`.github/workflows/test-scripts.yml`) - Automated CI/CD testing on push, PRs, and scheduled runs - - **Testing Documentation** (`TESTING.md`) - Comprehensive guide for test framework usage and maintenance - - **Test Coverage** - 9 tests for extract-version.sh, 13 for manage-versions.sh, 11 for update-versions.sh, 11 for check-template-version.sh, 10 integration tests +- **Comprehensive GitHub Copilot Setup Guide** - New "Prerequisites & Basic GitHub Copilot Setup" section with step-by-step instructions (Fixes #18) +- **Multi-Editor Installation Guide** - Support for VS Code, JetBrains IDEs, Vim/Neovim, and other editors +- **Repository Setup Validation** - Clear validation steps and troubleshooting guidance +- **Organization Permissions Guide** - Detailed instructions for GitHub Copilot in organizational repositories +- **Quick Reference Checklist** - Condensed checklist for experienced GitHub Copilot users +- **Setup Validation & Testing** - Post-integration testing guidance to ensure proper functionality +- **Test Runner** (`tests/test-runner.sh`) - Main test execution framework with isolated environments and detailed reporting +- **Script-Specific Test Suites** - Dedicated test files for each script covering unit, integration, and error scenarios +- **GitHub Actions Workflow** (`.github/workflows/test-scripts.yml`) - Automated CI/CD testing on push, PRs, and scheduled runs +- **Testing Documentation** (`TESTING.md`) - Comprehensive guide for test framework usage and maintenance +- **Test Coverage** - 9 tests for extract-version.sh, 13 for manage-versions.sh, 11 for update-versions.sh, 11 for check-template-version.sh, 10 integration tests ### Changed - **Separated Repository Instructions** - `.github/copilot-instructions.md` now contains repository-specific instructions for maintaining the template repository @@ -25,6 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Updated Documentation** - README.md now correctly references `template.md` for adapter developers - **Improved Repository Focus** - Repository-specific copilot instructions focus on template maintenance, quality assurance, and community contribution guidelines - **Fixed Version Consistency** - Updated template.md from 0.3.0 to 0.3.1 to match repository development version +- **Enhanced Quick Start Section** - Added prerequisite warnings and clearer step descriptions with validation +- **Improved Integration Steps** - Added setup validation before template integration and comprehensive testing guidance +- **Better Documentation Flow** - Logical progression from basic setup through template integration to validation ### Fixed - **GitHub Copilot Duplicate Execution** - Added HTML comment block to `template.md` to prevent GitHub Copilot from processing it as active instructions (Fixes #11) diff --git a/README.md b/README.md index 30b0e04..7ad4b14 100644 --- a/README.md +++ b/README.md @@ -16,31 +16,136 @@ This repository provides comprehensive guidance and best practices for leveragin [ioBroker](https://www.iobroker.net/) is a powerful integration platform for the Internet of Things (IoT), designed to connect various smart home devices, services, and systems into a unified automation platform. Adapters are the core components that enable ioBroker to communicate with different technologies and services. +## Prerequisites and Basic GitHub Copilot Setup + +Before using this template, ensure you have GitHub Copilot properly set up in your repository. If you're new to GitHub Copilot, follow these steps: + +### Step 1: GitHub Copilot Subscription & Installation + +1. **Subscribe to GitHub Copilot** + - Visit [GitHub Copilot](https://github.com/features/copilot) and subscribe to GitHub Copilot Individual or Business + - Ensure your subscription is active and includes your target repository + +2. **Install GitHub Copilot Extension** + - **VS Code**: Install the [GitHub Copilot extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) + - **JetBrains IDEs**: Install GitHub Copilot from the plugin marketplace + - **Vim/Neovim**: Use the [copilot.vim](https://github.com/github/copilot.vim) plugin + - **Other editors**: Check [GitHub Copilot documentation](https://docs.github.com/en/copilot) for your editor + +3. **Authenticate GitHub Copilot** + - Open your editor and sign in to GitHub Copilot when prompted + - Verify authentication by typing code in any file - you should see Copilot suggestions + +### Step 2: Repository Setup & Validation + +1. **Enable Copilot for Your Repository** + ```bash + # Navigate to your ioBroker adapter repository + cd your-iobroker-adapter + + # Ensure you're logged into GitHub CLI (optional but recommended) + gh auth login + ``` + +2. **Create Basic GitHub Copilot Structure** + ```bash + # Create .github directory if it doesn't exist + mkdir -p .github + + # Verify Copilot can access your repository + # Open any .js/.ts file and start typing - you should see suggestions + ``` + +3. **Verify Copilot is Working** + - Open a JavaScript or TypeScript file in your repository + - Start typing a function or comment + - You should see grayed-out suggestions from Copilot + - Press `Tab` to accept suggestions or `Esc` to dismiss + +### Step 3: Test Basic Functionality + +Create a simple test to verify Copilot is working with your repository: + +```javascript +// Create a file test-copilot.js and start typing this comment: +// Function to add two numbers + +// Copilot should suggest a function implementation when you press Enter +``` + +**Expected behavior:** Copilot should suggest code completions as you type. + +### Step 4: Repository Permissions (For Organizations) + +If your repository is part of an organization: + +1. **Check Organization Settings** + - Go to your GitHub organization settings + - Navigate to "Copilot" in the left sidebar + - Ensure your repository is included in the allowed repositories + +2. **Verify Team Access** + - Ensure your team has Copilot access enabled + - Check that repository access policies allow Copilot usage + +### Troubleshooting Basic Setup + +| Problem | Solution | +|---------|----------| +| No suggestions appear | Check authentication and subscription status | +| Repository not accessible | Verify organization settings and permissions | +| Extension not working | Reinstall Copilot extension and restart editor | +| Authentication issues | Sign out and sign back in to GitHub Copilot | + +**✅ Setup Complete!** Once you have Copilot working and showing suggestions in your repository, you can proceed to integrate the ioBroker template below. + +### Quick Reference Checklist + +For experienced GitHub Copilot users, here's a quick checklist: + +- [ ] GitHub Copilot subscription is active +- [ ] Copilot extension installed in your editor +- [ ] Authentication completed (can see suggestions when typing) +- [ ] Repository permissions configured (for organizations) +- [ ] Basic functionality tested (suggestions appear in .js/.ts files) +- [ ] Ready to integrate ioBroker template + +**New to GitHub Copilot?** Follow the detailed [Prerequisites & Basic Setup](#🛠️-prerequisites--basic-github-copilot-setup) above. + ## 📋 How to Use This Template ### Quick Start -1. **Integrate Copilot Instructions (Recommended)** +> **⚠️ Prerequisites Required:** Before proceeding, ensure you've completed the [Basic GitHub Copilot Setup](#🛠️-prerequisites--basic-github-copilot-setup) above. + +1. **For Existing Copilot Users (Recommended)** - If you already have a `.github/copilot-instructions.md` file, merge the content from this template rather than replacing it - Use GitHub Copilot to help you merge the instructions: "Merge my existing copilot instructions with the template from https://github.com/DrozmotiX/ioBroker-Copilot-Instructions maintaining project-specific context" - Add the template version reference to track updates -2. **New Repository Setup** +2. **For New Copilot Users** - Download the latest version of [`template.md`](template.md) - Save it as `.github/copilot-instructions.md` in your adapter repository's `.github/` folder - Customize sections marked with `[CUSTOMIZE]` for your specific adapter requirements -3. **Enable GitHub Copilot** - - Ensure GitHub Copilot is enabled for your repository - - The instructions will automatically be used by Copilot when working in your codebase +3. **Verification & Activation** + - Verify GitHub Copilot is working in your repository (should show suggestions when typing) + - The ioBroker-specific instructions will automatically be used by Copilot when working in your codebase + - Test by opening a JavaScript file and typing ioBroker-related code - you should see relevant suggestions ### Integration Steps +> **⚠️ Important:** Ensure GitHub Copilot is working in your repository before proceeding. If you need setup help, see the [Prerequisites & Basic Setup](#🛠️-prerequisites--basic-github-copilot-setup) section above. + **For repositories with existing Copilot instructions:** ```bash # Navigate to your ioBroker adapter repository cd your-iobroker-adapter +# Verify Copilot is working (should show suggestions when you type) +# Open any .js file and type: // Function to connect to ioBroker +# You should see Copilot suggestions appear + # Ask GitHub Copilot to merge the instructions # Use the following prompt in your editor: # "Merge my existing .github/copilot-instructions.md with the ioBroker template @@ -49,11 +154,15 @@ cd your-iobroker-adapter # NOTE: Exclude the HTML comment block at the top of the template" ``` -**For new repositories:** +**For new repositories (first-time Copilot setup):** ```bash # Navigate to your ioBroker adapter repository cd your-iobroker-adapter +# Verify basic Copilot setup is complete +# Open any .js file and start typing - you should see suggestions +# If no suggestions appear, complete the basic setup first + # Create .github directory if it doesn't exist mkdir -p .github @@ -69,6 +178,28 @@ git commit -m "Add GitHub Copilot instructions for ioBroker development" git push ``` +### Validation & Testing + +After completing the integration, verify everything is working correctly: + +```bash +# Test that Copilot uses the ioBroker instructions +# 1. Open any .js or .ts file in your adapter +# 2. Start typing ioBroker-related code: +# Example: // Create new ioBroker adapter instance +# Example: this.setState( +# Example: // Handle device connection + +# 3. Copilot should now provide ioBroker-specific suggestions +# 4. Check that suggestions follow the patterns from the template +``` + +**Expected Results:** +- Copilot suggestions should be more relevant to ioBroker development +- Error handling should follow ioBroker patterns +- Test suggestions should include `@iobroker/testing` framework usage +- README updates should follow ioBroker documentation standards + ## 🔄 Template Versioning To ensure you're using the latest best practices and that your local copy stays synchronized with improvements: diff --git a/template.md b/template.md index 271ec7f..8cf77bf 100644 --- a/template.md +++ b/template.md @@ -16,6 +16,8 @@ This is the template file that should be copied to your ioBroker adapter reposit ## How to Use This Template +**Prerequisites:** Ensure you have GitHub Copilot already set up and working in your repository before using this template. If you need help with basic setup, see the [Prerequisites & Setup Guide](README.md#🛠️-prerequisites--basic-github-copilot-setup) in the main repository. + 1. Copy this entire content 2. Save it as `.github/copilot-instructions.md` in your adapter repository 3. Customize the sections marked with `[CUSTOMIZE]` if needed