fleet/frontend/components/forms/validators
Scott Gress 183d0d8150
Update SQL parser to handle more modern syntax (#28211)
For #26366

# Checklist for submitter

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.

# Details

This PR fixes an issue where the SQL parser in the UI doesn't recognize
window functions like `OVER()` and marks the SQL as having syntax
errors. The fix here is to update to a more modern parsing library. This
involved updating some AST-parsing code we have for determining which
tables are used in a query, for the purposes of feeding autocomplete and
determining query compatibility.

# Testing

I tested this with the query mentioned in #26366 in Chrome, Firefox and
Safari on MacOS. I also added new unit tests for our SQL helper
functions.

# Notes

During testing I discovered that we were bundling two versions of the
ACE editor into our frontend package. By upgrading one version by a
couple of patches to make the two dependencies equal, we chop out ~300k
from our bundle.
2025-04-16 10:10:52 -05:00
..
valid_email Frontend: Improve URL and email validation (#18445) 2024-04-25 13:03:30 -04:00
valid_jwt_token License features (#1134) 2017-02-09 22:16:51 -05:00
valid_password Fleet UI: No role = no access, refactor jsx class components to typescript functional components (#12953) 2023-08-02 11:29:49 -04:00
valid_url Full-stack: Make "Server url" validation conditions consistent across Fleet, update Web Address form validation and submission logic per Fleet best practices (frontend/docs/patterns.md) (#27455) 2025-03-27 13:56:38 -07:00
validate_equality Fleet UI: No role = no access, refactor jsx class components to typescript functional components (#12953) 2023-08-02 11:29:49 -04:00
validate_numericality Create packs (#516) 2016-12-21 12:25:54 -05:00
validate_presence Fleet UI: 2FA (#24442) 2024-12-05 15:54:43 -05:00
validate_query Update SQL parser to handle more modern syntax (#28211) 2025-04-16 10:10:52 -05:00
validate_yaml Updated API routes to use current format for frontend use (#5018) 2022-04-11 13:04:38 -07:00