Skip to content

Conversation

@elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Aug 19, 2024

Summary

Updated js-yaml to 4.1.0.

This PR also introduces a type override for the js-yaml load function to maintain compatibility across the codebase. Specifically, updated type definition of the load function looks as follows:

function load<T = any>(str: string, opts?: jsyaml.LoadOptions): T;

The original type definition of the load function in js-yaml changed from any to unknown. This change would require extensive type updates throughout the entire repository to accommodate the unknown type. To avoid widespread type changes and potential issues in the codebase, the type is overriden back to any for now.
This is a temporary measure, we plan to address the necessary type changes in subsequent PRs, where teams will gradually update the codebase to work with the unknown type.

Checklist

Release note

Updated js-yaml to 4.1.0.

@elena-shostak
Copy link
Contributor Author

/ci

4 similar comments
@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak elena-shostak force-pushed the 190624-js-yaml-upgrade branch from cc25199 to c6c985a Compare August 20, 2024 10:43
@elena-shostak
Copy link
Contributor Author

/ci

1 similar comment
@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

@elasticmachine merge upstream

@elena-shostak
Copy link
Contributor Author

/ci

1 similar comment
@elena-shostak
Copy link
Contributor Author

/ci

yarn.lock Outdated
Copy link
Contributor Author

@elena-shostak elena-shostak Aug 21, 2024

Choose a reason for hiding this comment

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

This is coming from @istanbuljs/load-nyc-config, we can also set a resolution, though seems negligible for now.

"**/@istanbuljs/load-nyc-config/**/js-yaml": "4.1.0"

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. As this is a transitive development dependency, I think it is ok to leave this for now.

@elena-shostak elena-shostak added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// release_note:enhancement labels Aug 21, 2024
@elena-shostak elena-shostak marked this pull request as ready for review August 21, 2024 15:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@elena-shostak elena-shostak requested review from a team as code owners August 21, 2024 15:02
@elena-shostak elena-shostak requested a review from a team August 21, 2024 15:02
@kibana-ci
Copy link

kibana-ci commented Sep 18, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 46dc19c
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-190678-46dc19cbb59a

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1871 1865 -6
cloudDefend 110 104 -6
fleet 1213 1207 -6
total -18

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.5MB 3.4MB -130.7KB
cloudDefend 231.9KB 101.3KB -130.6KB
fleet 1.8MB 1.7MB -130.5KB
total -391.9KB

History

  • 💔 Build #234978 failed 3cab99a5cc0984f2d2715afc80c6a85e7825fa6b
  • 💔 Build #234963 failed 375d519b4c4793527fa114b98cca6e42bee26e07
  • 💔 Build #233623 failed 37ad472b90f9a8bf7967d0ed441fc94689de4503
  • 💔 Build #233379 failed 1cbc5a3168c76023dd9651d04b5ee1eb3e76a839
  • 💔 Build #233352 failed 3c0aa9a49617e72723b807cd74d1688c3dd05140

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

Copy link
Contributor

@vgomez-el vgomez-el left a comment

Choose a reason for hiding this comment

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

LGTM!

@elena-shostak elena-shostak merged commit 28aa274 into elastic:main Sep 19, 2024
@kibanamachine kibanamachine added v9.0.0 backport:skip This PR does not require backporting labels Sep 19, 2024
delanni added a commit that referenced this pull request Sep 19, 2024
## Summary
Main seems to be broken because of a check. These are probably
regenerated with a different shape since the js-yaml update: #190678
delanni added a commit that referenced this pull request Sep 19, 2024
## Summary
More files to be regenerated with a different shape since the js-yaml
update: #190678
elena-shostak added a commit that referenced this pull request Sep 20, 2024
## Summary

Since js-yaml update has been merged in
#190678 we don't need
`no_unsafe_js_yaml ` anymore
@elena-shostak elena-shostak deleted the 190624-js-yaml-upgrade branch October 9, 2024 14:37
@elena-shostak
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

elena-shostak added a commit to elena-shostak/kibana that referenced this pull request May 1, 2025
## Summary
Updated `js-yaml` to `4.1.0`.

This PR also introduces a type override for the `js-yaml` load function
to maintain compatibility across the codebase. Specifically, updated
type definition of the load function looks as follows:

```typescript
function load<T = any>(str: string, opts?: jsyaml.LoadOptions): T;
```

The original type definition of the load function in `js-yaml` changed
from `any` to `unknown`. This change would require extensive type
updates throughout the entire repository to accommodate the `unknown`
type. To avoid widespread type changes and potential issues in the
codebase, the type is overriden back to `any` for now.
This is a temporary measure, we plan to address the necessary type
changes in subsequent PRs, where teams will gradually update the
codebase to work with the `unknown` type.

### Checklist

