Skip to content

Commit

Permalink
[8.11] fix(NA): getPluginsDistFromRepo to return only dist plugins on…
Browse files Browse the repository at this point in the history
… build (elastic#171457) (elastic#171504)

# Backport

This will backport the following commits from `main` to `8.11`:
- [fix(NA): getPluginsDistFromRepo to return only dist plugins on build
(elastic#171457)](elastic#171457)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Tiago
Costa","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-20T09:52:53Z","message":"fix(NA):
getPluginsDistFromRepo to return only dist plugins on build
(elastic#171457)\n\nThis PR fixes a problem where the `getPluginsDistFromRepo`
would return\r\nevery available plugin and not only the dist
ones.","sha":"92b6b82d1c9c35db82af3c0d9f7e9c18a68483c8","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:prev-minor","v8.12.0"],"number":171457,"url":"https://github.com/elastic/kibana/pull/171457","mergeCommit":{"message":"fix(NA):
getPluginsDistFromRepo to return only dist plugins on build
(elastic#171457)\n\nThis PR fixes a problem where the `getPluginsDistFromRepo`
would return\r\nevery available plugin and not only the dist
ones.","sha":"92b6b82d1c9c35db82af3c0d9f7e9c18a68483c8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/171457","number":171457,"mergeCommit":{"message":"fix(NA):
getPluginsDistFromRepo to return only dist plugins on build
(elastic#171457)\n\nThis PR fixes a problem where the `getPluginsDistFromRepo`
would return\r\nevery available plugin and not only the dist
ones.","sha":"92b6b82d1c9c35db82af3c0d9f7e9c18a68483c8"}}]}] BACKPORT-->

Co-authored-by: Tiago Costa <[email protected]>
  • Loading branch information
kibanamachine and mistic authored Nov 20, 2023
1 parent 0e2d46d commit 0934f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dev/build/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,6 @@ export class Config {
}

getDistPluginsFromRepo() {
return getPackages(this.repoRoot).filter(this.pluginFilter);
return getPackages(this.repoRoot).filter((p) => !p.isDevOnly() && this.pluginFilter(p));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
* Side Public License, v 1.
*/

import { PluginPackage } from '@kbn/repo-packages';
import { findUsedDependencies } from './find_used_dependencies';
import { read, write, Task } from '../../lib';

export const CreatePackageJson: Task = {
description: 'Creating build-ready version of package.json',

async run(config, log, build) {
const plugins = config.getDistPluginsFromRepo();
const plugins = config.getDistPluginsFromRepo() as PluginPackage[];
const distPkgIds = new Set(config.getDistPackagesFromRepo().map((p) => p.id));
const pkg = config.getKibanaPkg();

Expand Down

0 comments on commit 0934f86

Please sign in to comment.