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

update slf4j from 1.7.36 to 2.0.16 #3191

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

asolntsev
Copy link
Contributor

@asolntsev asolntsev commented Nov 25, 2024

slf4j 1.7.* is a very old version.
Many projects use the newer slf4j, but fallback to 1.7.36 because of TestNG transitive dependency.

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt
  • Auto applied styling via ./gradlew autostyleApply

We encourage pull requests that:

  • Add new features to TestNG (or)
  • Fix bugs in TestNG

If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.

Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.

Summary by CodeRabbit

  • Chores
    • Updated SLF4J API and SLF4J Simple dependencies to the latest version for improved performance and compatibility.

Copy link

coderabbitai bot commented Nov 25, 2024

Walkthrough

The changes involve updating the build.gradle.kts file for the testng-core-api project. Specifically, the version of the SLF4J API and SLF4J Simple dependencies has been changed from 1.7.36 to 2.0.16. This update is reflected in the dependencies block, with no other modifications made to the project's logic or control flow.

Changes

File Change Summary
testng-core-api/testng-core-api-build.gradle.kts Updated SLF4J API and Simple dependencies from version 1.7.36 to 2.0.16.

Poem

In the garden where the bunnies play,
New versions hop in without delay.
SLF4J shines, a brighter hue,
With every change, we leap anew! 🐇✨
Dependencies fresh, oh what a thrill,
In our code, we dance and chill!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3b79840 and fbb5e39.

📒 Files selected for processing (1)
  • testng-core-api/testng-core-api-build.gradle.kts (1 hunks)
🔇 Additional comments (2)
testng-core-api/testng-core-api-build.gradle.kts (2)

18-19: Verify SLF4J 2.x migration requirements

The upgrade from SLF4J 1.7.36 to 2.0.16 is a major version change that requires careful consideration.

Let's verify the impact of this change:

Please ensure the following migration requirements are addressed:

  1. Review the SLF4J 2.x Migration Guide for any necessary code changes
  2. Verify that all logging implementations used in the project are compatible with SLF4J 2.x
  3. Consider adding a note to CHANGES.txt about this major version upgrade
✅ Verification successful

SLF4J 2.x upgrade is safe to proceed

The verification shows minimal SLF4J usage confined to a wrapper class testng-core-api/src/main/java/org/testng/log4testng/Logger.java that uses basic Logger functionality. The only other logging dependency is Logback 1.4.11 in the OSGi test module, which is already compatible with SLF4J 2.x.

  • The wrapper class uses standard SLF4J APIs (LoggerFactory and Logger) that remain stable in 2.x
  • Logback 1.4.11 in test module is compatible with SLF4J 2.x series
  • No other potentially conflicting logging implementations found
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential SLF4J migration issues and dependencies

# Search for direct SLF4J API usage that might need updates
echo "Checking for SLF4J API usage patterns that might need updates..."
rg -t java "org\.slf4j\.(Logger|LoggerFactory)" -A 3

# Look for other logging implementations that might conflict
echo "Checking for other logging implementations..."
fd -e gradle -e kts | xargs rg "(log4j|logback|commons-logging)"

Length of output: 1803


18-18: Verify downstream project compatibility

Since this is an api dependency, the SLF4J 2.x version will be exposed to all downstream projects that depend on testng-core-api.

Let's check for potential version conflicts:

✅ Verification successful

SLF4J 2.0.16 upgrade appears safe to proceed

The verification shows:

  • SLF4J is only declared once in the entire project (in testng-core-api)
  • The only other logging dependency is Logback 1.4.11 in the test-osgi module, which is compatible with SLF4J 2.x
  • The logger usage is primarily internal to TestNG's core functionality
  • No conflicting SLF4J versions were found across the codebase
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential version conflicts in downstream projects

# Look for other modules that might declare different SLF4J versions
echo "Checking for SLF4J version declarations across all Gradle build files..."
fd -e gradle -e kts | xargs rg "org\.slf4j:slf4j-api:"

# Check for version constraints in platform/BOM definitions
echo "Checking for platform/BOM definitions that might constrain SLF4J version..."
fd -e gradle -e kts | xargs rg "platform\(['\"]org\.slf4j"

Length of output: 522


Script:

#!/bin/bash
# Let's check for any direct or transitive dependencies on slf4j across the codebase
# This will help identify potential conflicts or compatibility issues

# Check for any slf4j imports in the codebase
echo "Checking for SLF4J imports across the codebase..."
rg "import.*org\.slf4j" -l

# Check for any logger declarations or usage
echo "Checking for logger declarations and usage..."
rg "LoggerFactory|Logger " -l

# Check if there are any other logging frameworks in use
echo "Checking for other logging frameworks..."
fd -e gradle -e kts | xargs rg "log4j|logback|commons-logging"

Length of output: 3816


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@krmahadevan krmahadevan merged commit 0dc89ba into testng-team:master Nov 25, 2024
6 of 10 checks passed
@asolntsev asolntsev deleted the update/slf4j branch November 25, 2024 13:15
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.

3 participants