Skip to content

ADFA-2808: Add Plugin API to provide access to experimental flag#1110

Merged
Daniel-ADFA merged 3 commits intostagefrom
ADFA-2808
Mar 26, 2026
Merged

ADFA-2808: Add Plugin API to provide access to experimental flag#1110
Daniel-ADFA merged 3 commits intostagefrom
ADFA-2808

Conversation

@Daniel-ADFA
Copy link
Copy Markdown
Contributor

No description provided.

@Daniel-ADFA Daniel-ADFA requested a review from a team March 23, 2026 22:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7de5734e-5983-4df8-8bd0-c6b95e46dcdf

📥 Commits

Reviewing files that changed from the base of the PR and between f282e6a and 6909c8e.

📒 Files selected for processing (1)
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt
✅ Files skipped from review due to trivial changes (1)
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt

📝 Walkthrough

Release Notes - Add Plugin API to Provide Access to Experimental Flag

  • New Plugin API Service: Added IdeFeatureFlagService interface exposing isExperimentsEnabled(): Boolean so plugins can query whether experimental features are enabled.
  • Service Implementation: Added IdeFeatureFlagServiceImpl that delegates to FeatureFlags.isExperimentsEnabled.
  • Service Registration: Registered the new service in the plugin manager’s service registry for all plugins (both resource-aware and standard plugin context creation paths), available under the "feature_flag" service name and registered with existing error-handling.

Risks and Best Practice Violations

  • ⚠️ Missing documentation: IdeFeatureFlagService and IdeFeatureFlagServiceImpl lack KDoc and usage guidance, unlike other services (e.g., IdeEditorTabService, IdeTooltipService, IdeProjectService), creating discoverability and maintenance gaps.
  • ⚠️ Undocumented permission/visibility model: There is no documentation on required permissions, access restrictions, or whether returning experimental status may surface sensitive rollout information to third-party plugins.
  • ⚠️ Potential information leakage: Exposing experiment enablement to all plugins may allow plugins to detect feature rollouts or user segmentation; consider scoping access or documenting intended usage and privacy implications.
  • ⚠️ No feature-toggle safeguards: The implementation directly reads FeatureFlags.isExperimentsEnabled with no caching, validation, or error handling beyond registration; consider adding tests, defensive checks, and documentation of expected behavior when the underlying flag system changes.

Walkthrough

A new IdeFeatureFlagService interface was added to the plugin API, an IdeFeatureFlagServiceImpl implementation was introduced, and the plugin manager now registers this service in plugin context creation, delegating enablement checks to FeatureFlags.isExperimentsEnabled().

Changes

Cohort / File(s) Summary
Plugin API Interface
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt
Added new public interface IdeFeatureFlagService with fun isExperimentsEnabled(): Boolean.
Service Implementation
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt
Added IdeFeatureFlagServiceImpl implementing the interface; returns FeatureFlags.isExperimentsEnabled.
Plugin Manager Registration
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt
Registers IdeFeatureFlagServiceImpl() as "feature_flag" in per-plugin ServiceRegistryImpl during both plugin context creation paths using existing error-handling helper.

Sequence Diagram(s)

sequenceDiagram
participant PluginManager
participant ServiceRegistry
participant IdeFeatureFlagServiceImpl
participant FeatureFlags

PluginManager->>ServiceRegistry: registerServiceWithErrorHandling("feature_flag", IdeFeatureFlagServiceImpl)
ServiceRegistry->>IdeFeatureFlagServiceImpl: instantiate/register
Plugin (runtime)->>IdeFeatureFlagServiceImpl: isExperimentsEnabled()
IdeFeatureFlagServiceImpl->>FeatureFlags: FeatureFlags.isExperimentsEnabled
FeatureFlags-->>IdeFeatureFlagServiceImpl: boolean
IdeFeatureFlagServiceImpl-->>Plugin: boolean
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A tiny toggle twitched with cheer,

I hopped it in — experiments near.
Plugins listen, flags agree,
New paths open, curious and free.
Hooray, said the rabbit, "Let features be!" 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided, making it impossible to assess relevance to the changeset. Add a description explaining the purpose of the new plugin API and why access to the experimental flag is needed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a plugin API service to expose the experimental feature flag to plugins.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-2808

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt (1)

3-6: Consider adding KDoc for API clarity.

Since this is a public API exposed to plugins, adding documentation would help plugin developers understand the method's purpose and when to use it.

+/**
+ * Service providing access to IDE feature flags for plugins.
+ */
 interface IdeFeatureFlagService {
 
+    /**
+     * Returns whether experimental features are enabled in the IDE.
+     */
     fun isExperimentsEnabled(): Boolean
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt`
around lines 3 - 6, Add KDoc comments to the public API: document the
IdeFeatureFlagService interface and its isExperimentsEnabled() method to explain
the purpose (feature flag/experiment gating for plugins), expected semantics
(true when experimental features are enabled for the current IDE/session), and
the return value/behavior; place the KDoc immediately above the interface
declaration and above the isExperimentsEnabled() function so plugin authors
understand when and how to use it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt`:
- Around line 3-6: Add KDoc comments to the public API: document the
IdeFeatureFlagService interface and its isExperimentsEnabled() method to explain
the purpose (feature flag/experiment gating for plugins), expected semantics
(true when experimental features are enabled for the current IDE/session), and
the return value/behavior; place the KDoc immediately above the interface
declaration and above the isExperimentsEnabled() function so plugin authors
understand when and how to use it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 99691a84-0730-428a-a0fe-bca3639984ce

📥 Commits

Reviewing files that changed from the base of the PR and between a85cdcc and f282e6a.

📒 Files selected for processing (3)
  • plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeFeatureFlagService.kt
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/core/PluginManager.kt
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeFeatureFlagServiceImpl.kt

@Daniel-ADFA Daniel-ADFA merged commit d924652 into stage Mar 26, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-2808 branch March 26, 2026 21:42
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