Skip to content

Conversation

@IngmarStein
Copy link
Member

  • internal/server: extract 'markInstalledApps' to handle various path formats (directory vs. file)
  • internal/server: add unit tests for 'markInstalledApps' covering legacy and relative/absolute path scenarios
  • Ensure apps are correctly marked as installed in the UI regardless of how they were stored in the DB.

- internal/server: extract 'markInstalledApps' to handle various path formats (directory vs. file)
- internal/server: add unit tests for 'markInstalledApps' covering legacy and relative/absolute path scenarios
- Ensure apps are correctly marked as installed in the UI regardless of how they were stored in the DB.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @IngmarStein, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the application installation detection mechanism to be more robust and reliable. By extracting the logic into a dedicated function and enhancing its path-matching capabilities, the system can now accurately determine if an app is installed, irrespective of how its path is recorded in the database (e.g., as a directory, a full file path, or an absolute vs. relative path). This ensures that the user interface consistently reflects the correct installation status of applications.

Highlights

  • Refactoring App Installation Logic: The logic responsible for marking applications as installed has been extracted from handleAddAppGet into a new, dedicated private method markInstalledApps within the Server struct.
  • Improved App Path Detection: The markInstalledApps method now includes enhanced logic to correctly identify installed applications. It handles various path formats, including directory paths and full file paths, and intelligently converts between relative and absolute paths to ensure accurate matching regardless of how paths are stored in the database.
  • Comprehensive Unit Testing: New unit tests (TestMarkInstalledApps and TestMarkInstalledApps_AbsolutePaths) have been added to validate the robustness of the markInstalledApps function. These tests cover scenarios involving different path formats (directory, legacy file, custom app directory) and the correct handling of absolute paths stored in the database.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a solid improvement to the application installation detection logic. Extracting the markInstalledApps function makes the handleAddAppGet handler cleaner and more focused. The new function is more robust, handling various path formats (absolute, relative, file, and directory paths) which should resolve inconsistencies in how installed apps are detected. The addition of comprehensive unit tests for markInstalledApps is excellent, as it covers legacy formats, relative/absolute paths, and name-based fallbacks, ensuring the new logic is reliable. I have one suggestion to further refactor the new function to reduce some code duplication, which will improve its long-term maintainability.

@IngmarStein IngmarStein merged commit ddc2f3e into tronbyt:main Jan 9, 2026
5 checks passed
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