-
Notifications
You must be signed in to change notification settings - Fork 377
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
GraphQL: Report multiple query errors #4177
base: master
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ❌ 5 Failed (0 Known Flaky), 20330 Passed, 1419 Skipped, 5m 47.5s Total Time ❌ Failed Tests (5)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4177 +/- ##
==========================================
- Coverage 97.76% 97.75% -0.01%
==========================================
Files 1351 1351
Lines 81733 81789 +56
Branches 4147 4149 +2
==========================================
+ Hits 79904 79955 +51
- Misses 1829 1834 +5 ☔ View full report in Codecov by Sentry. |
BenchmarksBenchmark execution time: 2025-01-16 23:39:48 Comparing candidate commit af565a0 in PR branch Found 0 performance improvements and 9 performance regressions! Performance is the same for 23 metrics, 1 unstable metrics. scenario:library - Gem loading
scenario:profiler - Major GC runs (profiling disabled)
scenario:profiler - Major GC runs (profiling enabled)
scenario:tracing - 1 span trace - no network
scenario:tracing - 1 span trace - no writer
scenario:tracing - 10 span trace - no network
scenario:tracing - 10 span trace - no writer
scenario:tracing - 100 span trace - no network
scenario:tracing - 100 span trace - no writer
|
@@ -89,9 +125,10 @@ def execute_field_lazy(*args, **kwargs) | |||
execute_field_span(proc { super }, 'resolve_lazy', **kwargs) | |||
end | |||
|
|||
def authorized_span(callable, span_key, **kwargs) | |||
def authorized_span(callable, span_key, *args, **kwargs) |
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.
⚪ Code Quality Violation
Optional arguments should appear at the end (...read more)
The rule "Optional arguments should appear at the end" is an important programming practice in Ruby. It is used to ensure that the optional parameters in a method definition are placed after the required parameters. This rule is important because when a method is called, Ruby fills in the arguments from left to right. If an optional argument is placed before a required argument and the method is called with fewer arguments, Ruby will assign the provided arguments to the optional parameters, leaving the required parameters without values and causing an error.
Non-compliance with this rule often leads to unexpected behavior or bugs in the code, which can be quite challenging to debug. This is particularly true when the method is called with fewer arguments than defined. The errors caused by this can be hard to track down, as they may not occur at the place where the method is defined, but rather in some distant place where the method is called.
To avoid this, always place optional parameters at the end of the list of parameters in your method definitions. This way, Ruby will fill in the required parameters first, and only then use any remaining arguments for the optional ones. If there are no remaining arguments, the optional parameters will be set to their default values. This keeps your code clear, predictable, and free of unnecessary bugs.
Change log entry
GraphQL query errors are now reported as Span Events. This includes support for multiple errors, if present.
How to test the change?
All changes are tested.