Skip to content

Conversation

jjw24
Copy link
Member

@jjw24 jjw24 commented Sep 2, 2025

Allows plugin to specify in the their plugin manifest, a new optional property 'MinimumAppVersion', e.g. "MinimumAppVersion": "2.0.0". When the user's is running flow v1.20.2 or below, the plugin will not show up in the Store or the PluginsManager install command results.

The goal is to prevent users from downloading a plugin version that uses an API method not available in their older flow version, or trying to upgrade to the latest plugin version that is not compatible with their existing outdated flow installation.

Tested:

  • plugin excluded from manifest after sync if current user's app version does not meet the minimum requirement.
  • plugin included where app version meets the minimum required version or if the MinimumAppVersion is undefined
  • MinimumAppVersion specified in plugin.json file does not have any impact

@github-actions github-actions bot added this to the 2.0.0 milestone Sep 2, 2025
Copy link

gitstream-cm bot commented Sep 2, 2025

🥷 Code experts: Jack251970, taooceros

Jack251970 has most 👩‍💻 activity in the files.
Jack251970, taooceros have most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Activity based on git-commit:

Jack251970
SEP
AUG
JUL 5 additions & 1 deletions
JUN
MAY
APR 10 additions & 7 deletions

Knowledge based on git-blame:
taooceros: 43%
Jack251970: 37%

Flow.Launcher.Plugin/UserPlugin.cs

Activity based on git-commit:

Jack251970
SEP
AUG
JUL
JUN
MAY
APR 82 additions & 2 deletions

Knowledge based on git-blame:
Jack251970: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@jjw24 jjw24 marked this pull request as ready for review September 2, 2025 13:05
@jjw24 jjw24 changed the title Allow settings of minimum app version required by plugins Allow setting of minimum app version plugin requirement Sep 2, 2025
Copy link

gitstream-cm bot commented Sep 2, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@jjw24 jjw24 added enhancement New feature or request and removed 1 min review labels Sep 2, 2025
@jjw24 jjw24 enabled auto-merge September 2, 2025 13:07
@jjw24 jjw24 merged commit 9ee123b into dev Sep 2, 2025
15 checks passed
@jjw24 jjw24 deleted the add_plugin_min_flow_version branch September 2, 2025 13:09
Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

📝 Walkthrough

Walkthrough

The manifest update now validates fetched plugin results, parses the current app version, filters fetched plugins by a new MinimumAppVersion field, updates UserPlugins only with compatible entries, sets lastFetchedAt when applicable, and returns a success flag. A helper performs version checks. UserPlugin gains a MinimumAppVersion property.

Changes

Cohort / File(s) Summary
Manifest update flow and filtering
Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
UpdateManifestAsync returns false on empty fetch; on success, sets lastFetchedAt, parses app version from Constant.Version, filters fetched plugins by MinimumAppVersion via new IsMinimumAppVersionSatisfied helper, assigns filtered list to UserPlugins, adds Infra using, logs debug on exclusion.
Plugin model extension
Flow.Launcher.Plugin/UserPlugin.cs
Adds public string property MinimumAppVersion with default empty value and XML docs to express minimum Flow Launcher version requirement for a plugin.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant PM as PluginsManifest
  participant Remote as Plugin Source
  participant Ver as Version Utils

  User->>PM: UpdateManifestAsync()
  PM->>Remote: Fetch plugins
  Remote-->>PM: FetchedPlugins[]

  alt No plugins fetched
    PM-->>User: return false
  else Plugins fetched
    PM->>Ver: Parse Constant.Version -> appVersion
    loop For each plugin
      PM->>PM: IsMinimumAppVersionSatisfied(plugin, appVersion)?
      alt Not satisfied
        Note over PM: Exclude plugin (log debug)
      else Satisfied
        Note over PM: Keep plugin
      end
    end
    PM->>PM: Update UserPlugins with filtered list<br/>Update lastFetchedAt
    PM-->>User: return true
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

enhancement

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_plugin_min_flow_version

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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.

Actionable comments posted: 4

🧹 Nitpick comments (3)
Flow.Launcher.Plugin/UserPlugin.cs (1)

80-83: MinimumAppVersion: clarify SemVer format and allow whitespace/nulls

Use IsNullOrWhiteSpace semantics downstream and document expected SemVer 2.0 (e.g., 2.0.0), since non-normalized inputs like " v2.0.0 " or "2.0.0.0" may appear.

Consider updating docs to say “SemVer (e.g., 2.0.0)”. No code change required here if parsing is hardened in PluginsManifest.cs.

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs (2)

43-45: Guard against null/empty fetch results and log once

Early-return is fine; add a null check and a single warning so callers get a trace when the store returns nothing.

Apply this diff:

-                    if (results.Count == 0)
-                        return false;
+                    if (results == null || results.Count == 0)
+                    {
+                        API.LogWarn(ClassName, "Fetched plugin manifest is empty. Skipping update.");
+                        return false;
+                    }

79-80: Optional: reduce log spam when many plugins are excluded

If lots of plugins are filtered, this can flood logs. Consider aggregating a count and logging a single summary line at Info with N excluded and first few IDs at Debug.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ca01d15 and 8392a02.

📒 Files selected for processing (2)
  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs (3 hunks)
  • Flow.Launcher.Plugin/UserPlugin.cs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-07-06T12:21:37.947Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.

Applied to files:

  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
📚 Learning: 2025-07-01T05:46:13.251Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.

Applied to files:

  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
📚 Learning: 2025-07-21T09:19:49.684Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3854
File: Flow.Launcher/App.xaml.cs:246-262
Timestamp: 2025-07-21T09:19:49.684Z
Learning: In Flow Launcher's App.xaml.cs, the asynchronous plugin initialization task (containing AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, and AutoPluginUpdates) does not require additional try-catch error handling according to maintainer Jack251970, as these operations are designed to handle exceptions internally.

Applied to files:

  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
📚 Learning: 2025-07-21T09:19:19.012Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3854
File: Flow.Launcher.Core/Plugin/PluginManager.cs:280-292
Timestamp: 2025-07-21T09:19:19.012Z
Learning: In Flow Launcher's PluginManager.cs, the post-initialization operations (RegisterResultsUpdatedEvent, UpdatePluginMetadataTranslation, RegisterPluginActionKeywords, DialogJump.InitializeDialogJumpPlugin, and AddPluginToLists) are designed to be exception-safe and do not require additional try-catch error handling according to the maintainer Jack251970.

Applied to files:

  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
📚 Learning: 2025-08-13T06:12:43.382Z
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3897
File: Flow.Launcher/ViewModel/PluginViewModel.cs:46-51
Timestamp: 2025-08-13T06:12:43.382Z
Learning: In Flow Launcher's PluginViewModel.cs, the LoadIconAsync method does not require additional try-catch error handling according to maintainer Jack251970, as the existing error handling approach is considered sufficient for the image loading operations.

Applied to files:

  • Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
🧬 Code graph analysis (1)
Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs (2)
Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs (1)
  • UserPlugin (62-78)
Flow.Launcher.Infrastructure/Constant.cs (1)
  • Constant (7-59)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream.cm
  • GitHub Check: gitStream workflow automation
  • GitHub Check: gitStream.cm
🔇 Additional comments (1)
Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs (1)

7-7: New using is appropriate

Needed for Constant.Version; no issues.

TBM13 pushed a commit to TBM13/Flow.Launcher that referenced this pull request Sep 17, 2025
…in_flow_version

Allow setting of minimum app version plugin requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants