-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] capitalize function and operator signatures #189109
Conversation
/ci |
1 similar comment
/ci |
return { | ||
text: signatures.some(({ params }) => params.length > 1) | ||
? `${name.toUpperCase()} $0` | ||
: name.toUpperCase(), | ||
label: name.toUpperCase(), | ||
}; | ||
} | ||
return `${name.toUpperCase()}($0)`; | ||
const printedSignatures = getFunctionSignatures(definition, { | ||
withTypes: true, | ||
capitalize: true, | ||
}); | ||
return { | ||
text: `${name.toUpperCase()}($0)`, | ||
label: printedSignatures[0].declaration, | ||
}; |
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.
This change means the autocomplete tests will check that the label is capitalized as well as the insertion text
/ci |
/ci |
Pinging @elastic/kibana-esql (Team:ESQL) |
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.
Awesome! (this might have some conflicts when backported)
/ci |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary This is a follow-up to elastic#186340. I forgot to capitalize the labels for functions and operators. Fixed now. **Before** <img width="1321" alt="Screenshot 2024-07-24 at 10 26 52 AM" src="https://github.com/user-attachments/assets/05102828-0469-4b14-a2f9-34a160edbd18"> **After** <img width="1286" alt="Screenshot 2024-07-24 at 10 23 59 AM" src="https://github.com/user-attachments/assets/dd01ccde-ec12-4ad3-98f7-561e5d233e52"> Also, this PR changes the validation error messages to actually reflect what the user has typed: **Before** <img width="697" alt="Screenshot 2024-07-24 at 11 43 54 AM" src="https://github.com/user-attachments/assets/28cbbd4c-1b3e-4d22-a1af-33b2f17af597"> **After** <img width="709" alt="Screenshot 2024-07-24 at 11 40 48 AM" src="https://github.com/user-attachments/assets/dffd4a29-d348-44d0-ba58-00a0a70d04b3"> <img width="663" alt="Screenshot 2024-07-24 at 11 39 54 AM" src="https://github.com/user-attachments/assets/dff0c726-d028-4826-a1cd-030e733987a7"> ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 05b6d7e) # Conflicts: # packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.stats.test.ts # packages/kbn-esql-validation-autocomplete/src/autocomplete/__tests__/helpers.ts
…189216) # Backport This will backport the following commits from `main` to `8.15`: - [[ES|QL] capitalize function and operator signatures (#189109)](#189109) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Drew Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-25T14:32:52Z","message":"[ES|QL] capitalize function and operator signatures (#189109)\n\n## Summary\r\n\r\nThis is a follow-up to #186340. I\r\nforgot to capitalize the labels for functions and operators. Fixed now.\r\n\r\n**Before**\r\n<img width=\"1321\" alt=\"Screenshot 2024-07-24 at 10 26 52 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/05102828-0469-4b14-a2f9-34a160edbd18\">\r\n\r\n**After**\r\n<img width=\"1286\" alt=\"Screenshot 2024-07-24 at 10 23 59 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dd01ccde-ec12-4ad3-98f7-561e5d233e52\">\r\n\r\nAlso, this PR changes the validation error messages to actually reflect\r\nwhat the user has typed:\r\n\r\n**Before**\r\n<img width=\"697\" alt=\"Screenshot 2024-07-24 at 11 43 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/28cbbd4c-1b3e-4d22-a1af-33b2f17af597\">\r\n\r\n**After**\r\n<img width=\"709\" alt=\"Screenshot 2024-07-24 at 11 40 48 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dffd4a29-d348-44d0-ba58-00a0a70d04b3\">\r\n<img width=\"663\" alt=\"Screenshot 2024-07-24 at 11 39 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dff0c726-d028-4826-a1cd-030e733987a7\">\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"05b6d7eacc7dfa0f0419982cd002e83e8be6c1b0","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.15.0","v8.16.0"],"number":189109,"url":"https://github.com/elastic/kibana/pull/189109","mergeCommit":{"message":"[ES|QL] capitalize function and operator signatures (#189109)\n\n## Summary\r\n\r\nThis is a follow-up to #186340. I\r\nforgot to capitalize the labels for functions and operators. Fixed now.\r\n\r\n**Before**\r\n<img width=\"1321\" alt=\"Screenshot 2024-07-24 at 10 26 52 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/05102828-0469-4b14-a2f9-34a160edbd18\">\r\n\r\n**After**\r\n<img width=\"1286\" alt=\"Screenshot 2024-07-24 at 10 23 59 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dd01ccde-ec12-4ad3-98f7-561e5d233e52\">\r\n\r\nAlso, this PR changes the validation error messages to actually reflect\r\nwhat the user has typed:\r\n\r\n**Before**\r\n<img width=\"697\" alt=\"Screenshot 2024-07-24 at 11 43 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/28cbbd4c-1b3e-4d22-a1af-33b2f17af597\">\r\n\r\n**After**\r\n<img width=\"709\" alt=\"Screenshot 2024-07-24 at 11 40 48 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dffd4a29-d348-44d0-ba58-00a0a70d04b3\">\r\n<img width=\"663\" alt=\"Screenshot 2024-07-24 at 11 39 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dff0c726-d028-4826-a1cd-030e733987a7\">\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"05b6d7eacc7dfa0f0419982cd002e83e8be6c1b0"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/189109","number":189109,"mergeCommit":{"message":"[ES|QL] capitalize function and operator signatures (#189109)\n\n## Summary\r\n\r\nThis is a follow-up to #186340. I\r\nforgot to capitalize the labels for functions and operators. Fixed now.\r\n\r\n**Before**\r\n<img width=\"1321\" alt=\"Screenshot 2024-07-24 at 10 26 52 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/05102828-0469-4b14-a2f9-34a160edbd18\">\r\n\r\n**After**\r\n<img width=\"1286\" alt=\"Screenshot 2024-07-24 at 10 23 59 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dd01ccde-ec12-4ad3-98f7-561e5d233e52\">\r\n\r\nAlso, this PR changes the validation error messages to actually reflect\r\nwhat the user has typed:\r\n\r\n**Before**\r\n<img width=\"697\" alt=\"Screenshot 2024-07-24 at 11 43 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/28cbbd4c-1b3e-4d22-a1af-33b2f17af597\">\r\n\r\n**After**\r\n<img width=\"709\" alt=\"Screenshot 2024-07-24 at 11 40 48 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dffd4a29-d348-44d0-ba58-00a0a70d04b3\">\r\n<img width=\"663\" alt=\"Screenshot 2024-07-24 at 11 39 54 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/dff0c726-d028-4826-a1cd-030e733987a7\">\r\n\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"05b6d7eacc7dfa0f0419982cd002e83e8be6c1b0"}}]}] BACKPORT-->
Summary
This is a follow-up to #186340. I forgot to capitalize the labels for functions and operators. Fixed now.
Before
After
Also, this PR changes the validation error messages to actually reflect what the user has typed:
Before
After
Checklist
Delete any items that are not applicable to this PR.