Skip to content

Starcke/automodel queries refactor#2734

Merged
starcke merged 5 commits intomainfrom
starcke/automodel-queries-refactor
Aug 24, 2023
Merged

Starcke/automodel queries refactor#2734
starcke merged 5 commits intomainfrom
starcke/automodel-queries-refactor

Conversation

@starcke
Copy link
Copy Markdown
Contributor

@starcke starcke commented Aug 22, 2023

This generalizes the automodel queries so that they rely on shared resolution and run methods.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@starcke starcke requested review from a team as code owners August 22, 2023 12:49
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

Looking great! I really like how this is shaping up. Just some minor comments.

import { redactableError } from "../common/errors";
import { basename } from "path";

type RunQueriesOptions = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Minor) Should this be RunQueryOptions?

};
}

async function resolveAutomodelQueries(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we only expect 1 query and throw if we don't resolve exactly 1 query, I think this function should be called resolveAutomodelQuery

Copy link
Copy Markdown
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.

Nice. Just a minor comment.

);

// eslint-disable-next-line @typescript-eslint/no-unused-vars -- We only need the actual SARIF data, not the extra fields added by SarifInterpretationData
const { t, sortState, ...sarif } = await interpretResultsSarif(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: Looks like you can do this:

Suggested change
const { t, sortState, ...sarif } = await interpretResultsSarif(
const { ...sarif } = await interpretResultsSarif(

Base automatically changed from starcke/refactor-names to main August 23, 2023 10:58
@starcke starcke merged commit c584d02 into main Aug 24, 2023
@starcke starcke deleted the starcke/automodel-queries-refactor branch August 24, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants