Skip to content
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

deprecate!:backend client #604

Merged
merged 11 commits into from
Nov 19, 2024
Merged

deprecate!:backend client #604

merged 11 commits into from
Nov 19, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Nov 18, 2024

companion to OpenVoiceOS/OVOS-workshop#295

Summary by CodeRabbit

  • New Features

    • Introduced a SkillSettingsManager for improved skill settings synchronization with backend services.
    • Added methods for managing download timers, uploading, and downloading settings and metadata.
    • Implemented event listeners for skill-related updates.
  • Chores

    • Removed the "Test Constraints" GitHub Actions workflow.
    • Updated dependency specifications to include ovos-backend-client in the deprecated requirements.
    • Updated version constraints for various dependencies across multiple requirements files to allow for newer versions.
    • Modified test dependencies to use minimum version constraints for better compatibility.

@JarbasAl JarbasAl requested a review from NeonDaniel November 18, 2024 19:05
Copy link

coderabbitai bot commented Nov 18, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request involves the deletion of a GitHub Actions workflow file that defined a testing process for project constraints. Additionally, it introduces significant modifications to the SkillSettingsManager class in mycroft/skills/settings.py, enhancing its functionality for managing skill settings synchronization with a backend service. Furthermore, several dependency version constraints have been updated across multiple requirements files to ensure compatibility with newer versions of packages.

Changes

File Path Change Summary
.github/workflows/constraint_tests.yml Deleted the GitHub Actions workflow for testing constraints.
mycroft/skills/settings.py Added SkillSettingsManager class with methods for managing skill settings synchronization.
requirements/extra-deprecated.txt Added dependency: ovos-backend-client>=0.1.0,<2.0.0.
requirements/lgpl.txt Updated ovos_padatious dependency from >=1.0.3,<2.0.0 to >=1.0.4,<2.0.0.
requirements/requirements.txt Updated multiple dependencies to new version constraints.
requirements/skills-audio.txt Updated several audio-related skills to new minimum version constraints.
requirements/skills-desktop.txt Updated ovos-skill-application-launcher from >=0.5.4,<1.0.0 to >=0.5.6,<1.0.0.
requirements/skills-essential.txt Updated several essential skills to new minimum version constraints.
requirements/skills-gui.txt Updated ovos-skill-homescreen from >=1.0.4,<4.0.0 to >=3.0.2,<4.0.0.
requirements/skills-internet.txt Updated several internet-related skills to new minimum version constraints.
requirements/skills-media.txt Updated several media-related skills to new minimum version constraints.
requirements/tests.txt Changed fixed version constraints to minimum version constraints for several test dependencies.

Possibly related PRs

  • feat/pipeline_plugins_opm #527: Involves the deletion of a GitHub Actions workflow file, related to the modifications in workflow configurations.
  • chore: release_tests #590: Introduces a new workflow for testing constraints, which may connect to the modifications in the main PR regarding workflow management.
  • fix:standardize_lang #568: Focuses on standardizing language handling, connecting to the main PR's emphasis on managing workflows and dependencies.

Suggested labels

dependencies

Suggested reviewers

  • goldyfruit
  • j1nx
  • builderjer

Poem

In the garden of code, we hop with glee,
Dependencies updated, as fresh as can be!
With settings in sync, our skills will align,
A workflow deleted, but all will be fine.
So let’s celebrate changes, both big and small,
For in this code burrow, we’re having a ball! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@github-actions github-actions bot added the breaking breaks backwards compatibility (kinda) label Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.13%. Comparing base (23f0bab) to head (ef6d7ba).
Report is 89 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #604      +/-   ##
==========================================
- Coverage   75.33%   73.13%   -2.21%     
==========================================
  Files          15       15              
  Lines        3094     1526    -1568     
