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 additionalArgs option to launch.json #2922

Merged
merged 6 commits into from
Oct 9, 2023
Merged

Add additionalArgs option to launch.json #2922

merged 6 commits into from
Oct 9, 2023

Conversation

dbartol
Copy link
Contributor

@dbartol dbartol commented Oct 6, 2023

This PR adds a new additionalArgs property to the QL debug configuration specified in launch.json. The property accepts a JSON object and passes all of the properties of that JSON object through to the runQuery method of the query server, without validation or interpretation. This makes it easier to prototype new query server features without having to make updates to the VS Code extension. The new property is not declared in package.json, to avoid encouraging accidental use.

Bikeshed Request: What's a better name for this property? Since it isn't in package.json, it won't show up in autocomplete for launch.json, so it should be something that internal users can remember.

Implementation notes:
Most of the code changes are just plumbing the new property all the way through to the query server.

@dbartol dbartol added the Complexity: Low A good task for newcomers to learn, or experienced team members to complete quickly. label Oct 6, 2023
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Maybe this should be gated by a check on canary mode. I don't feel too strongly about this since it's internal and undocumented anyway.

In terms of naming, something that evokes that it is internal and for running queries might be nicer. Eg- additionalRunQueryArgsInternal, or even internalrunQueryArgs.

query: quickEvalQueryPath,
additionalArgs: {
// Overrides the value passed to the query server
queryPath: simpleQueryPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh...interesting. This will allow you to override any args set by the extension. Could be dangerous, but then again it's an internal, undocumented feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. There are a few sharp edges.

@jbj
Copy link
Contributor

jbj commented Oct 9, 2023

Bikeshed Request: What's a better name for this property?

I like additionalRunQueryArgs, which is what you've named it internally. That name describes precisely what it does, which is appropriate for such a low-level feature.

Since it isn't in package.json, it won't show up in autocomplete for launch.json, so it should be something that internal users can remember.

I'd like to see the property in autocomplete. If we expect more than a handful of internal users to ever use this property, it should be as discoverable as possible. It seems to me that it's a small price to pay if a handful of external users discover it too and find it confusing. This property should only confuse someone who (1) ventures into launch.json and (2) doesn't heed the warning that's built into the name and description of the property. We can write a stern warning message in the description, clarifying that this property is passed directly to the RunQuery command of the query server without validation.

@dbartol
Copy link
Contributor Author

dbartol commented Oct 9, 2023

@jbj I like both of your suggestions, especially in combination. I've renamed the property to additionalRunQueryArgs, and I've added it to autocomplete. I think this is a good balance between discoverability for internal users while avoid accidental use by externals.

@dbartol dbartol marked this pull request as ready for review October 9, 2023 16:37
@dbartol dbartol requested a review from a team as a code owner October 9, 2023 16:37
@dbartol dbartol requested a review from a team as a code owner October 9, 2023 18:44
@dbartol dbartol enabled auto-merge October 9, 2023 18:47
@dbartol dbartol merged commit 623890a into main Oct 9, 2023
29 of 30 checks passed
@dbartol dbartol deleted the dbartol/passthru branch October 9, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Low A good task for newcomers to learn, or experienced team members to complete quickly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants