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

CodeQL model editor: Add functions for parsing complex access path suggestion options #3292

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

shati-patel
Copy link
Contributor

@shati-patel shati-patel commented Jan 30, 2024

This PR adds some helper functions + types for parsing suggestions into a suitable format that we can display as dropdown suggestions in the model editor. (The suggestions will come from running a CodeQL query when the model editor starts up. That logic will be added in a later PR 🔜 )

See internal linked issue for more context 🗺️

Checklist

N/A

  • 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.

Sorry, something went wrong.

@shati-patel shati-patel force-pushed the shati-patel/suggestions branch from 0269113 to 388c2e1 Compare January 30, 2024 14:27
@shati-patel shati-patel changed the base branch from shati-patel/suggestion-types to main January 30, 2024 14:29
@shati-patel shati-patel changed the title Add functions for parsing query output to suggestion options CodeQL model editor: Add functions for parsing query output to suggestion options Jan 30, 2024
@shati-patel shati-patel changed the title CodeQL model editor: Add functions for parsing query output to suggestion options CodeQL model editor: Add functions for parsing complex access path suggestion options Jan 30, 2024
@shati-patel shati-patel marked this pull request as ready for review January 30, 2024 14:35
@shati-patel shati-patel requested a review from a team as a code owner January 30, 2024 14:35

const options = parseAccessPathSuggestionRowsToOptions(rows);
expect(options).toEqual(expectedOptions);
expect(options).not.toEqual(reorderedOptions);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need this specific check since this is already checked by the previous line (although implicitly). Perhaps we can add a comment to expectedOptions that the order matters instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, good point 🙃 I'll remove that extra check!

Copy link
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

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

Thanks!

@shati-patel shati-patel merged commit 8c679ab into main Jan 30, 2024
15 checks passed
@shati-patel shati-patel deleted the shati-patel/suggestions branch January 30, 2024 16:17
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.

None yet

2 participants