==========================================
- Hits         2331     1116    -1215     
+ Misses        763      410     -353     
Flag Coverage Δ
end2end 56.48% <ø> (?)
unittests 49.34% <ø> (-26.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@github-actions github-actions bot added breaking breaks backwards compatibility (kinda) and removed breaking breaks backwards compatibility (kinda) labels Nov 18, 2024
Copy link

@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: 2

🧹 Outside diff range and nitpick comments (5)
mycroft/skills/settings.py (5)

175-179: Consider removing redundant pairing check in upload method.

The upload method is decorated with @requires_backend, which should handle backend availability and device pairing. The additional check if not is_paired(): may be redundant. Removing this check can simplify the code and reduce duplication.


185-189: Consider removing redundant pairing check in upload_meta method.

Similar to the upload method, upload_meta has a redundant if not is_paired(): check while already being decorated with @requires_backend. Simplifying the code by removing this check can improve maintainability.


195-199: Consider removing redundant pairing check in download method.

The download method's check for is_paired() may be unnecessary due to the @requires_backend decorator. Eliminating redundant checks helps streamline the code.


229-254: Extend settings2meta to handle additional data types like floats.

Currently, settings2meta handles bool, str, and int types but does not account for float values. To ensure all numerical settings are properly included in the metadata, consider adding support for float types.

Apply the following changes to handle float types:

        for k, v in settings.items():
            if k.startswith("_"):
                continue
            label = k.replace("-", " ").replace("_", " ").title()
            if isinstance(v, bool):
                # existing code...
            elif isinstance(v, str):
                # existing code...
-           elif isinstance(v, int):
+           elif isinstance(v, int) or isinstance(v, float):
                fields.append({
                    "name": k,
                    "type": "number",
                    "label": label,
                    "value": str(v)
                })
            else:
                # Optionally handle other data types or raise an error

153-154: Offer assistance to implement support for settingsmeta XDG paths.

There's a TODO comment indicating the need to support settingsmeta XDG paths. Proper implementation of XDG paths can enhance compatibility with different system configurations. If you need assistance with this feature, I'd be happy to help.

Do you want me to generate a solution or open a GitHub issue to track this task?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 516ebfe and 46bf18a.

📒 Files selected for processing (3)
  • mycroft/skills/settings.py (1 hunks)
  • requirements/extra-deprecated.txt (1 hunks)
  • requirements/requirements.txt (0 hunks)
💤 Files with no reviewable changes (1)
  • requirements/requirements.txt
🧰 Additional context used
🪛 Ruff
mycroft/skills/settings.py

72-72: mycroft.deprecated.skills.settings.SkillSettingsDownloader imported but unused

Remove unused import

(F401)


72-72: mycroft.deprecated.skills.settings.SettingsMetaUploader imported but unused

Remove unused import

(F401)


72-72: mycroft.deprecated.skills.settings.load_remote_settings_cache imported but unused

Remove unused import

(F401)


73-73: mycroft.deprecated.skills.settings.save_remote_settings_cache imported but unused

Remove unused import

(F401)


73-73: mycroft.deprecated.skills.settings.REMOTE_CACHE imported but unused

Remove unused import

(F401)

🔇 Additional comments (2)
requirements/extra-deprecated.txt (2)

12-12: Verify impact of deprecating ovos-backend-client

The addition of ovos-backend-client to deprecated requirements aligns with the PR objective. However, we should verify that all dependent modules are prepared for this deprecation.

#!/bin/bash
# Description: Check for modules that might be affected by the backend client deprecation

# Search for imports or usage of ovos-backend-client
rg -l "from ovos.backend|from ovos_backend|import ovos.backend|import ovos_backend"

# Search for potential configuration files that might reference the backend
fd -e yaml -e json | xargs rg -l "backend.*client|ovos.*backend"

Line range hint 15-16: Review dependency conflict with ovos-listener

The existing note indicates a dependency conflict that blocks ovos-bus-client 1.0.0. Since we're making dependency changes, this might be a good time to address this conflict.

Consider:

  1. Evaluating if the ovos-listener conflict needs to be resolved alongside this deprecation
  2. Documenting any known limitations or issues that users might face due to these dependency constraints

mycroft/skills/settings.py Show resolved Hide resolved
mycroft/skills/settings.py Show resolved Hide resolved
@JarbasAl JarbasAl removed the breaking breaks backwards compatibility (kinda) label Nov 19, 2024
@github-actions github-actions bot added the breaking breaks backwards compatibility (kinda) label Nov 19, 2024
@JarbasAl JarbasAl marked this pull request as draft November 19, 2024 18:57
Copy link

@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: 1

🧹 Outside diff range and nitpick comments (2)
test/end2end/session/test_get_response.py (2)

Line range hint 431-431: Use a more pythonic way to check for empty lists

In the test_nested method, the condition if not len(items): can be simplified to if not items:, which is more pythonic and enhances readability.

Apply this diff to simplify the condition:

-                if not len(items):
+                if not items:

Line range hint 709-710: Avoid directly modifying the context of received messages

In the abort_response function within test_kill_response_with_session_mismatch, you are directly modifying msg.context["session"]. Modifying the context of incoming messages can lead to unexpected side effects. Instead, create a new Message with the updated context.

Apply this diff to safely create a new message:

-                msg.context["session"] = Session("456").serialize()
-                self.core.bus.emit(msg.forward("mycroft.skills.abort_question",
-                                               {"skill_id": self.skill_id}))
+                new_context = dict(msg.context)
+                new_context["session"] = Session("456").serialize()
+                new_msg = Message("mycroft.skills.abort_question",
+                                  {"skill_id": self.skill_id},
+                                  new_context)
+                self.core.bus.emit(new_msg)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1424fc7 and 9006d29.

📒 Files selected for processing (1)
  • test/end2end/session/test_get_response.py (2 hunks)

test/end2end/session/test_get_response.py Outdated Show resolved Hide resolved
@JarbasAl JarbasAl marked this pull request as ready for review November 19, 2024 22:17
@JarbasAl JarbasAl added fix and removed breaking breaks backwards compatibility (kinda) labels Nov 19, 2024
@JarbasAl JarbasAl merged commit 3cf45d4 into dev Nov 19, 2024
10 of 11 checks passed
@JarbasAl JarbasAl deleted the deprecate/backend_client branch November 19, 2024 22:20
@github-actions github-actions bot added breaking breaks backwards compatibility (kinda) and removed fix breaking breaks backwards compatibility (kinda) labels Nov 19, 2024
@github-actions github-actions bot added breaking breaks backwards compatibility (kinda) and removed breaking breaks backwards compatibility (kinda) labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking breaks backwards compatibility (kinda)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant