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

[java] remove toml parser warning #14711

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Conversation

Delta456
Copy link
Contributor

@Delta456 Delta456 commented Nov 4, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Remove TOML warning for the upcoming TOML parser change in #14470

Motivation and Context

Remove warning because as said We can add a warning with the current code base about the upcoming change, and maybe merge this PR after 2 versions so the end users get a chance to update the TOML. as said in #14470 (comment)

Types of changes

  • 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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Bug fix


Description

  • Removed the warning message about the upcoming TOML parser change that required quoted strings, as it is no longer necessary.
  • Eliminated the logger import and instance since the warning message was the only usage.

Changes walkthrough 📝

Relevant files
Bug fix
TomlConfig.java
Remove TOML parser warning and logger                                       

java/src/org/openqa/selenium/grid/config/TomlConfig.java

  • Removed the logger import and instance.
  • Deleted the warning message regarding TOML parser changes.
  • +0/-5     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    qodo-merge-pro bot commented Nov 4, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link
    Contributor

    qodo-merge-pro bot commented Nov 4, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Implement custom validation for unquoted strings to maintain previous warning functionality

    Consider adding a custom validation method to check for unquoted strings in the TOML
    content, to maintain the previous warning functionality without using a logger.

    java/src/org/openqa/selenium/grid/config/TomlConfig.java [40-46]

     public TomlConfig(Reader reader) {
       try {
         toml = JToml.parse(reader);
    +    validateQuotedStrings(reader);
       } catch (IOException e) {
         throw new ConfigException("Unable to read TOML.", e);
       } catch (ParseException e) {
         throw new ConfigException(
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: This suggestion provides a more proactive approach to maintaining the functionality of the removed warning. Implementing custom validation for unquoted strings helps ensure code quality and prepares for future TOML parser changes, making it a valuable enhancement.

    7
    Maintainability
    Add a reminder for future TOML parser changes to maintain awareness of potential issues

    Consider adding a deprecation notice or TODO comment to remind developers about the
    upcoming change in TOML parser behavior regarding unquoted strings.

    java/src/org/openqa/selenium/grid/config/TomlConfig.java [40-46]

     public TomlConfig(Reader reader) {
       try {
         toml = JToml.parse(reader);
    +    // TODO: Add validation for unquoted strings once new TOML parser is implemented
       } catch (IOException e) {
         throw new ConfigException("Unable to read TOML.", e);
       } catch (ParseException e) {
         throw new ConfigException(
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion is relevant as it addresses the removed warning about future TOML parser changes. Adding a TODO comment maintains awareness of the issue without using the removed logger, which is moderately useful for future maintenance.

    5

    💡 Need additional feedback ? start a PR chat

    @pujagani pujagani merged commit 4d1752b into SeleniumHQ:trunk Nov 5, 2024
    4 checks passed
    @Delta456 Delta456 deleted the remove_warning branch November 6, 2024 10:30
    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