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

Added rangeStrategy to renovate file #15027

Merged

Conversation

DineshKumarRA
Copy link
Contributor

@DineshKumarRA DineshKumarRA commented Jan 4, 2025

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

Added rangeStrategy to npm and cargo managers as some of the dependencies are not updating package.json or cargo.toml but only the lockfile is getting updated for the dependency upgrade. Adding rangeStrategy should fix this based on renovate documentation - https://docs.renovatebot.com/configuration-options/#rangestrategy

Motivation and Context

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, Configuration changes


Description

  • Added rangeStrategy to npm manager for dependency updates.

  • Added rangeStrategy to cargo manager for dependency updates.

  • Ensures package.json and cargo.toml are updated alongside lockfiles.

  • Aligns with Renovate's documentation for consistent dependency management.


Changes walkthrough 📝

Relevant files
Configuration changes
renovate.json
Update Renovate configuration for npm and cargo managers 

renovate.json

  • Added rangeStrategy: bump to npm manager configuration.
  • Added rangeStrategy: bump to cargo manager configuration.
  • Ensures proper updates to dependency files and lockfiles.
  • +2/-0     

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

    …cies in package.json or cargo.toml is not getting updated
    Copy link
    Contributor

    qodo-merge-pro bot commented Jan 4, 2025

    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 Jan 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Using a more conservative range strategy for dependency updates can prevent unexpected breaking changes

    Consider using 'update-lockfile' or 'pin' instead of 'bump' as the range strategy
    for npm dependencies to ensure more predictable and stable dependency updates.

    renovate.json [41-44]

     "matchManagers": [ "npm" ],
    -"rangeStrategy": "bump",
    +"rangeStrategy": "update-lockfile",
     "commitMessagePrefix": "[js]",
     "labels": [ "dependencies", "c-nodejs" ]
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Using 'update-lockfile' strategy is a more conservative approach that can help prevent unexpected breaking changes in npm dependencies while maintaining better version control through lockfiles.

    7
    Using an adaptive range strategy allows for more intelligent dependency updates based on package characteristics

    For Rust/Cargo dependencies, consider using 'auto' instead of 'bump' strategy to let
    Renovate determine the best update approach based on the dependency type.

    renovate.json [72-75]

     "matchManagers": [ "cargo" ],
    -"rangeStrategy": "bump",
    +"rangeStrategy": "auto",
     "commitMessagePrefix": "[rust]",
     "labels": [ "dependencies", "c-rust" ]
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The 'auto' strategy for Cargo dependencies is a smart default that can adapt to different package types, though the improvement over 'bump' is moderate as both strategies are valid approaches.

    6

    @DineshKumarRA
    Copy link
    Contributor Author

    This should fix the issues with PR like #15001, #15006 where the lockfile is updated but package.json or cargo.toml not updated as ^ means minimum dependency version is met. @diemol @VietND96

    @diemol diemol merged commit 75aab75 into SeleniumHQ:trunk Jan 6, 2025
    8 checks passed
    @DineshKumarRA DineshKumarRA deleted the added-rangeStrategy-to-renovate branch January 6, 2025 13:44
    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.

    2 participants