8000 windy plugin: drop auto-update code by vicb · Pull Request #361 · vicb/flyXC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

windy plugin: drop auto-update code #361

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2025
Merged

windy plugin: drop auto-update code #361

merged 2 commits into from
May 23, 2025

Conversation

vicb
Copy link
Owner
@vicb vicb commented May 23, 2025

Summary by Sourcery

Drop the auto-update mechanism and clean up related code from the Windy Sounding plugin

Enhancements:

  • Remove updateAvailable, updateRequired, availableVersion fields, actions, selectors, and async thunk from plugin-slice
  • Remove update prompts and UI elements from the Plugin component
  • Simplify plugin initialization by dispatching setStatus Ready and changeLocation instead of fetching remote config

Build:

  • Remove semver dependency and related types
  • Bump plugin version to 4.1.14

Summary by CodeRabbit

  • New Features

    • None.
  • Bug Fixes

    • None.
  • Refactor

    • Removed all plugin update notification banners and related UI elements.
    • Eliminated all logic and state management related to plugin update checking and version management.
    • Streamlined plugin initialization by removing remote configuration fetching; the plugin now initializes directly.
  • Chores

    • Updated package version and cleaned up unused dependencies.

Copy link
Contributor
sourcery-ai bot commented May 23, 2025

Reviewer's Guide

This PR removes the plugin’s automatic update mechanism by stripping all update-related state, actions, selectors, UI, and async fetch logic; it also drops the semver dependency, updates the initialization flow to skip update checks, and bumps the plugin version.

Sequence Diagram: Simplified Plugin Initialization Flow

sequenceDiagram
    title Sequence Diagram: Simplified Plugin Initialization Flow
    actor User
    participant OpenPluginFunction as "sounding.tsx#openPlugin()"
    participant PluginReduxStore as "Plugin Redux Store"

    User ->> OpenPluginFunction: Initiates plugin opening
    OpenPluginFunction ->> PluginReduxStore: dispatch(setStatus(PluginStatus.Ready))
    OpenPluginFunction ->> PluginReduxStore: dispatch(changeLocation(currentLocation))
Loading

Updated Class Diagram: PluginState and pluginSlice Modifications

classDiagram
  direction LR

  class PluginState {
    +width: number
    +height: number
    +location: LatLon
    +status: PluginStatus
    +modelName: string
    +timeMs: number
    +favorites: Fav[]
    +isZoomedIn: boolean
    ..Removed Fields..
    -updateAvailable: boolean
    -updateRequired: boolean
    -availableVersion: string
  }

  class pluginSlice {
    <<Redux Slice>>
    +name: string
    +initialState: PluginState
    ..Current Actions..
    +setIsZoomedIn(payload: boolean)
    +setFavorites(payload: Fav[])
    +setModelName(payload: string)
    +setTimeMs(payload: number)
    +setWidth(payload: number)
    +setHeight(payload: number)
    +setLocation(payload: LatLon)
    +setStatus(payload: PluginStatus)
    ..Removed Actions..
    -setUpdateAvailable(payload: boolean)
    -setUpdateRequired(payload: boolean)
    -setAvailableVersion(payload: string)
    ..Removed Async Thunks..
    -fetchPluginConfig()
    ..Current Selectors..
    +selWidth(state: RootState): number
    +selHeight(state: RootState): number
    +selModelName(state: RootState): string
    +selIsZoomedIn(state: RootState): boolean
    +selLocation(state: RootState): LatLon
    +selFavorites(state: RootState): Fav[]
    +selStatus(state: RootState): PluginStatus
    ..Removed Selectors..
    -selUpdateAvailable(state: RootState): boolean
    -selUpdateRequired(state: RootState): boolean
    -selAvailableVersion(state: RootState): string
  }

  pluginSlice ..> PluginState : uses as state schema
Loading

File-Level Changes

Change Details Files
Eliminate auto-update state and logic
  • Removed updateAvailable, updateRequired, and availableVersion from state
  • Deleted setUpdateAvailable, setUpdateRequired, setAvailableVersion actions
  • Stripped fetchPluginConfig async thunk and findConfig util
  • Removed SemVer import and related code
libs/windy-sounding/src/redux/plugin-slice.ts
Remove update UI from Plugin container
  • Dropped updateAvailable and updateRequired from useSelector
  • Deleted conditional rendering of update notices and buttons
  • Always render
    component
libs/windy-sounding/src/containers/containers.tsx
Simplify plugin initialization
  • Replaced dispatch(fetchPluginConfig) with direct setStatus(Ready)
  • Dispatched changeLocation immediately after status update
libs/windy-sounding/src/sounding.tsx
Bump version and drop semver dependency
  • Updated plugin version to 4.1.14
  • Removed semver from dependencies and its type definitions
libs/windy-sounding/package.json
libs/windy-sounding/package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
coderabbitai bot commented May 23, 2025

Walkthrough

This change removes all plugin update/version checking logic and related UI from the windy-sounding library. It eliminates update-related Redux state, thunks, selectors, and UI components, and simplifies the plugin initialization flow by directly setting the plugin as ready without fetching or comparing remote configuration.

Changes

File(s) Change Summary
libs/windy-sounding/package.json Bumped version to 4.1.14; removed "semver" dependency and "@types/semver" devDependency.
libs/windy-sounding/src/containers/...tsx Removed all UI and logic for plugin update/version notifications and requirements.
libs/windy-sounding/src/redux/plugin-slice.ts Removed all Redux state, thunks, reducers, and selectors related to plugin update/version checks.
libs/windy-sounding/src/sounding.tsx Replaced config fetching with direct status set and location update in plugin opening logic.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PluginUI
    participant ReduxStore

    User->>PluginUI: Open plugin
    PluginUI->>ReduxStore: dispatch(setStatus('Ready'))
    PluginUI->>ReduxStore: dispatch(changeLocation(currentLocation))
    Note over PluginUI,ReduxStore: No remote config fetch or version check
Loading

Possibly related PRs

  • vicb/flyXC#267: Adds and refactors the update/version management features that are now being removed.
  • vicb/flyXC#273: Modifies fetchPluginConfig to handle missing remote config gracefully, which is removed in this PR.
  • vicb/flyXC#296: Modifies update-required time comparison logic in fetchPluginConfig, which is now removed in this PR.

Poem

A bunny hopped and cleared the way,
No more updates to check today!
The plugin’s ready, swift and neat,
No banners left for you to greet.
With simpler code, I leap with glee—
Just open up and fly XC!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm warn config production Use --omit=dev instead.
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-05-23T19_47_51_745Z-debug-0.log

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a293e45 and 9ba224c.

⛔ Files ignored due to path filters (1)
  • libs/windy-sounding/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • libs/windy-sounding/package.json (1 hunks)
  • libs/windy-sounding/src/containers/containers.tsx (2 hunks)
  • libs/windy-sounding/src/redux/plugin-slice.ts (1 hunks)
  • libs/windy-sounding/src/sounding.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • libs/windy-sounding/package.json
  • libs/windy-sounding/src/sounding.tsx
  • libs/windy-sounding/src/containers/containers.tsx
  • libs/windy-sounding/src/redux/plugin-slice.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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
@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vicb - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vicb vicb merged commit 104aa03 into master May 23, 2025
6 checks passed
@vicb vicb deleted the vicb/wsp branch May 23, 2025 20:06
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 participant
0