Skip to content

Stage 4: TOML integrations — gemini and tabnine migrated to plugin architecture#2050

Merged
mnriem merged 1 commit intogithub:mainfrom
mnriem:issue-1924-stage-4
Apr 1, 2026
Merged

Stage 4: TOML integrations — gemini and tabnine migrated to plugin architecture#2050
mnriem merged 1 commit intogithub:mainfrom
mnriem:issue-1924-stage-4

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 1, 2026

Summary

Migrate the two TOML-format integrations (Gemini CLI and Tabnine CLI) to the plugin architecture, completing Stage 4 of the integration migration plan (#1924).

Changes

TomlIntegration base class (integrations/base.py)

Mirrors MarkdownIntegration closely — subclasses only need to set key, config, registrar_config, and optionally context_file:

  • Overrides command_filename().toml extension
  • Extracts description from YAML frontmatter for the top-level TOML key
  • Renders prompt body in TOML multiline basic strings (""") with escaped backslashes
  • Keeps full processed template (including frontmatter) as the prompt body
  • Byte-for-byte parity with v0.4.4 release ZIP output

Integration subpackages

  • integrations/gemini/GeminiIntegration(TomlIntegration) with update-context scripts
  • integrations/tabnine/TabnineIntegration(TomlIntegration) with update-context scripts

Both are config-only (~20 lines each), registered in INTEGRATION_REGISTRY.

Tests

  • TomlIntegrationTests mixin in test_integration_base_toml.py with TOML-specific validations:
    • Valid TOML parsing (via tomllib), description/prompt keys, {{args}} placeholder
    • Setup/teardown, manifest tracking, install/uninstall round-trips
    • CLI auto-promote (--ai) and --integration flag tests
    • Complete file inventory tests (sh + ps)
  • test_integration_gemini.py and test_integration_tabnine.py — config-only test classes

Validation

  • 1419 tests pass (46 new)
  • All 21 agents × 2 script variants byte-for-byte identical with v0.4.4 release ZIPs

Relates to

#1924

…chitecture

Add TomlIntegration base class in base.py that mirrors MarkdownIntegration:
- Overrides command_filename() for .toml extension
- Extracts description from YAML frontmatter for top-level TOML key
- Renders prompt body in TOML multiline basic strings with escaped backslashes
- Keeps full processed template (including frontmatter) as prompt body
- Byte-for-byte parity with v0.4.4 release ZIP output

Create integrations/gemini/ and integrations/tabnine/ subpackages:
- Config-only __init__.py subclassing TomlIntegration
- Integration-specific update-context scripts (sh + ps1)

Add TomlIntegrationTests mixin with TOML-specific validations:
- Valid TOML parsing, description/prompt keys, {{args}} placeholder
- Setup/teardown, manifest tracking, install/uninstall round-trips
- CLI auto-promote (--ai) and --integration flag tests
- Complete file inventory tests (sh + ps)

Register both in INTEGRATION_REGISTRY; --ai auto-promote works automatically.
Copilot AI review requested due to automatic review settings April 1, 2026 15:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the Gemini CLI and Tabnine CLI integrations (TOML command format) onto the new integration plugin architecture by introducing a TomlIntegration base class, wiring both integrations into the registry, and adding comprehensive TOML-specific integration tests.

Changes:

  • Added TomlIntegration to generate TOML command files (extract frontmatter description, render prompt as TOML multiline strings, install scripts).
  • Added new built-in integrations: GeminiIntegration and TabnineIntegration, including per-integration update-context wrapper scripts (sh/ps1).
  • Added a reusable TOML integration test mixin plus per-integration config-only test classes and inventory/round-trip validations.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/specify_cli/integrations/base.py Introduces TomlIntegration and TOML rendering/installation logic mirroring MarkdownIntegration.
src/specify_cli/integrations/__init__.py Registers Gemini + Tabnine as built-in integrations.
src/specify_cli/integrations/gemini/__init__.py Adds GeminiIntegration(TomlIntegration) configuration.
src/specify_cli/integrations/gemini/scripts/update-context.sh Adds Gemini wrapper delegating to shared update-agent-context.sh.
src/specify_cli/integrations/gemini/scripts/update-context.ps1 Adds Gemini wrapper delegating to shared update-agent-context.ps1.
src/specify_cli/integrations/tabnine/__init__.py Adds TabnineIntegration(TomlIntegration) configuration.
src/specify_cli/integrations/tabnine/scripts/update-context.sh Adds Tabnine wrapper delegating to shared update-agent-context.sh.
src/specify_cli/integrations/tabnine/scripts/update-context.ps1 Adds Tabnine wrapper delegating to shared update-agent-context.ps1.
tests/integrations/test_integration_base_toml.py Adds TOML integration test mixin (parsing, manifest tracking, install/uninstall, CLI flows, file inventory).
tests/integrations/test_integration_gemini.py Adds config-only test class for Gemini based on TOML mixin.
tests/integrations/test_integration_tabnine.py Adds config-only test class for Tabnine based on TOML mixin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mnriem mnriem merged commit 682ffbf into github:main Apr 1, 2026
12 checks passed
@mnriem mnriem deleted the issue-1924-stage-4 branch April 1, 2026 15:26
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.

2 participants