-
Notifications
You must be signed in to change notification settings - Fork 2
Add comprehensive GitHub Copilot setup instructions for new repositories #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7cbf0a1
Initial plan
Copilot 770ad06
Add comprehensive GitHub Copilot setup instructions and improve docum…
Copilot c4f2315
Update CHANGELOG.md with comprehensive GitHub Copilot setup instructions
Copilot ecb455a
Merge branch 'main' into copilot/fix-18
DutchmanNL 5e7482c
Update README.md
DutchmanNL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 & 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. | ||
DutchmanNL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
DutchmanNL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| **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: | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.