Refactor merge mode from provider-specific to generic (pr, draft-pr)#859
Draft
acreeger wants to merge 12 commits intofeature/bitbucket-integrationfrom
Draft
Refactor merge mode from provider-specific to generic (pr, draft-pr)#859acreeger wants to merge 12 commits intofeature/bitbucket-integrationfrom
acreeger wants to merge 12 commits intofeature/bitbucket-integrationfrom
Conversation
Adds BitBucket Cloud support including: - BitBucketApiClient for REST API v2.0 communication - BitBucketVCSProvider implementing VersionControlProvider interface - VCSProviderFactory for provider instantiation - ProviderCoordinator for cross-provider workflows - bitbucket-pr merge mode in finish command - Reviewer auto-assignment with username-to-UUID resolution - Auto-detection of workspace/repo from git remote - Debug subcommand for integration testing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s bitbucket Implements the TODO(bitbucket) in the issues command to detect the configured VCS provider and use BitBucketApiClient.listPullRequests() instead of fetchGitHubPRList() when provider is 'bitbucket'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevent real subprocess spawning (execa for dark mode detection) and file system reads (dotenv-flow) that caused timeouts in non-interactive shells. Uses plain functions instead of vi.fn() to survive vitest mockReset between tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…VCSProvider Move settings extraction and validation logic from factories and issues.ts into the provider classes themselves, reducing duplication and simplifying call sites. Also adds listPullRequests() to BitBucketVCSProvider to encapsulate workspace detection + PR listing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add redactSensitiveFields() to mask apiToken, token, secret, and password values in settings debug logs, preventing credential exposure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix error swallowing in checkForExistingPR (re-throw 401/403 auth errors), escape branch names in BBQL queries to prevent injection, remove verbose allMembers debug dump, add 'credential' to redaction keys, use dynamic import for BitBucketVCSProvider in issues command, remove dead ProviderCoordinator.ts, fix prTitlePrefix default to false, remove redundant vi.clearAllMocks(), and add test coverage for redactSensitiveFields, checkForExistingPR error handling, and BitBucket URL patterns in remote parsing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add bitbucket-pr to JSON mode validation guard to prevent interactive hang in CI/scripted workflows - Add pagination to listPullRequests matching getAllWorkspaceMembers pattern - Add --mine flag support for BitBucket PR listing via current user filtering - Apply prTitlePrefix setting to GitHub PRs for consistency with BitBucket
…assumptions (#704) * feat: add VCS-conditional CI/CD commands in agent template STEP 5.5 Replace hardcoded gh CLI commands in STEP 5.5 (Auto-Commit and Push) with a Handlebars conditional that branches on IS_BITBUCKET: - GitHub path retains existing gh run list, gh pr view, gh api commands - BitBucket path provides BitBucket Pipelines API guidance via curl Wire IS_BITBUCKET template variable in IgniteCommand.buildTemplateVariables() from settings.versionControl.provider and add it to TemplateVariables interface. fixes #700 * feat: add BitBucket support to init wizard Update init-prompt.txt to include BitBucket as a VCS provider option: - Add VCS provider selection step (Step 1b) between issue tracker and provider-specific config, offering GitHub (default) or BitBucket - Add BitBucket credential configuration step (Step 2b) asking for username, API token (stored in settings.local.json only), and optional workspace slug - Add bitbucket-pr as a merge mode option alongside local, github-pr, github-draft-pr; auto-suggest it when BitBucket VCS is selected - Extract currentVCSProvider, currentBitBucketUsername, currentBitBucketApiToken, currentBitBucketWorkspace in Phase 0 - Display BitBucket fields in Phase 0 current config and Phase 3 summary - Add versionControl JSON generation rules (item 6) with proper file split: provider in settings.json, credentials in settings.local.json - Update mergeBehavior note to include bitbucket-pr as a valid mode - Add BitBucket VCS configuration example in Advanced Configuration - Add combined Jira + BitBucket configuration example showing the full dual-provider setup with proper file separation - Renumber Advanced Configuration items to maintain consistent ordering - Update Phase 9 wrap-up to mention BitBucket PR workflow option fixes #699 * fixes #702 Add vcsProvider field to loom metadata - Add `vcsProvider?: string` to MetadataFile interface - Add `vcsProvider?: string` to WriteMetadataInput interface - Add `vcsProvider: string | null` to LoomMetadata interface - Update toMetadata() to map vcsProvider with null fallback for legacy looms - Update writeMetadata() to persist vcsProvider when provided - Populate vcsProvider in createIloom() and reuseIloom() from settings.versionControl.provider - Add unit tests verifying GitHub and BitBucket VCS provider population and backward compatibility * fixes #697 Replace hardcoded GitHubService fallback in PR detection with VCS-provider-aware routing, so `il start <pr-number>` works for Jira+BitBucket teams. Both `start.ts` and `LoomManager.fetchIssueData()` now check for a configured `VersionControlProvider` before falling back to GitHub. * fixes #698 Route MCP get_pr, create_comment, and update_comment tools through the configured VCS provider. When versionControl.provider is 'bitbucket' in settings, PR operations use BitBucketVCSProvider instead of hardcoding GitHubIssueManagementProvider. - get_pr: fetches PR data from BitBucket via fetchPR() when configured - create_comment type:pr: posts comment to BitBucket PR via createPRComment() - update_comment type:pr: throws descriptive error (BitBucket REST API does not support PR comment editing) - GitHub path unchanged; no regression for existing GitHub users - BitBucketApiClient does not log Authorization header or credentials - Added unit tests covering both GitHub fallback and BitBucket routing paths * fixes #703 Unify github-pr and bitbucket-pr code paths in finish.ts into a single executeVCSPRWorkflow method that delegates provider-specific operations through VersionControlProvider. Pass null for GitHub (uses PRManager), pass a VersionControlProvider for BitBucket. Reads vcsProvider from loom metadata for routing context when in bitbucket-pr mode. Net reduction of 67 lines. All 4268 tests pass. * fixes #701 Co-Authored-By: Adam Creeger <acreeger@users.noreply.github.com> * Fixes #690 --------- Co-authored-by: Adam Creeger <acreeger@users.noreply.github.com>
- Fix error swallowing in start.ts PR detection (only catch 404s) - Fix error swallowing in checkForExistingPR (only return null for 404) - Bound workspace member pagination to 10 pages max - Replace dynamic imports with static imports in finish.ts BitBucket path - Add vcs_provider telemetry to loom.created, bitbucket-pr to loom.finished - Improve MCP fallback warning when BitBucket config is invalid - Pass prNumber to session summary for BitBucket PRs
Resolve conflicts in: - src/commands/start.ts: keep both VCS and recap imports - src/lib/SettingsManager.test.ts: keep both redactSensitiveFields and subAgentTimeout tests - src/mcp/issue-management-server.ts: keep BitBucket routing + add Jira sanitization - templates/prompts/init-prompt.txt: keep BitBucket config examples + add Swarm Quality Mode and Color Sync sections
86d53a8 to
d1b85f2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #842
Refactor merge mode from provider-specific to generic (pr, draft-pr)
Problem
The
mergeBehavior.modesetting currently bakes the VCS provider name into the mode value:local,github-pr,github-draft-pr,bitbucket-pr. This creates a combinatorial explosion as we add providers — each new VCS provider needs its own mode variants. It also forces users to change their merge mode if they switch VCS providers.Desired Behavior
Decouple the merge strategy from the VCS provider:
mergeBehavior.modebecomes:local | pr | draft-prversionControl.provider) determines how the PR is createddraft-prshould be skipped/downgraded gracefully if the provider doesn't support draft PRs (BitBucket doesn't)Scope
Key areas that reference the current provider-specific modes:
src/lib/SettingsManager.ts— enum definitions (2 schemas: with and without defaults)src/commands/finish.ts— branches on mode for PR creation logictemplates/prompts/init-prompt.txt— merge mode selection stepsrc/commands/summary.ts— displays merge modesrc/types/telemetry.ts—merge_behaviorpropertygithub-prtopr,github-draft-prtodraft-pr,bitbucket-prtoprfor existing usersConstraints
finish.tsalready has a unifiedcreateVCSPullRequestmethod — the mode branching that selects it should simplifydraft-pris selected with BitBucket provider, either warn at init time or fall back to regular PR at finish timeThis PR was created automatically by iloom.