- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
chore: migrate to toml dependencies #56
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
          
     Open
      
      
            skjindal93
  wants to merge
  5
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
toml
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            5 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| [versions] | ||
| hypertrace-grpcUtils = "0.9.0" | ||
|  | ||
| guice = "5.1.0" | ||
| grpc = "1.50.0" | ||
| jetty = "9.4.49.v20220914" | ||
| micrometer = "1.9.5" | ||
| dropwizardMetrics = "4.2.10" | ||
| prometheus = "0.12.0" | ||
| mockito = "4.8.1" | ||
|  | ||
| [libraries] | ||
| hypertrace-grpc-client-utils = { module = "org.hypertrace.core.grpcutils:grpc-client-utils", version.ref = "hypertrace-grpcUtils"} | ||
| hypertrace-grpc-server-utils = { module = "org.hypertrace.core.grpcutils:grpc-server-utils", version.ref = "hypertrace-grpcUtils"} | ||
|  | ||
| grpc-bom = { module = "io.grpc:grpc-bom", version.ref = "grpc" } | ||
| grpc-api = { module = "io.grpc:grpc-api", version.ref = "grpc" } | ||
| grpc-core = { module = "io.grpc:grpc-core", version.ref = "grpc" } | ||
| grpc-services = { module = "io.grpc:grpc-services", version.ref = "grpc" } | ||
|  | ||
| google-guice = { module = "com.google.inject:guice", version.ref = "guice" } | ||
| google-guice-servlet = { module = "com.google.inject.extensions:guice-servlet", version.ref = "guice" } | ||
| jetty-servlet = { module = "org.eclipse.jetty:jetty-servlet", version.ref = "jetty" } | ||
| jetty-servlets = { module = "org.eclipse.jetty:jetty-servlets", version.ref = "jetty" } | ||
| jetty-server = { module = "org.eclipse.jetty:jetty-server", version.ref = "jetty" } | ||
| jetty-http = { module = "org.eclipse.jetty:jetty-http", version.ref = "jetty" } | ||
| javax-servlet-api = { module = "javax.servlet:javax.servlet-api", version = "4.0.1" } | ||
| dropwizard-metrics-core = {module = "io.dropwizard.metrics:metrics-core", version.ref = "dropwizardMetrics" } | ||
| dropwizard-metrics-jvm = { module = "io.dropwizard.metrics:metrics-jvm", version.ref = "dropwizardMetrics" } | ||
| dropwizard-metrics-servlets = { module = "io.dropwizard.metrics:metrics-servlets", version.ref = "dropwizardMetrics" } | ||
| prometheus-dropwizard = { module = "io.prometheus:simpleclient_dropwizard", version.ref = "prometheus" } | ||
| prometheus-servlet = { module = "io.prometheus:simpleclient_servlet", version.ref = "prometheus" } | ||
| prometheus-pushgateway = { module = "io.prometheus:simpleclient_pushgateway", version.ref = "prometheus" } | ||
|  | ||
| micrometer-core = { module = "io.micrometer:micrometer-core", version.ref = "micrometer" } | ||
| micrometer-registry-prometheus = { module = "io.micrometer:micrometer-registry-prometheus", version.ref = "micrometer" } | ||
| micrometer-jvm-extras = { module = "io.github.mweirauch:micrometer-jvm-extras", version = "0.2.2" } | ||
|  | ||
| awaitility = { module = "org.awaitility:awaitility", version = "4.0.3" } | ||
| google-guava = { module = "com.google.guava:guava", version = "31.1-jre" } | ||
| typesafe-config = { module = "com.typesafe:config", version = "1.4.2" } | ||
| lombok = { module = "org.projectlombok:lombok", version = "1.18.22" } | ||
| slf4j-api = { module = "org.slf4j:slf4j-api", version = "1.7.32" } | ||
| apache-log4j-slf4jImpl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version = "2.19.0" } | ||
| apache-httpclient = { module = "org.apache.httpcomponents:httpclient", version = "4.5.13" } | ||
|  | ||
| junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version = "5.8.2" } | ||
| mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } | ||
| mockito-junit = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } | ||
|  | ||
| [bundles] | ||
| mockito = ["mockito-core", "mockito-junit"] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -10,31 +10,33 @@ tasks.test { | |
| } | ||
|  | ||
| dependencies { | ||
| api(project(":service-framework-spi")) | ||
| implementation(project(":platform-metrics")) | ||
| api(projects.serviceFrameworkSpi) | ||
| implementation(projects.platformMetrics) | ||
|  | ||
| api("org.slf4j:slf4j-api:1.7.36") | ||
| api("com.typesafe:config:1.4.2") | ||
| api(libs.slf4j.api) | ||
| api(libs.typesafe.config) | ||
|  | ||
| // Use for thread dump servlet | ||
| implementation("io.dropwizard.metrics:metrics-servlets:4.2.10") | ||
| implementation("org.eclipse.jetty:jetty-servlet:9.4.48.v20220622") | ||
| implementation(libs.dropwizard.metrics.servlets) | ||
| implementation(libs.jetty.servlet) | ||
|  | ||
| // Use for metrics servlet | ||
| implementation("io.prometheus:simpleclient_servlet:0.12.0") | ||
| implementation(libs.prometheus.servlet) | ||
|  | ||
| // http client | ||
| implementation("org.apache.httpcomponents:httpclient:4.5.13") | ||
|  | ||
| constraints { | ||
| implementation("commons-codec:commons-codec:1.15") { | ||
| because("version 1.12 has a vulnerability https://snyk.io/vuln/SNYK-JAVA-COMMONSCODEC-561518") | ||
| implementation(libs.apache.httpclient) | ||
|  | ||
| testImplementation(libs.apache.log4j.slf4jImpl) | ||
| testImplementation(libs.junit.jupiter) | ||
| testImplementation(libs.bundles.mockito) | ||
| testImplementation(libs.jetty.servlet) { | ||
| artifact { | ||
| classifier = "tests" | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this classifier? | ||
| } | ||
| } | ||
| testImplementation(libs.jetty.http) { | ||
| artifact { | ||
| classifier = "tests" | ||
| } | ||
| } | ||
|  | ||
| testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.0") | ||
| testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") | ||
| testImplementation("org.mockito:mockito-core:3.8.0") | ||
| testImplementation("org.eclipse.jetty:jetty-servlet:9.4.48.v20220622:tests") | ||
| testImplementation("org.eclipse.jetty:jetty-http:9.4.48.v20220622:tests") | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you missed the grpc-bom - that's key!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that was needed to sync grpc versions across (which is now achieved via toml), since other grpc libraries didn't really had versions mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably should have explained and messaged this, I just started doing it inconsistently 😳
So the idea of the BOM is that by declaring it here, it should get inherited when this library is used as a dependency. The version catalog helps us declare versions consistently within a project, but the bom helps us resolve consistently across projects.
As an example of this, a common issue we see:
Imagine query service API was using grpc 1.50.0, and gateway service, running grpc 1.45.1 upgrades its query service api. it would inherit certain dependencies (grpc-stub, grpc-api etc.) at 1.50.0, but it would also have other grpc dependencies of its own (e.g. grpc-netty) at 1.45.1 leading to a version mismatch and runtime errors. By including the bom with our api's dependencies, we should (hopefully!) see grpc-netty upgraded to 1.50.0 instead. In this position, it actually works in the reverse direction - if an API were to bring in a lower version of a grpc lib that was not otherwise declared (less common scenario, since usually the servers have more grpc libs than the api packages), this would bring it up to the server's specified version.