Skip to content

Conversation

@GabrielDrapor
Copy link
Contributor

@GabrielDrapor GabrielDrapor commented Jul 14, 2025

PR Type

Bug fix


Description

  • Replace hyphens with underscores in server names for deeplink parameters

Changes diagram

flowchart LR
  A["Server Name"] -- "replace hyphens" --> B["Formatted Name"] -- "append to params" --> C["Deeplink URL"]
Loading

Changes walkthrough 📝

Relevant files
Bug fix
index.html
Fix server name hyphen replacement                                             

pages/registry/index.html

  • Modified server name parameter to replace hyphens with underscores
  • Updated deeplink URL parameter formatting for server installation
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-merge-pro
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Data Consistency

    The hyphen-to-underscore replacement may cause issues if the receiving system expects the original server name format or if there are dependencies on the original naming convention elsewhere in the codebase.

    params.append('name', server.name.replace(/-/g, '_'));
    params.append('action', 'install');
    Missing Validation

    The code assumes server.name exists and is a string, but there's no validation to handle cases where server.name might be null, undefined, or not a string before applying the replace method.

    params.append('name', server.name.replace(/-/g, '_'));
    params.append('action', 'install');

    @qodo-merge-pro
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Validate hyphen replacement logic

    The global replacement of all hyphens with underscores may cause issues if the
    server name contains legitimate hyphens that should be preserved. Consider
    validating the server name format or using a more targeted replacement approach.

    pages/registry/index.html [1712]

    -params.append('name', server.name.replace(/-/g, '_'));
    +params.append('name', server.name.replace(/^-+|-+$/g, '').replace(/-/g, '_'));
    • Apply / Chat
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion raises a valid point that globally replacing all hyphens might have unintended side effects, prompting the developer to reconsider the requirements for this sanitization.

    Low
    • More

    @github-actions
    Copy link
    Contributor

    PR Summary

    Replaces dashes (-) with underscores (_) in server.name before adding it to the name query-param inside pages/registry/index.html, ensuring the generated deeplink works correctly.

    Review

    Looks good – concise change targeting the bug without side effects.

    • Matches the format used elsewhere for name (avoids breaking deeplink parsing).
    • No build/runtime impact outside the query-string.
    • Consider adding a short comment or utility helper if similar transformations are needed in other places.

    View workflow run

    @GabrielDrapor GabrielDrapor merged commit 08574b1 into main Jul 14, 2025
    8 of 9 checks passed
    @GabrielDrapor GabrielDrapor deleted the Jiarui/fix-deeplink-arg branch July 14, 2025 06:46
    @mcpm-semantic-release
    Copy link

    🎉 This PR is included in version 2.6.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants