Skip to content

Commit 35ab045

Browse files
committed
Merge branch 'main' into 2025_04_10-avoid_rerender_legend
2 parents 125a221 + 0c96e34 commit 35ab045

158 files changed

Lines changed: 4107 additions & 7271 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/hooks/pre-command

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,35 @@ source .buildkite/scripts/utils.sh
66

77
echo '--- Setting job environment variables'
88

9-
# kibanamachine token to access org
10-
GITHUB_TOKEN=$(retry 5 5 vault read -field=github_token secret/kibana-issues/dev/kibanamachine)
11-
export GITHUB_TOKEN
12-
13-
# charts github app to send checks
14-
GITHUB_AUTH=$(retry 5 5 vault read -field=auth secret/datavis/github)
15-
export GITHUB_AUTH
16-
17-
FIREBASE_AUTH=$(retry 5 5 vault read -field=auth secret/datavis/firebase)
18-
export FIREBASE_AUTH
19-
20-
BUILDKITE_TOKEN=$(retry 5 5 vault read -field=token secret/datavis/buildkite)
21-
export BUILDKITE_TOKEN
9+
if [[ "${BUILDKITE_AGENT_META_DATA_AGENT_MANAGER:-}" == "kibana" ]]; then # use old paths
10+
# kibanamachine token to access org
11+
GITHUB_TOKEN=$(retry 5 5 vault read -field=github_token secret/kibana-issues/dev/kibanamachine)
12+
export GITHUB_TOKEN
13+
14+
# charts github app to send checks
15+
GITHUB_AUTH=$(retry 5 5 vault read -field=auth secret/datavis/github)
16+
export GITHUB_AUTH
17+
18+
FIREBASE_AUTH=$(retry 5 5 vault read -field=auth secret/datavis/firebase)
19+
export FIREBASE_AUTH
20+
21+
BUILDKITE_TOKEN=$(retry 5 5 vault read -field=token secret/datavis/buildkite)
22+
export BUILDKITE_TOKEN
23+
else # use new paths
24+
# kibanamachine token to access org
25+
GITHUB_TOKEN=$(retry 5 5 vault read -field=github_token secret/ci/elastic-elastic-charts/kibanamachine)
26+
export GITHUB_TOKEN
27+
28+
# charts github app to send checks
29+
GITHUB_AUTH=$(retry 5 5 vault read -field=auth secret/ci/elastic-elastic-charts/github | base64 -d)
30+
export GITHUB_AUTH
31+
32+
FIREBASE_AUTH=$(retry 5 5 vault read -field=auth secret/ci/elastic-elastic-charts/firebase | base64 -d)
33+
export FIREBASE_AUTH
34+
35+
BUILDKITE_TOKEN=$(retry 5 5 vault read -field=token secret/ci/elastic-elastic-charts/buildkite)
36+
export BUILDKITE_TOKEN
37+
fi
2238

2339
source .buildkite/scripts/node_setup.sh
2440

.buildkite/pipelines/pull_request/pipeline.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ set -euo pipefail
55
cd '.buildkite'
66

77
if [[ "${ELASTIC_BUILDKITE_INFRA:-}" =~ ^(1|true)$ ]]; then
8+
# Yarn install completely silently:
9+
yarn install 1>&2
10+
811
# The new infra requires the pipeline to emit the steps
912
yarn -s print:pipeline
1013
else

.buildkite/pipelines/pull_request/pipeline.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
} from '../../steps';
2929
import type { Step, CustomCommandStep } from '../../utils';
3030
import { bkEnv, ChangeContext, uploadPipeline } from '../../utils';
31-
import { getBuildConfig } from '../../utils/build';
3231
import { MetaDataKeys } from '../../utils/constants';
3332
import { createDeployment, createDeploymentStatus, createOrUpdateDeploymentComment } from '../../utils/deployment';
3433

@@ -41,15 +40,6 @@ void (async () => {
4140
const changeCtx = new ChangeContext();
4241
await changeCtx.init();
4342

44-
// Update main job status
45-
await updateCheckStatus(
46-
{
47-
status: 'in_progress',
48-
details_url: bkEnv.buildUrl,
49-
},
50-
getBuildConfig().main.id,
51-
);
52-
5343
const steps: Step[] = [
5444
jestStep(),
5545
eslintStep(),

.buildkite/pull-requests.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"jobs": [
3+
{
4+
"repoOwner": "elastic",
5+
"repoName": "elastic-charts",
6+
"pipelineSlug": "elastic-charts-build",
7+
8+
"enabled": true,
9+
"allow_org_users": true,
10+
"allowed_repo_permissions": ["admin", "write"],
11+
"allowed_list": ["elastic-vault-github-plugin-prod[bot]"],
12+
"set_commit_status": true,
13+
"build_on_commit": true,
14+
"build_on_comment": true,
15+
"build_drafts": true,
16+
"build_on_ready": true,
17+
"cancel_intermediate_builds": true,
18+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^\\/ci$",
19+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^\\/ci$",
20+
"skip_ci_labels": [],
21+
"skip_target_branches": [],
22+
"enable_skippable_commits": true,
23+
"skip_ci_on_only_changed": [],
24+
"always_require_ci_on_changed": [],
25+
"enable_trigger_checkbox": false,
26+
"kibana_versions_check": false,
27+
"kibana_build_reuse": false,
28+
"kibana_build_reuse_pipeline_slugs": [],
29+
"kibana_build_reuse_regexes": []
30+
},
31+
{
32+
"repoOwner": "elastic",
33+
"repoName": "elastic-charts",
34+
"pipelineSlug": "elastic-charts-build",
35+
36+
"enabled": true,
37+
"allow_org_users": true,
38+
"cancel_intermediate_builds": true,
39+
"allowed_repo_permissions": ["admin", "write"],
40+
"allowed_list": ["elastic-vault-github-plugin-prod[bot]"],
41+
"set_commit_status": true,
42+
"build_on_commit": true,
43+
"build_on_comment": false,
44+
"build_drafts": false,
45+
"build_on_ready": false,
46+
"enable_skippable_commits": false,
47+
"skip_ci_on_only_changed": [],
48+
"always_require_ci_on_changed": [],
49+
"enable_trigger_checkbox": false,
50+
"target_branch": "main"
51+
}
52+
]
53+
}

.buildkite/scripts/steps/e2e_reports.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ void (async () => {
224224
body: `Your latest commit indicated you would like me to update the vrt screenshots but this PR disallows edits. Please update your PR to allow edits and tell me to \`test this\` again.
225225
<img width="297" alt="image" src="https://user-images.githubusercontent.com/19007109/175552884-7f8e4bba-3440-444b-b19c-de15d618ac23.png">`,
226226
});
227+
throw new Error('CI run in update mode but PR does not allow edits');
227228
}
228229
}
229230
}

