Skip to content

Commit

Permalink
[8.x] Fix telemetry CLI to write empty properties collection (#205746) (
Browse files Browse the repository at this point in the history
#205786)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Fix telemetry CLI to write empty properties collection
(#205746)](#205746)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Michael
Dokolin","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-07T16:46:43Z","message":"Fix
telemetry CLI to write empty properties collection
(#205746)\n\nFollow-up of #205613. Remove check blocking empty
properties
from\nwriting.","sha":"aa8195ced450bf97145fa27cadd3e6b8c922487f","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:version","v8.18.0"],"title":"Fix
telemetry CLI to write empty properties
collection","number":205746,"url":"https://github.com/elastic/kibana/pull/205746","mergeCommit":{"message":"Fix
telemetry CLI to write empty properties collection
(#205746)\n\nFollow-up of #205613. Remove check blocking empty
properties
from\nwriting.","sha":"aa8195ced450bf97145fa27cadd3e6b8c922487f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205746","number":205746,"mergeCommit":{"message":"Fix
telemetry CLI to write empty properties collection
(#205746)\n\nFollow-up of #205613. Remove check blocking empty
properties
from\nwriting.","sha":"aa8195ced450bf97145fa27cadd3e6b8c922487f"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Michael Dokolin <[email protected]>
  • Loading branch information
kibanamachine and dokmic authored Jan 7, 2025
1 parent 3ed9724 commit b456840
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function writeToFileTask({ roots }: TaskContext) {
return roots.map((root) => ({
task: async () => {
const fullPath = path.resolve(process.cwd(), root.config.output);
if (root.mapping && Object.keys(root.mapping.properties).length > 0) {
if (root.mapping) {
// Sort first-level properties alphabetically
root.mapping.properties = Object.fromEntries(
Object.entries(root.mapping.properties).sort(([a], [b]) => {
Expand Down

0 comments on commit b456840

Please sign in to comment.