✨ Add label-based version increment to automated beta branch creation#1275
✨ Add label-based version increment to automated beta branch creation#1275donavanbecker merged 4 commits intolatestfrom
Conversation
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
|
@copilot, actually if there is no beta branch, can you create one based on the next possible version and then target it to that? |
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
I've updated the branch targeting strategy to include beta branch creation functionality as requested. The Copilot instructions now include:
The system will now automatically create a beta branch with the next appropriate version when none exists, then target that branch for PRs. This ensures the development workflow always uses beta branches for testing before merging to main. Commit: 855d32e |
|
@copilot should we use labels to determine if it is a patch for bug fixes, minor for new features, major for breaking changes? so the labels could be patch, minor,major and would have to be set before assigning the issue to copilot |
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
I've updated the Copilot instructions to use labels for determining version increment types as suggested. The system now:
The label-based logic is integrated into the beta branch creation workflow, making version management more explicit and intentional rather than always defaulting to patch increments. Commit: 106beb6 |
…t development (#1262) This PR creates comprehensive GitHub Copilot instructions to help developers work effectively with the homebridge-switchbot codebase. The instructions provide detailed guidance on building, testing, and developing this TypeScript Homebridge platform plugin for SwitchBot smart home devices. **Complete Development Workflow Documentation:** - Bootstrap and build process with exact commands and timing expectations - Dependency installation with required `--legacy-peer-deps` flag due to TypeDoc conflicts - TypeScript compilation and plugin UI building (~7 seconds) - Test execution with Vitest (~2 seconds) - Documentation generation with TypeDoc (~7 seconds) **Validation Scenarios:** - Manual plugin validation to ensure proper Homebridge registration - Plugin loading verification with Node.js - TypeScript compilation validation - Documentation generation without warnings - Complete workflow timing (~16 seconds total) **Codebase Navigation Guide:** - Detailed project structure with 38 TypeScript files across device and IR device modules - Key development areas for common tasks (adding devices, configuration changes) - File relationships and dependencies - Base classes and extension patterns for device implementations **Known Issues and Workarounds:** - Documented dependency conflicts requiring `--legacy-peer-deps` - ESLint configuration issues with import/extensions rule - Build artifact management with updated .gitignore **Timing and Performance Guidelines:** - All commands tested with realistic timing expectations - "NEVER CANCEL" warnings for builds with appropriate timeout recommendations - Complete validation workflow benchmarked at under 20 seconds All commands and scenarios in the instructions have been thoroughly tested and validated to ensure they work correctly in a fresh development environment. The instructions follow the imperative tone requirement and provide exhaustive coverage of the development workflow. The file is located at `.github/copilot-instructions.md` and provides over 7,000 characters of comprehensive guidance for GitHub Copilot to work effectively with this codebase. Fixes #1261. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- ✨ Add label-based version increment to automated beta branch creation (#1275) This PR enhances the Copilot instructions with automated beta branch creation functionality that uses GitHub labels to determine the appropriate version increment type, ensuring all future pull requests follow the project's development workflow with intelligent version management. The system now uses GitHub issue/PR labels to determine version increment types: - **`patch`** label - Bug fixes, documentation updates, minor improvements (4.3.1 → 4.3.2) - **`minor`** label - New features, device support additions, non-breaking enhancements (4.3.1 → 4.4.0) - **`major`** label - Breaking changes, API modifications, major architectural updates (4.3.1 → 5.0.0) The updated instructions include a comprehensive 4-step process: 1. **Primary Target**: Look for existing beta branches (e.g., `beta-4.3.2`, `beta-4.4.0`) 2. **Automated Creation**: If no beta branches exist, automatically create one based on detected labels 3. **Fallback Target**: Only use the `latest` branch if beta branch creation fails 4. **Complete Toolchain**: Provide all necessary detection and creation commands Added robust label detection and priority handling: - **Label priority**: When multiple increment labels exist, uses highest priority (major > minor > patch) - **Fallback behavior**: Defaults to patch increment when no relevant labels are found - **GitHub API integration**: Uses `github-mcp-server-get_issue` and `github-mcp-server-get_pull_request` for label detection Complete git workflow with label-based version calculation: ```bash if [[ labels contains "major" ]]; then NEXT_VERSION=$(node -p "const v=require('./package.json').version.split('.'); v[0]=parseInt(v[0])+1; v[1]='0'; v[2]='0'; v.join('.')") elif [[ labels contains "minor" ]]; then NEXT_VERSION=$(node -p "const v=require('./package.json').version.split('.'); v[1]=parseInt(v[1])+1; v[2]='0'; v.join('.')") else # Default to patch increment (includes when "patch" label found or no labels) NEXT_VERSION=$(node -p "const v=require('./package.json').version.split('.'); v[2]=parseInt(v[2])+1; v.join('.')") fi BETA_BRANCH="beta-${NEXT_VERSION}" git fetch origin git checkout -b "${BETA_BRANCH}" origin/latest git push origin "${BETA_BRANCH}" ``` - **Explicit version control**: Project maintainers can specify version increment type through labels before assigning issues - **Conservative defaults**: Falls back to patch increment when no labels are present, ensuring safe version management - **Priority handling**: Automatically resolves conflicts when multiple increment labels exist - **Automated workflow**: Eliminates manual beta branch creation while maintaining proper release management practices - **Clear guidance**: Provides project maintainers with explicit instructions on label usage This ensures the development workflow always uses beta branches for testing changes before they reach the main development line, with intelligent version management based on the scope and impact of changes as indicated by GitHub labels. Fixes #1274. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey. --------- ✨ Enhanced Copilot instructions for beta branch targeting and label-based versioning (#1277) Update Workflow Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-Authored-By: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
This PR enhances the Copilot instructions with automated beta branch creation functionality that uses GitHub labels to determine the appropriate version increment type, ensuring all future pull requests follow the project's development workflow with intelligent version management.
Key Changes
Label-Based Version Management
The system now uses GitHub issue/PR labels to determine version increment types:
patchlabel - Bug fixes, documentation updates, minor improvements (4.3.1 → 4.3.2)minorlabel - New features, device support additions, non-breaking enhancements (4.3.1 → 4.4.0)majorlabel - Breaking changes, API modifications, major architectural updates (4.3.1 → 5.0.0)Enhanced Branch Targeting Strategy
The updated instructions include a comprehensive 4-step process:
beta-4.3.2,beta-4.4.0)latestbranch if beta branch creation failsIntelligent Label Processing
Added robust label detection and priority handling:
github-mcp-server-get_issueandgithub-mcp-server-get_pull_requestfor label detectionAutomated Beta Branch Creation Workflow
Complete git workflow with label-based version calculation:
Benefits
This ensures the development workflow always uses beta branches for testing changes before they reach the main development line, with intelligent version management based on the scope and impact of changes as indicated by GitHub labels.
Fixes #1274.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.