[7.17] Remove CI Composite Storybook (#171258) (#171762)

# Backport

Manual backport due to merge conflicts.

This will backport the following commits from `main` to `7.17`:
- [Remove CI Composite Storybook
(#171258)](https://github.com/elastic/kibana/pull/171258)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Brad
White","email":"Ikuni17@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-11-21T21:59:39Z","message":"Remove
CI Composite Storybook (#171258)\n\n## Summary\r\nCloses
#160803\r\n\r\nThis PR removes the `CI Composite` story because it has
been broken\r\nsince at least ac23dce29f
(and possibly\r\nsince b862a6c181). The
functionality is\r\ncovered by the generated `index.html`
in\r\ndda4498fee/.buildkite/scripts/steps/storybooks/build_and_upload.ts (L105-L120)\r\n\r\nTo
fix the composite story requires generating `stories.json` for
every\r\nstorybook, which requires migrating the repo off the
deprecated\r\n`storiesOf` API. That task is quite extensive and would be
better\r\nhandled alongside an upgrade to Storybook
7.x","sha":"1919c87b90c4f489c2027d71293631d89034f40f","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","ci:build-storybooks","v8.12.0"],"number":171258,"url":"https://github.com/elastic/kibana/pull/171258","mergeCommit":{"message":"Remove
CI Composite Storybook (#171258)\n\n## Summary\r\nCloses
#160803\r\n\r\nThis PR removes the `CI Composite` story because it has
been broken\r\nsince at least ac23dce29f
(and possibly\r\nsince b862a6c181). The
functionality is\r\ncovered by the generated `index.html`
in\r\ndda4498fee/.buildkite/scripts/steps/storybooks/build_and_upload.ts (L105-L120)\r\n\r\nTo
fix the composite story requires generating `stories.json` for
every\r\nstorybook, which requires migrating the repo off the
deprecated\r\n`storiesOf` API. That task is quite extensive and would be
better\r\nhandled alongside an upgrade to Storybook
7.x","sha":"1919c87b90c4f489c2027d71293631d89034f40f"}},"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/171258","number":171258,"mergeCommit":{"message":"Remove
CI Composite Storybook (#171258)\n\n## Summary\r\nCloses
#160803\r\n\r\nThis PR removes the `CI Composite` story because it has
been broken\r\nsince at least ac23dce29f
(and possibly\r\nsince b862a6c181). The
functionality is\r\ncovered by the generated `index.html`
in\r\ndda4498fee/.buildkite/scripts/steps/storybooks/build_and_upload.ts (L105-L120)\r\n\r\nTo
fix the composite story requires generating `stories.json` for
every\r\nstorybook, which requires migrating the repo off the
deprecated\r\n`storiesOf` API. That task is quite extensive and would be
better\r\nhandled alongside an upgrade to Storybook
7.x","sha":"1919c87b90c4f489c2027d71293631d89034f40f"}},{"url":"https://github.com/elastic/kibana/pull/171695","number":171695,"branch":"8.11","state":"OPEN"}]}]
BACKPORT-->

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Brad White 2023-11-27 11:53:56 -07:00 committed by GitHub
parent 728fcb9e23
commit 5ff42151be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 35 deletions

View file

@ -15,7 +15,6 @@ const STORYBOOKS = [
'apm',
'canvas',
'codeeditor',
'ci_composite',
'custom_integrations',
'url_template_editor',
'dashboard',
@ -74,14 +73,12 @@ const upload = () => {
console.log('--- Generating Storybooks HTML');
process.chdir(path.join('.', 'built_assets', 'storybook'));
fs.renameSync('ci_composite', 'composite');
const storybooks = execSync(`ls -1d */`)
.toString()
.trim()
.split('\n')
.map((path) => path.replace('/', ''))
.filter((path) => path !== 'composite');
.map((filePath) => filePath.replace('/', ''));
const listHtml = storybooks
.map((storybook) => `<li><a href="${STORYBOOK_BASE_URL}/${storybook}">${storybook}</a></li>`)
@ -91,8 +88,6 @@ const upload = () => {
<html>
<body>
<h1>Storybooks</h1>
<p><a href="${STORYBOOK_BASE_URL}/composite">Composite Storybook</a></p>
<h2>All</h2>
<ul>
${listHtml}
</ul>

View file

@ -1,28 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
const config = require('@kbn/storybook').defaultConfig;
const aliases = require('../../src/dev/storybook/aliases.ts').storybookAliases;
config.refs = {};
for (const alias of Object.keys(aliases).filter((a) => a !== 'ci_composite')) {
// snake_case -> Title Case
const title = alias
.replace(/_/g, ' ')
.split(' ')
.map((n) => n[0].toUpperCase() + n.slice(1))
.join(' ');
config.refs[alias] = {
title: title,
url: `${process.env.STORYBOOK_BASE_URL}/${alias}`,
};
}
module.exports = config;

View file

@ -11,7 +11,6 @@ export const storybookAliases = {
apm: 'x-pack/plugins/apm/.storybook',
canvas: 'x-pack/plugins/canvas/storybook',
codeeditor: 'src/plugins/kibana_react/public/code_editor/.storybook',
ci_composite: '.ci/.storybook',
custom_integrations: 'src/plugins/custom_integrations/storybook',
url_template_editor: 'src/plugins/kibana_react/public/url_template_editor/.storybook',
dashboard: 'src/plugins/dashboard/.storybook',