diff --git a/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml b/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml index 76d846134cc22..f711c231e6aef 100644 --- a/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml +++ b/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml @@ -60,10 +60,6 @@ spec: cronline: 0 22 * * * America/New_York message: Daily build branch: '8.19' - Daily build (7.17): - cronline: 0 20 * * * America/New_York - message: Daily build - branch: '7.17' tags: - kibana --- @@ -91,7 +87,7 @@ spec: SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' allow_rebuilds: true - branch_configuration: main 9.2 9.1 8.19 7.17 + branch_configuration: main 9.2 9.1 8.19 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/es_snapshots/promote.yml @@ -140,7 +136,7 @@ spec: ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' REPORT_FAILED_TESTS_TO_GITHUB: 'true' allow_rebuilds: true - branch_configuration: main 9.2 9.1 8.19 7.17 + branch_configuration: main 9.2 9.1 8.19 default_branch: main repository: elastic/kibana pipeline_file: .buildkite/pipelines/es_snapshots/verify.yml diff --git a/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh b/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh index 1e8256d8c6645..fbca8945292ad 100644 --- a/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh +++ b/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh @@ -9,6 +9,13 @@ set -euo pipefail export ES_SNAPSHOT_MANIFEST="${ES_SNAPSHOT_MANIFEST:-"$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)"}" +if [[ "${BUILDKITE_BRANCH:-}" =~ ^(main|\d+\.\d+)$ ]] || [[ "${FORCE_PROMOTE:-}" =~ ^(1|true)$ ]]; then + echo "Promoting snapshots on branch: ${BUILDKITE_BRANCH}" +else + echo "ES Promotion is not allowed on feature branch ${BUILDKITE_BRANCH}" + exit 0 +fi + cat << EOF | buildkite-agent pipeline upload steps: - trigger: 'kibana-elasticsearch-snapshot-promote' diff --git a/src/dev/run_precommit_hook.js b/src/dev/run_precommit_hook.js index 0086fd9a7a546..9d2193c83510c 100644 --- a/src/dev/run_precommit_hook.js +++ b/src/dev/run_precommit_hook.js @@ -15,7 +15,7 @@ import { REPO_ROOT } from '@kbn/repo-info'; import * as Eslint from './eslint'; import * as Stylelint from './stylelint'; import { getFilesForCommit, checkFileCasing } from './precommit_hook'; -import { load as yamlLoad } from 'js-yaml'; +import { loadAll as yamlLoadAll } from 'js-yaml'; import { readFile } from 'fs/promises'; import { extname } from 'path'; @@ -119,7 +119,7 @@ class YamlLintCheck extends PrecommitCheck { for (const file of yamlFiles) { try { const content = await readFile(file.getAbsolutePath(), 'utf8'); - yamlLoad(content, { + yamlLoadAll(content, { filename: file.getRelativePath(), }); } catch (error) {