-
Notifications
You must be signed in to change notification settings - Fork 46
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
fix: Handle returned error in select.go #1329
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1329 +/- ##
========================================
Coverage 70.55% 70.56%
========================================
Files 184 184
Lines 17784 17792 +8
========================================
+ Hits 12548 12555 +7
Misses 4280 4280
- Partials 956 957 +1
|
I'm confused by this additional if case, it has a bunch of conditions but is a noop? |
Sorry - I failed to write why that was needed in the description. Basically currently in develop at the moment (and presumably the last few releases), under those conditions we are erroring here (in the else) but ignoring the errors raised (along with any actually useful errors that should be reported). We cant just return the error (the change to the else), as commit queries with links would stop working, as instead of ignoring the errors we'd report them. |
This might be problematic, as youve written the if case to be super specific to how the commit.links field is represented (name is links, within a In the future, as we add other kinds of fields with selection sets (objects) that are system reserved (like This seems like its caused by the "catchall" So instead of using the complicated noop |
How would you write that code? You cant use f.CollectionName, as that inherits from further up the select-chain (required for stuff like aggregates). You also cant use f.Name, as otherwise it will clash with any user-defined The if-else clause shouldnt get more complex. If other cases get added prior to a rework of this whole function/flow, it should really be another if-else block specific to that case IMO. I'm also quite adverse to making this too complex right now, atm we are hopefully releasing today, and I want to avoid doing anything too complicated (i.e. risky) in the hours remaining. |
KK, we can tackle a better |
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.
LGTM
I do worry that doing it properly will not be straightforward - I really dont like the select initSource/Fields funcs, and see it almost as a symptom of deficiencies in other parts of the codebase ( At a lower-level I see the need for such a complex if-else as a sign that the |
a7acb33
to
c9393c7
Compare
c9393c7
to
b6f14f1
Compare
Relevant issue(s)
Resolves #1264
Description
Handles a previously unhandled returned error path in select.go.
An extra if-else was needed to be added, as commit queries in develop-branch actually depend on the silent ignoring of returned errors.