EPIC: Complete BitBucket VCS abstraction — eliminate GitHub-specific assumptions#704
Merged
acreeger merged 8 commits intofeature/bitbucket-integrationfrom Feb 22, 2026
Conversation
b4e0a6e to
529461d
Compare
Collaborator
Author
iloom Session SummaryKey Themes:
Session Details (click to expand)Key Insights
Decisions Made
Challenges Resolved
Lessons Learned
Generated with 🤖❤️ by iloom.ai |
816f935 to
e6fcc36
Compare
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
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
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
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.
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
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.
2fd27b2 to
0a3240f
Compare
acreeger
added a commit
that referenced
this pull request
Feb 23, 2026
…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>
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 #690
EPIC: Complete BitBucket VCS abstraction — eliminate GitHub-specific assumptions
Context
PR #609 introduces BitBucket VCS provider and Jira issue tracker support. Code review + deep analysis across 4 dimensions (VCS abstraction layer, command-level hardcoding, settings/config, MCP/issue management) revealed 11 medium+ issues where GitHub is assumed as the only VCS provider.
The PR introduces a two-track architecture: BitBucket uses the new
VersionControlProviderabstraction, while GitHub uses the legacyPRManager+ghCLI. This is pragmatic for the initial integration but creates maintenance burden and functional gaps for Jira+BitBucket teams.Goal: Make BitBucket a first-class VCS provider with full feature parity.
HIGH — Functional Bugs / Gaps
1.
il start <pr-number>broken for Jira+BitBucketFiles:
start.ts:413-433, 456-465,LoomManager.ts:607-614When the issue tracker doesn't support PRs (Jira),
start.tsfalls back to hardcodedGitHubServicefor PR detection. For a Jira+BitBucket team,il start 42queries GitHub for PR #42 instead of BitBucket. The same pattern exists inLoomManager.fetchIssueData()(3 instances of hardcoded GitHub fallback).Fix: Replace
GitHubServicefallback with VCS-provider-aware routing (checkVCSProviderFactorybefore falling back to GitHub).2. MCP
get_prhardcodes GitHub providerFile:
issue-management-server.ts:256-258The
get_prtool createsnew GitHubIssueManagementProvider()directly, ignoring all provider config. Agents running in BitBucket workspaces cannot read PR details.Fix: Route
get_prthrough the VCS provider abstraction or add BitBucket MCP support.3. MCP PR comments hardcode GitHub
File:
issue-management-server.ts:362-363, 412-413create_commentandupdate_commentwithtype: 'pr'are hardcoded to use the GitHub provider. Agent PR comments always go to GitHub even when using BitBucket.Fix: Route PR comment operations through VCS provider when BitBucket is configured.
4. Init wizard has zero BitBucket awareness
File:
templates/prompts/init-prompt.txt:514-784local,github-pr,github-draft-pr— missingbitbucket-prversionControlconfigFix: Add
bitbucket-prmerge mode, VCS provider selection, and BitBucket config steps to init wizard.MEDIUM — Incomplete Paths / Limitations
5.
summary.tsignoresbitbucket-prmodeFile:
summary.ts:64-76getPRNumberForPosting()handlesgithub-draft-prandgithub-prbut notbitbucket-pr. Falls through toundefined, so summaries always post to the issue. Currently documented as intentional infinish.ts:1259-1261, but should be revisited once MCP PR comments support BitBucket (#3).6. Agent templates hardcode
ghCLI commandsFile:
templates/prompts/issue-prompt.txt:968-987STEP 5.5 (Auto-Commit and Push) uses
gh run list,gh pr view,gh apifor CI/CD checks. These fail in BitBucket-only environments.Fix: Add conditional templating for BitBucket vs GitHub CI/CD check commands.
7.
PRManager.generatePRBody()prompt says "GitHub" but serves BitBucket tooFiles:
PRManager.ts:135,finish.ts:1220-1222The BitBucket PR workflow calls
prManager.generatePRBody()which tells the AI it's writing a "GitHub pull request body". Functionally harmless (Markdown is universal) but misleading.Fix: Make the prompt provider-agnostic, or have BitBucket use its own body generation.
8.
plan.tserror messages assume GitHub or Linear onlyFile:
plan.ts:297-340Error messages only branch on
provider === 'github'vs else (assumed Linear). Jira users get unhelpful error messages referencingLINEAR_API_TOKEN.Fix: Add Jira-specific error messaging branch.
9. Metadata stores
issueTrackerbut notvcsProviderFile:
MetadataManager.ts:12-39Loom metadata records which issue tracker was used but not the VCS provider.
finish/cleanupmust re-derive from settings, which is fragile if settings change betweenstartandfinish.Fix: Add
vcsProviderfield toMetadataFileinterface and populate duringstart.10. Three near-duplicate PR workflow paths in
finish.tsFile:
finish.ts:735-864, 1041-1272github-pr,github-draft-pr, andbitbucket-prshare significant logic (push branch, generate title, get base branch, check existing PR, create PR, transition issue, generate summary, archive metadata, handle cleanup). Adding a 4th VCS provider would require a 4th copy.Fix: Extract shared PR workflow logic into a common method, with provider-specific operations delegated through the
VersionControlProviderinterface.11.
SessionSummaryServiceroutes PR summaries via hardcoded GitHubFile:
SessionSummaryService.ts:406-409PR summary posting is hardcoded to use the
'github'provider.Fix: Route through VCS provider abstraction.
Suggested Implementation Order
il startfor Jira+BitBucketRelated
This PR was created automatically by iloom.