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

add supported versions workflow #4210

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

quinna-h
Copy link
Contributor

@quinna-h quinna-h commented Dec 9, 2024

What does this PR do?

  • Adds a script find_gem_version_bounds.rb that parses gemfiles to get the minimum and maximum supported version for integrations, which is run in the workflow Generate Supported Versions
  • The script generate_table_versions.rb outputs the integrations and minimum supported versions in a markdown table.
  • Adds the gem names in the integration declarations

Generated PR example: #4236

Motivation:
Part of Autodoc generation for supported versions.

Change log entry
No.

Additional Notes:

How to test the change?

@quinna-h quinna-h added the dev/internal Other internal work that does not need to be included in the changelog label Dec 9, 2024
Copy link

github-actions bot commented Dec 9, 2024

Thank you for updating Change log entry section 👏

Visited at: 2024-12-12 08:50:22 UTC

require 'rubygems'
require 'json'

def parse_gemfiles(directory = 'gemfiles/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

find_min_gemfile.rb Outdated Show resolved Hide resolved
find_min_gemfile.rb Outdated Show resolved Hide resolved
end
end

def get_integration_names(directory = 'lib/datadog/tracing/contrib/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

find_min_gemfile.rb Outdated Show resolved Hide resolved
find_min_gemfile.rb Outdated Show resolved Hide resolved
find_min_gemfile.rb Outdated Show resolved Hide resolved
find_min_gemfile.rb Outdated Show resolved Hide resolved
find_min_gemfile.rb Outdated Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Dec 9, 2024

Benchmarks

Benchmark execution time: 2024-12-24 15:05:51

Comparing candidate commit 3b8cff4 in PR branch quinna.halim/add-supported-versions-table with baseline commit 7fd1feb in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.


# Helper: Parse a Gemfile.lock-style entry
# matches on ex. actionmailer (= 6.0.6)
def parse_gemfile_lock_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

# 1. "pessimistic" versions, ex. '~> 1.2.3'
# 2. '>= 1.2.3'
# 3. 1.2.3
def extract_version(constraint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation


# Helper: Parse a Gemfile-style gem declaration
# ex. gem 'ruby-kafka', '~> 5.0'
def parse_gemfile_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end

# Helper: Validate the version format
def version_valid?(version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

@quinna-h quinna-h requested a review from TonyCTHsu December 11, 2024 15:11
end
end

def get_integration_names(directory = 'lib/datadog/tracing/contrib/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end

# Helper: Validate the version format
def version_valid?(version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

# 1. "pessimistic" versions, ex. '~> 1.2.3'
# 2. '>= 1.2.3'
# 3. 1.2.3
def extract_version(constraint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation


# Helper: Parse a Gemfile-style gem declaration
# ex. gem 'ruby-kafka', '~> 5.0'
def parse_gemfile_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation


# Helper: Parse a Gemfile.lock-style entry
# matches on ex. actionmailer (= 6.0.6)
def parse_gemfile_lock_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

require 'rubygems'
require 'json'

def parse_gemfiles(directory = 'gemfiles/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Dec 11, 2024

Datadog Report

Branch report: quinna.halim/add-supported-versions-table
Commit report: 3b8cff4
Test service: dd-trace-rb

✅ 0 Failed, 22109 Passed, 1475 Skipped, 5m 28.22s Total Time


# Helper: Parse a Gemfile.lock-style entry
# matches on ex. actionmailer (= 6.0.6)
def parse_gemfile_lock_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation


# Helper: Parse a Gemfile-style gem declaration
# ex. gem 'ruby-kafka', '~> 5.0'
def parse_gemfile_entry(line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

require 'rubygems'
require 'json'

def parse_gemfiles(directory = 'gemfiles/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end

# Helper: Validate the version format
def version_valid?(version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

# 1. "pessimistic" versions, ex. '~> 1.2.3'
# 2. '>= 1.2.3'
# 3. 1.2.3
def extract_version(constraint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end
end

def get_integration_names(directory = 'lib/datadog/tracing/contrib/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation


| Integration | Ruby Min | Ruby Max | JRuby Min | JRuby Max |
|-------------|----------|-----------|----------|----------|
| action_cable | 5.2.8.1 | 7.1.3.4 | 5.2.8.1 | 6.1.7.8 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion for excluded versions (e.g. != 3.7.0) is to add an extra column (Ruby Unsupported & JRuby Unsupported) and add these individually excluded versions in it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcotc Are there currently versions that need are excluded within supported ranges of gems or is this something that would be a nice to have?

integration_versions.md Outdated Show resolved Hide resolved
@marcotc
Copy link
Member

marcotc commented Dec 13, 2024

Potentially either the existing Update Latest Dependency workflow or a new workflow

I'd say add it to Update Latest Dependency for now. It should technically be on every PR that changes dependencies, but would be tricky to coordinate two automated commits at the same time (this and the existing Lock Dependency action).

end
end

def parse_gemfile(gemfile_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

.github/scripts/find_gem_version_bounds.rb Outdated Show resolved Hide resolved
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'datadog'

def parse_gemfiles(directory = 'gemfiles/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end
end

def update_gem_versions(runtime, gem_name, version, min_gems, max_gems)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

[min_gems['ruby'], min_gems['jruby'], max_gems['ruby'], max_gems['jruby']]
end

def process_gemfile(gemfile_name, runtime, min_gems, max_gems)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end
end

def process_lockfile(gemfile_name, runtime, min_gems, max_gems)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Code Quality Violation

Avoid top-level methods definition. Organize methods in modules/classes. (...read more)

This rule emphasizes the importance of organizing methods within modules or classes in Ruby. In Ruby, it's considered a best practice to wrap methods within classes or modules. This is because it helps in grouping related methods together, which in turn makes the code easier to understand, maintain, and reuse.

Not adhering to this rule can lead to a disorganized codebase, making it hard for other developers to understand and maintain the code. It can also lead to potential name clashes if a method is defined in the global scope.

To avoid violating this rule, always define your methods within a class or a module. For example, instead of writing def some_method; end, you should write class SomeClass def some_method; end end. This not only adheres to the rule but also improves the readability and maintainability of your code.

View in Datadog  Leave us feedback  Documentation

end

def process_gemfile(gemfile_name, runtime, min_gems, max_gems)
begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Quality Violation

Use the method's implicit 'begin' instead of adding an explicit 'begin' block (...read more)

In Ruby, every method has an implicit begin...end block. Therefore, using an explicit begin...end block at the beginning of a method is redundant and can lead to unnecessary code complexity. This rule is designed to ensure that your code is as clean and efficient as possible.

The importance of this rule lies in the practice of writing clean, maintainable, and efficient code. Unnecessary code can lead to confusion for other developers, making the codebase more difficult to understand and maintain. It can also lead to potential bugs or performance issues.

To adhere to this rule, ensure that you do not use an explicit begin...end block at the beginning of a method. Instead, you can use the method's implicit begin and only use an explicit begin...end block when you want to handle exceptions in a specific part of your method. This practice will lead to cleaner and more efficient code.

View in Datadog  Leave us feedback  Documentation

@quinna-h
Copy link
Contributor Author

Potentially either the existing Update Latest Dependency workflow or a new workflow

I'd say add it to Update Latest Dependency for now. It should technically be on every PR that changes dependencies, but would be tricky to coordinate two automated commits at the same time (this and the existing Lock Dependency action).

I think we are going to end up putting it in a separate workflow, as we want it to be tied to the tracer release process (but for now make it manual, aka triggered on workflow dispatch)

@quinna-h quinna-h requested a review from bouwkast December 19, 2024 19:44
@github-actions github-actions bot added the dev/github Github repository maintenance and automation label Dec 19, 2024
Copy link
Contributor

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We should get a language experts review on this and the output table here to ensure that they are happy with the integrations and associated versions: https://github.com/DataDog/dd-trace-rb/pull/4236/files#diff-f0b9875c282b2a3ae40002cd5ea7085509e744df2ba94d0301f5c0ba313203fd

.github/scripts/generate_table_versions.rb Outdated Show resolved Hide resolved

# TODO: The gem information should reside in the integration declaration instead of here.

mapping = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some that I don't see and I don't think have a clear automation path that we could potentially just hardcode in:

Net/HTTP and Makara (via Active Record) are the only two I see (may have missed one though)

Just went through the list of them here: https://docs.datadoghq.com/tracing/trace_collection/compatibility/ruby/#integrations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left comments about these on the generated PR: #4236

on:
push:
branches:
- quinna.halim/add-supported-versions-table
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self: remove before merge

@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Dec 23, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 97.73%. Comparing base (11b9ae1) to head (3b8cff4).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...atadog/tracing/contrib/action_cable/integration.rb 50.00% 1 Missing ⚠️
...tadog/tracing/contrib/action_mailer/integration.rb 50.00% 1 Missing ⚠️
...datadog/tracing/contrib/action_pack/integration.rb 50.00% 1 Missing ⚠️
...datadog/tracing/contrib/action_view/integration.rb 50.00% 1 Missing ⚠️
.../datadog/tracing/contrib/active_job/integration.rb 50.00% 1 Missing ⚠️
...tadog/tracing/contrib/active_record/integration.rb 50.00% 1 Missing ⚠️
...adog/tracing/contrib/active_support/integration.rb 50.00% 1 Missing ⚠️
lib/datadog/tracing/contrib/aws/integration.rb 50.00% 1 Missing ⚠️
...dog/tracing/contrib/concurrent_ruby/integration.rb 50.00% 1 Missing ⚠️
lib/datadog/tracing/contrib/httprb/integration.rb 50.00% 1 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4210      +/-   ##
==========================================
- Coverage   97.74%   97.73%   -0.02%     
==========================================
  Files        1355     1355              
  Lines       82333    82374      +41     
  Branches     4226     4228       +2     
==========================================
+ Hits        80477    80508      +31     
- Misses       1856     1866      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/github Github repository maintenance and automation dev/internal Other internal work that does not need to be included in the changelog integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants