Skip to content

Add busbar feature flag implementing HostCapability for SfBridge#91

Merged
jlantz merged 4 commits into
mainfrom
copilot/add-busbar-feature-flag
Feb 4, 2026
Merged

Add busbar feature flag implementing HostCapability for SfBridge#91
jlantz merged 4 commits into
mainfrom
copilot/add-busbar-feature-flag

Conversation

Copilot AI commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Implements Busbar's HostCapability trait for SfBridge behind an optional feature flag, enabling drop-in integration with Busbar's capability registry system.

Changes

  • Feature flag: Added optional busbar feature with busbar-capability git dependency
  • HostCapability implementation: New capability.rs module implementing the trait:
    • namespace()"salesforce"
    • version() → crate version
    • manifest() → All 98 operations with risk classifications
    • register_host_functions() → Delegates to existing registration::register_all()
  • Risk classifications: Operations categorized as ReadOnly (60), WriteVisible (33), or Destructive (5)
  • Config manifest: Declares required SF_AUTH_URL credential
  • CI/CD configuration: Updated GitHub Actions workflows to use GH_TOKEN_BUILDS secret for accessing private busbar repository
    • Added GitHub composable-delivery environment to jobs using --all-features (clippy, test, docs)
    • Configured git credentials in all jobs that fetch busbar-capability dependency (ci.yml, integration-tests.yml, release.yml)

Usage

use busbar_sf_bridge::SfBridge;
use busbar_capability::HostCapability;

// When busbar feature is enabled
let manifest = bridge.manifest();
assert_eq!(manifest.namespace, "salesforce");
assert_eq!(manifest.operations.len(), 98);

// Register with Busbar runtime
registry.register_capability(Box::new(bridge))?;

The implementation reuses existing host function registration infrastructure and has zero impact when the feature is disabled.

Original prompt

This section details on the original issue you should resolve

<issue_title>[1.2] Add busbar feature flag to sf-bridge implementing HostCapability</issue_title>
<issue_description>## Summary

Add an optional busbar feature to sf-bridge that implements Busbar's HostCapability trait, making it a drop-in capability provider for the Busbar runtime.

Context

Busbar's capability system uses the HostCapability trait (from busbar-capability) to register capabilities:

pub trait HostCapability {
    fn namespace(&self) -> &str;
    fn version(&self) -> &str;
    fn manifest(&self) -> CapabilityManifest;
    fn register_host_functions<'a>(
        &'a self,
        builder: extism::PluginBuilder<'a>,
    ) -> Result<extism::PluginBuilder<'a>, CapabilityError>;
}

See busbar-cap-github for the reference implementation (octocrab-backed GitHub capability).

Implementation

Cargo.toml changes

[features]
default = ["rest", "bulk", "tooling", "metadata"]
busbar = ["dep:busbar-capability"]

[dependencies]
busbar-capability = { git = "https://github.com/composable-delivery/busbar", optional = true }

HostCapability implementation

  • namespace()"salesforce"
  • manifest()CapabilityManifest with all operations, each tagged with correct RiskClassification:
    • query, describe, describe_global, list_metadataReadOnly
    • create, update, upsertWriteVisible
    • delete, deploy_metadataDestructive
  • register_host_functions() → registers all sf-bridge host functions on the Extism PluginBuilder

Acceptance Criteria

  • busbar feature compiles and links against busbar-capability from git
  • SfBridge implements HostCapability when busbar feature is enabled
  • All 98 host functions registered via register_host_functions()
  • Each operation has appropriate RiskClassification (ReadOnly, WriteVisible, Destructive)
  • CapabilityManifest includes required_config for SF auth credentials
  • Feature is optional — sf-bridge remains usable without Busbar
  • Tests pass with and without the busbar feature

Dependencies

Part of

Epic 1: busbar-sf-api WASM Bridge Integration</issue_description>

<agent_instructions>Please use the new GH_TOKEN_BUILDS secret in your environment to access the busbar repository for this task</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 4, 2026 05:31
Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add busbar feature flag to sf-bridge implementing HostCapability Add busbar feature flag implementing HostCapability for SfBridge Feb 4, 2026
Copilot AI requested a review from jlantz February 4, 2026 05:38
@jlantz

jlantz commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@copilot I changed the firewall rule to allow your git access if you use the GH_TOKEN_BUILDS secret when accessing GitHub for the other repo. We need to make sure all the build scripts use the GitHub composable-delivery Environment too which also has that secret set. That secret is necessary to access the Busbar and Typesynth repositories to use them as a dependency

Co-authored-by: jlantz <1697127+jlantz@users.noreply.github.com>

Copilot AI commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot I changed the firewall rule to allow your git access if you use the GH_TOKEN_BUILDS secret when accessing GitHub for the other repo. We need to make sure all the build scripts use the `GitH...

Updated all CI workflows to use the GitHub composable-delivery environment and configured git credentials with GH_TOKEN_BUILDS for jobs that use --all-features:

  • clippy - Added environment and git config
  • test - Added environment and git config
  • docs - Added environment and git config
  • integration - Added git config (already had scratch environment for SF_AUTH_URL)
  • wasm-integration - Added git config (already had scratch environment for SF_AUTH_URL)
  • integration-tests.yml - Added git config
  • release.yml publish - Added git config (already had crates.io environment)

This ensures all jobs that need to fetch the busbar-capability dependency can authenticate using the provided token.

Commit: 179b394

Copilot AI temporarily deployed to GitHub composable-delivery February 4, 2026 06:43 Inactive
Copilot AI temporarily deployed to GitHub composable-delivery February 4, 2026 06:43 Inactive
Copilot AI temporarily deployed to GitHub composable-delivery February 4, 2026 06:43 Inactive
@codecov

codecov Bot commented Feb 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.50000% with 39 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/sf-bridge/src/capability.rs 93.50% 39 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jlantz jlantz marked this pull request as ready for review February 4, 2026 06:57
@jlantz jlantz merged commit 07a6f70 into main Feb 4, 2026
8 of 11 checks passed
@jlantz jlantz deleted the copilot/add-busbar-feature-flag branch February 4, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.2] Add busbar feature flag to sf-bridge implementing HostCapability

2 participants