Skip to content

Commit 76b50be

Browse files
kibanamachinejbudz
andauthored
[8.19] [ci] Only use cached es snapshot on pull requests (#268315) (#268534)
# Backport This will backport the following commits from `main` to `8.19`: - [[ci] Only use cached es snapshot on pull requests (#268315)](#268315) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jon","email":"jon@elastic.co"},"sourceCommit":{"committedDate":"2026-05-08T18:51:31Z","message":"[ci] Only use cached es snapshot on pull requests (#268315)\n\nES snapshots should trigger a cache update within an hour after an\nupgrade.\n\nDuring the interim period, or if there are cache update failures, we're\nfinding the parallelized number of download requests becoming\nproblematic. If there's a cache update issue, it will be fixed with the\nsame priority as a snapshot build.","sha":"5d3bce05af431ab374d8db7748a4158a98a1f547","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v9.5.0"],"title":"[ci] Only use cached es snapshot on pull requests","number":268315,"url":"https://github.com/elastic/kibana/pull/268315","mergeCommit":{"message":"[ci] Only use cached es snapshot on pull requests (#268315)\n\nES snapshots should trigger a cache update within an hour after an\nupgrade.\n\nDuring the interim period, or if there are cache update failures, we're\nfinding the parallelized number of download requests becoming\nproblematic. If there's a cache update issue, it will be fixed with the\nsame priority as a snapshot build.","sha":"5d3bce05af431ab374d8db7748a4158a98a1f547"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/268315","number":268315,"mergeCommit":{"message":"[ci] Only use cached es snapshot on pull requests (#268315)\n\nES snapshots should trigger a cache update within an hour after an\nupgrade.\n\nDuring the interim period, or if there are cache update failures, we're\nfinding the parallelized number of download requests becoming\nproblematic. If there's a cache update issue, it will be fixed with the\nsame priority as a snapshot build.","sha":"5d3bce05af431ab374d8db7748a4158a98a1f547"}}]}] BACKPORT--> Co-authored-by: Jon <jon@elastic.co>
1 parent dd49c1a commit 76b50be

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.buildkite/pipelines/pull_request/base.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
env:
2+
KBN_ES_SNAPSHOT_USE_CACHED: 'true'
3+
14
steps:
25
- command: .buildkite/scripts/steps/build_kibana.sh
36
label: Build Kibana Distribution

src/platform/packages/shared/kbn-es/src/artifact.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ const createCachedArtifact = ({ contents, etag = 'etag' }) => {
9090
};
9191

9292
const previousEnvVars = {};
93-
const ENV_VARS_TO_RESET = ['ES_SNAPSHOT_MANIFEST', 'KBN_ES_SNAPSHOT_USE_UNVERIFIED'];
93+
const ENV_VARS_TO_RESET = [
94+
'ES_SNAPSHOT_MANIFEST',
95+
'KBN_ES_SNAPSHOT_USE_UNVERIFIED',
96+
'KBN_ES_SNAPSHOT_USE_CACHED',
97+
];
9498

9599
beforeAll(() => {
96100
ENV_VARS_TO_RESET.forEach((key) => {

src/platform/packages/shared/kbn-es/src/artifact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class Artifact {
231231
const cacheMeta = cache.readMeta(dest);
232232
const tmpPath = `${dest}.tmp`;
233233

234-
if (useCached) {
234+
if (useCached || process.env.KBN_ES_SNAPSHOT_USE_CACHED === 'true') {
235235
if (cacheMeta.exists) {
236236
this.log.info(
237237
'use-cached passed, forcing to use existing snapshot',

0 commit comments

Comments
 (0)