- [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

## Release note
Updated `js-yaml` to `4.1.0`.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Maxim Palenov <[email protected]>
(cherry picked from commit 28aa274)

# Conflicts:
#	package.json
#	src/platform/packages/shared/kbn-ftr-common-functional-services/services/saml_auth/serverless/auth_provider.ts
#	src/platform/packages/shared/kbn-ftr-common-functional-services/services/saml_auth/stateful/auth_provider.ts
#	src/platform/packages/shared/kbn-openapi-bundler/tsconfig.json
#	x-pack/platform/plugins/shared/fleet/cypress/tsconfig.json
#	x-pack/platform/plugins/shared/fleet/server/routes/agent_policy/handlers.ts
#	x-pack/platform/plugins/shared/fleet/server/services/epm/agent/agent.ts
#	x-pack/platform/plugins/shared/integration_assistant/server/integration_builder/build_integration.ts
#	x-pack/plugins/fleet/server/services/epm/packages/get_template_inputs.ts
#	x-pack/plugins/integration_assistant/server/integration_builder/build_integration.test.ts
#	x-pack/plugins/observability_solution/observability_onboarding/common/elastic_agent_logs/system_logs/__snapshots__/generate_system_logs_yml.test.ts.snap
#	x-pack/plugins/observability_solution/observability_onboarding/common/elastic_agent_logs/system_logs/generate_system_logs_yml.ts
#	x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts
#	x-pack/plugins/osquery/docs/openapi/ess/osquery_api_2023_10_31.bundled.schema.yaml
#	x-pack/plugins/osquery/docs/openapi/serverless/osquery_api_2023_10_31.bundled.schema.yaml
#	x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml
#	x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml
#	x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml
#	x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/observability/plugins/observability_onboarding/server/routes/flow/route.ts
#	x-pack/solutions/observability/plugins/observability_onboarding/tsconfig.json
#	x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml
#	x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml
#	x-pack/test/observability_onboarding_api_integration/tests/elastic_agent/config.spec.ts
#	yarn.lock
elena-shostak added a commit that referenced this pull request May 2, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [Updated js-yaml to v4
(#190678)](#190678)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-19T10:25:03Z","message":"Updated
js-yaml to v4 (#190678)\n\n## Summary\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\nThis PR also introduces a type override for the
`js-yaml` load function\r\nto maintain compatibility across the
codebase. Specifically, updated\r\ntype definition of the load function
looks as follows:\r\n\r\n```typescript\r\nfunction load<T = any>(str:
string, opts?: jsyaml.LoadOptions): T;\r\n```\r\n\r\nThe original type
definition of the load function in `js-yaml` changed\r\nfrom `any` to
`unknown`. This change would require extensive type\r\nupdates
throughout the entire repository to accommodate the `unknown`\r\ntype.
To avoid widespread type changes and potential issues in
the\r\ncodebase, the type is overriden back to `any` for now.\r\nThis is
a temporary measure, we plan to address the necessary type\r\nchanges in
subsequent PRs, where teams will gradually update the\r\ncodebase to
work with the `unknown` type.\r\n\r\n\r\n### Checklist\r\n\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\r\n\r\n## Release
note\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Maxim Palenov
<[email protected]>","sha":"28aa274f665b1aff891bf055a592851c8ec53d30","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Security","backport:skip","Team:Fleet","v9.0.0","Team:Obs
AI
Assistant","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","apm:review"],"title":"Updated
js-yaml to
v4","number":190678,"url":"https://github.com/elastic/kibana/pull/190678","mergeCommit":{"message":"Updated
js-yaml to v4 (#190678)\n\n## Summary\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\nThis PR also introduces a type override for the
`js-yaml` load function\r\nto maintain compatibility across the
codebase. Specifically, updated\r\ntype definition of the load function
looks as follows:\r\n\r\n```typescript\r\nfunction load<T = any>(str:
string, opts?: jsyaml.LoadOptions): T;\r\n```\r\n\r\nThe original type
definition of the load function in `js-yaml` changed\r\nfrom `any` to
`unknown`. This change would require extensive type\r\nupdates
throughout the entire repository to accommodate the `unknown`\r\ntype.
To avoid widespread type changes and potential issues in
the\r\ncodebase, the type is overriden back to `any` for now.\r\nThis is
a temporary measure, we plan to address the necessary type\r\nchanges in
subsequent PRs, where teams will gradually update the\r\ncodebase to
work with the `unknown` type.\r\n\r\n\r\n### Checklist\r\n\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\r\n\r\n## Release
note\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Maxim Palenov
<[email protected]>","sha":"28aa274f665b1aff891bf055a592851c8ec53d30"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/190678","number":190678,"mergeCommit":{"message":"Updated
js-yaml to v4 (#190678)\n\n## Summary\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\nThis PR also introduces a type override for the
`js-yaml` load function\r\nto maintain compatibility across the
codebase. Specifically, updated\r\ntype definition of the load function
looks as follows:\r\n\r\n```typescript\r\nfunction load<T = any>(str:
string, opts?: jsyaml.LoadOptions): T;\r\n```\r\n\r\nThe original type
definition of the load function in `js-yaml` changed\r\nfrom `any` to
`unknown`. This change would require extensive type\r\nupdates
throughout the entire repository to accommodate the `unknown`\r\ntype.
To avoid widespread type changes and potential issues in
the\r\ncodebase, the type is overriden back to `any` for now.\r\nThis is
a temporary measure, we plan to address the necessary type\r\nchanges in
subsequent PRs, where teams will gradually update the\r\ncodebase to
work with the `unknown` type.\r\n\r\n\r\n### Checklist\r\n\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\r\n\r\n## Release
note\r\nUpdated `js-yaml` to
`4.1.0`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Maxim Palenov
<[email protected]>","sha":"28aa274f665b1aff891bf055a592851c8ec53d30"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:review backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team Team:Obs AI Assistant Observability AI Assistant Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v8.19.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.