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

[v3] Fix service name determination #3827

Open
wants to merge 1 commit into
base: v3-alpha
Choose a base branch
from

Conversation

windom
Copy link

@windom windom commented Oct 14, 2024

Description

Currently Application.New determines service name wrongly, because it calls getServiceName() on theapplication.Service struct instead of the wrapped service instance. This simple fix corrects that.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Introduced a new DIP system for enhanced High DPI monitor support.
    • Added expanded services for plugin functionality.
    • New events for window resizing and moving.
  • Bug Fixes

    • Resolved issues with custom event processing in drag-and-drop examples.
    • Fixed Linux compile errors and system tray startup issues on Windows.
  • Improvements

    • Significant changes to the Events API, including renaming and restructuring of user events.
    • Enhancements to the toolbar on macOS and handling of multiple return values from bound methods.
  • Documentation

    • Updated changelog to reflect all modifications and fixes across versions.

Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

The pull request updates the project's changelog and modifies the New function in the application.go file. The changelog now includes a summary of various changes across different versions, highlighting new features, bug fixes, and improvements. Notably, it details updates related to service name determination, a new DIP system, and significant changes to the Events API. The application.go modification specifically alters how the service name is retrieved, ensuring it uses the instance field of the service.

Changes

File Change Summary
mkdocs-website/docs/en/changelog.md Updated changelog to include new fixes, features, and bug fixes across versions, including service name determination and Events API changes.
v3/pkg/application/application.go Modified the New function to retrieve the service name from service.instance instead of service. Minor formatting and comment adjustments made.

Possibly related PRs

Suggested reviewers

  • atterpac

Poem

🐇 In the changelog bright and clear,
New features hop, and bugs disappear.
Service names now find their way,
With each update, we cheer and play!
So here’s to progress, let’s all rejoice,
For in our code, we’ve found our voice! 🎉


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.

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.

Should use service instance, not Service wrapper struct.
Copy link

sonarcloud bot commented Oct 14, 2024

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: 0

🧹 Outside diff range and nitpick comments (1)
mkdocs-website/docs/en/changelog.md (1)

24-24: LGTM! Consider adding more details about the fix.

The new entry correctly documents the fix for service name determination, which aligns with the PR objectives. Well done on keeping the changelog up-to-date!

Consider adding a brief explanation of the issue that was fixed, such as:

- Fixed service name determination by [windom](https://github.com/windom/) in [#3827](https://github.com/wailsapp/wails/pull/3827)
+ Fixed service name determination in `Application.New` method by [windom](https://github.com/windom/) in [#3827](https://github.com/wailsapp/wails/pull/3827)

This provides more context about the specific component that was affected by the fix.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 94e8f8b and 6088501.

📒 Files selected for processing (2)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
  • v3/pkg/application/application.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
mkdocs-website/docs/en/changelog.md (1)

Line range hint 1-24: Excellent changelog structure and consistency!

The changelog is well-organized, following the Keep a Changelog format consistently. It provides clear and detailed information about changes across different versions, including contributor credits and PR references. This level of detail greatly helps users and developers understand the project's evolution.

v3/pkg/application/application.go (1)

145-145: Approved: Fix for service name determination

This change correctly modifies how the service name is retrieved when logging an error during the OnStartup method of a service. By passing service.instance instead of service to the getServiceName function, it ensures that the actual service instance is used for name determination, which aligns with the PR objective.

This modification should resolve any issues related to incorrect service name determination in error logs.

@leaanthony leaanthony enabled auto-merge (squash) October 20, 2024 02:40
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