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

[ES|QL] capitalize function and operator signatures #189109

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

drewdaemon
Copy link
Contributor

@drewdaemon drewdaemon commented Jul 24, 2024

Summary

This is a follow-up to #186340. I forgot to capitalize the labels for functions and operators. Fixed now.

Before
Screenshot 2024-07-24 at 10 26 52 AM

After
Screenshot 2024-07-24 at 10 23 59 AM

Also, this PR changes the validation error messages to actually reflect what the user has typed:

Before
Screenshot 2024-07-24 at 11 43 54 AM

After
Screenshot 2024-07-24 at 11 40 48 AM
Screenshot 2024-07-24 at 11 39 54 AM

Checklist

Delete any items that are not applicable to this PR.

@drewdaemon
Copy link
Contributor Author

/ci

1 similar comment
@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana labels Jul 24, 2024
Comment on lines +211 to +225
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,
};
Copy link
Contributor Author

@drewdaemon drewdaemon Jul 24, 2024

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

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon marked this pull request as ready for review July 24, 2024 21:59
@drewdaemon drewdaemon requested a review from a team as a code owner July 24, 2024 21:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@drewdaemon drewdaemon added the release_note:skip Skip the PR/issue when compiling release notes label Jul 24, 2024
Copy link
Contributor

@stratoula stratoula left a 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)

@drewdaemon
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.3MB 3.3MB +52.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@drewdaemon drewdaemon merged commit 05b6d7e into elastic:main Jul 25, 2024
25 of 26 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.15:
- [Integration Assistant] Change ownership of integration autoImport (#188821)
- [DOCS][OAS] Add data view swap saved object references and preview APIs (#187927)
- [Links] Don't close the flyout if the user cancels save to library (#188995)

Manual backport

To create the backport manually run:

node scripts/backport --pr 189109

Questions ?

Please refer to the Backport tool documentation

@drewdaemon
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

drewdaemon added a commit to drewdaemon/kibana that referenced this pull request Jul 25, 2024
## 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
drewdaemon added a commit that referenced this pull request Jul 26, 2024
…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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:ESQL ES|QL related features in Kibana v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants