Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,13 @@ const SKIPPABLE_PR_MATCHERS = prConfig.skip_ci_on_only_changed!.map((r) => new R

// Run Saved Objects checks conditionally
if (
await doAnyChangesMatch([
!GITHUB_PR_LABELS.includes('ci:skip-so-check') &&
(await doAnyChangesMatch([
/^packages\/kbn-check-saved-objects-cli\/current_fields.json/,
/^packages\/kbn-check-saved-objects-cli\/current_mappings.json/,
/^src\/core\/server\/integration_tests\/ci_checks\/saved_objects\/check_registered_types.test.ts/,
/^\.buildkite\/pipelines\/pull_request\/check_saved_objects\.yml/,
])
]))
) {
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml', cancelable)
Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-check-saved-objects-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ On a PR, the step:
1. **Resolves a baseline commit**: It uses the PR merge-base commit (`GITHUB_PR_MERGE_BASE`). Because a snapshot may not exist for that exact SHA, the script walks the commit’s parent chain (up to a limit) until it finds a commit for which a snapshot exists in the cloud bucket (`findExistingSnapshotSha`).
2. **Runs the check**: It calls `node scripts/check_saved_objects --baseline <resolved-sha> --algorithm both` (and `--fix` when auto-commit is enabled). The script fetches the baseline snapshot from the bucket, starts Kibana to build the current type registry, and runs validations comparing current state to that baseline.

### Skipping the check

Add the `ci:skip-so-check` label to a PR to bypass the "Check changes in Saved Objects" step entirely. Use this as an escape hatch for unrelated false positives (for example, `Joi` version bumps or no-op schema refactors that change snapshot hashes without changing the persisted shape). Do not use it to bypass real Saved Object type changes.
Comment thread
hammad-nasir-elastic marked this conversation as resolved.

### Where snapshots come from

Baseline snapshots are **stored in a GCP bucket** and served at:
Expand Down
Loading