Skip to content

pin dependencies from yarn.lock to package.json#244556

Merged
delanni merged 22 commits intoelastic:mainfrom
delanni:pin-dependencies-in-package.json
Jan 7, 2026
Merged

pin dependencies from yarn.lock to package.json#244556
delanni merged 22 commits intoelastic:mainfrom
delanni:pin-dependencies-in-package.json

Conversation

@delanni
Copy link
Copy Markdown
Member

@delanni delanni commented Nov 27, 2025

Summary

Closes #243396

@delanni delanni added Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting ci:beta-faster-pr-build labels Nov 27, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@delanni delanni requested a review from a team November 28, 2025 10:13
@mistic mistic removed the request for review from rgodfrey-elastic December 24, 2025 15:34
if (typeof version !== 'string') continue;

if (version.startsWith('^') || version.startsWith('~')) {
deps[name] = version.slice(1);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure this is the correct fix.
^1.2.4 might refer to anything within the 1.x.x scope, so correcting it to 1.2.4 might be a downgrade. I think a more appropriate fix here could be to look up the resolved version of that package, either from node_modules/*/package.json or from yarn.lock.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is meant to be a quick check for the new added ones from now on so what we change at this PR will be the baseline going forward. In any case its your PR and what you mentioned is a richer solution.

Copy link
Copy Markdown
Contributor

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Changes in .buildkite/scripts/steps/security/third_party_packages.txt LGTM. Thanks!

(Optional) It would be great if we could add some documentation to the code for src/dev/no_pkg_semver_ranges/index.ts to explain exactly what this script does, when it runs, and how it affects existing entries in package.json.

@delanni delanni removed request for a team January 5, 2026 15:55
const PKG_JSON_PATH = resolve(REPO_ROOT, 'package.json');
const YARN_LOCK_PATH = resolve(REPO_ROOT, 'yarn.lock');
const DEPENDENCIES_FIELDS = ['dependencies', 'devDependencies'] as const;
const RESOLUTIONS_FIELD = 'resolutions';
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mistic I'm not sure if we should treat the resolutions field the same way, I'm afraid we can't find what's the correct resolved version for these patterns, for example a packageA/packageB/**/packageC rule like this is hard to track down. So I left the resolution step to be a manual update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

its up to you. Im okay either way

const PKG_JSON_PATH = resolve(REPO_ROOT, 'package.json');
const YARN_LOCK_PATH = resolve(REPO_ROOT, 'yarn.lock');
const DEPENDENCIES_FIELDS = ['dependencies', 'devDependencies'] as const;
const RESOLUTIONS_FIELD = 'resolutions';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This const is not used currently

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

Copy link
Copy Markdown
Contributor

@mistic mistic left a comment

Choose a reason for hiding this comment

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

lgtm

@delanni
Copy link
Copy Markdown
Member Author

delanni commented Jan 19, 2026

💚 All backports created successfully

Status Branch Result
9.3
9.2
9.1
8.19

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

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v8.19.11 v9.1.11 v9.2.5 v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Ops] Pin dependency versions in package.json

7 participants