.buildkite/scripts/steps/eslint.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ void (async () => {
2828
// TODO: fix this to where we can install only the necessary packages in one script
2929
await yarnInstall('e2e');
3030
await yarnInstall('.buildkite');
31-
await yarnInstall('github_bot');
3231

3332
// TODO: fix this to avoid requiring build to run linting
3433
// currently the storybook and others are loosely coupled to @elastic/charts/src

.buildkite/scripts/steps/type_check.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ void (async () => {
1414
await yarnInstall('e2e');
1515
await yarnInstall('docs');
1616
await yarnInstall('.buildkite');
17-
await yarnInstall('github_bot');
1817

1918
startGroup('Running type checks');
2019

.buildkite/utils/build.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ interface Job {
1414
}
1515

1616
interface BuildConfig {
17-
main: Job;
1817
jobs: Job[];
1918
}
2019

2120
/**
2221
* This config enabled updating of required check runs when build is skipped
23-
*
24-
* TODO update this to be have a single source of truth btw here and github_bot/src/build.ts
2522
*/
2623
export const getBuildConfig = (): BuildConfig => {
2724
return {
28-
main: { name: '@elastic/datavis CI', id: 'main' },
2925
jobs: [
3026
{ name: 'Types', id: 'types' },
3127
{ name: 'API', id: 'api' },
@@ -45,12 +41,11 @@ export const getBuildConfig = (): BuildConfig => {
4541
};
4642

4743
export const getJobCheckName = (checkId: string) => {
48-
const { main, jobs } = getBuildConfig();
49-
const job = [main, ...jobs].find(({ id }) => id === checkId);
44+
const { jobs } = getBuildConfig();
45+
const job = jobs.find(({ id }) => id === checkId);
46+
5047
if (!job) {
51-
throw new Error(
52-
`Failed to find check name from step id ${checkId}. Job ids are:\n\n\t${[main, ...jobs].join('\n\t')}`,
53-
);
48+
throw new Error(`Failed to find check name from step id ${checkId}. Job ids are:\n\n\t${jobs.join('\n\t')}`);
5449
}
5550
return job.name;
5651
};

.buildkite/utils/deployment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface UpdateDeploymentCommentOptions {
3131
export async function createOrUpdateDeploymentComment(options: UpdateDeploymentCommentOptions) {
3232
const { state, preDeploy, sha = bkEnv.commit! } = options;
3333
const skipDeployment = await getMetadata(MetaDataKeys.skipDeployment);
34-
console.log('MetaDataKeys.skipDeployment', skipDeployment);
34+
console.warn('MetaDataKeys.skipDeployment', skipDeployment);
3535
const deploymentStatus = await getMetadata(MetaDataKeys.deploymentStatus);
3636
const status = preDeploy ? `${state}-preDeploy` : state;
3737

@@ -120,7 +120,7 @@ export async function updatePreviousDeployments(
120120
return;
121121
}
122122

123-
console.log(`Updating deployment ${id} state: ${currentState} -> ${state}`);
123+
console.warn(`Updating deployment ${id} state: ${currentState} -> ${state}`);
124124

125125
await octokit.repos.createDeploymentStatus({
126126
...defaultGHOptions,
@@ -141,7 +141,7 @@ export const createDeploymentStatus = async (
141141

142142
console.trace('createDeploymentStatus', options.state);
143143

144-
console.log('MetaDataKeys.skipDeployment', await getMetadata(MetaDataKeys.skipDeployment));
144+
console.warn('MetaDataKeys.skipDeployment', await getMetadata(MetaDataKeys.skipDeployment));
145145

146146
if ((await getMetadata(MetaDataKeys.skipDeployment)) === 'true') return;
147147

.buildkite/utils/github.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ export async function ghpDeploy(outDir: string) {
381381
outDir,
382382
{
383383
user: {
384-
// TODO share this between github_bot package
385384
name: 'elastic-datavis[bot]',
386385
email: '98618603+elastic-datavis[bot]@users.noreply.github.com',
387386
},
@@ -426,7 +425,7 @@ export const comments = {
426425
jobLink,
427426
preDeploy = false,
428427
}: UpdateDeploymentCommentOptions) {
429-
console.log(`DEPLOYMENT STATUS - ${state} - preDeploy: ${preDeploy}`);
428+
console.warn(`DEPLOYMENT STATUS - ${state} - preDeploy: ${preDeploy}`);
430429

431430
if (state === 'failure') {
432431
const errorCmdMsg = errorCmd

0 commit comments

Comments
 (0)