Skip to content

SO CI Update: Run rollback tests in test mode when no SO types are updated#251139

Merged
hammad-nasir-elastic merged 17 commits intoelastic:mainfrom
hammad-nasir-elastic:so-cli-update-run-test-data
Feb 9, 2026
Merged

SO CI Update: Run rollback tests in test mode when no SO types are updated#251139
hammad-nasir-elastic merged 17 commits intoelastic:mainfrom
hammad-nasir-elastic:so-cli-update-run-test-data

Conversation

@hammad-nasir-elastic
Copy link
Copy Markdown
Contributor

@hammad-nasir-elastic hammad-nasir-elastic commented Jan 30, 2026

Resolves issue

Summary

This PR modifies the check_saved_objects CLI to always run automated rollback tests as a smoke test, even when no Saved Object type definitions have changed. Previously, the rollback tests were skipped entirely if the CI detected no updates to saved objects, which meant regressions in migration logic could go undetected on PRs that don't modify SO types.

Changes/New behavior

When no real SO types have been updated, the CLI now falls back to "test mode" and runs the rollback tests using the built in test types TEST_TYPES
This provides continuous verification of migration logic on every PR.

How it works

  1. The CLI runs as normal, detecting updated SO types
  2. If no SO types were updated AND no errors occurred, the new fallbackToTestMode task runs
  3. This task populates ctx.updatedTypes with TEST_TYPES and sets ctx.fallbackToTestMode = true
  4. The automatedRollbackTests task then runs using test fixtures and baseline mappings
  5. This ensures upgrade/rollback/reupgrade cycles are always validated

- Added a new task to fallback to test mode when no real saved object types have been updated, ensuring migration logic is tested on every PR.
- Updated TaskContext to include a flag for fallback mode.
- Adjusted automated rollback tests to utilize test baseline mappings in both test and fallback modes.
@hammad-nasir-elastic hammad-nasir-elastic self-assigned this Jan 30, 2026
@hammad-nasir-elastic hammad-nasir-elastic requested a review from a team as a code owner January 30, 2026 21:06
@hammad-nasir-elastic hammad-nasir-elastic added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Jan 30, 2026
@hammad-nasir-elastic hammad-nasir-elastic marked this pull request as draft February 2, 2026 16:43
@hammad-nasir-elastic hammad-nasir-elastic marked this pull request as ready for review February 2, 2026 17:43
@hammad-nasir-elastic hammad-nasir-elastic requested a review from a team as a code owner February 2, 2026 17:43
Copy link
Copy Markdown
Contributor

@jbudz jbudz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.buildkite/scripts/pipelines/pull_request/pipeline.ts lgtm

Comment thread .buildkite/scripts/pipelines/pull_request/pipeline.ts Outdated
Comment thread packages/kbn-check-saved-objects-cli/src/commands/tasks/validate_so_changes.ts Outdated
Copy link
Copy Markdown
Member

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @hammad-nasir-elastic

@hammad-nasir-elastic hammad-nasir-elastic merged commit 154f472 into elastic:main Feb 9, 2026
16 checks passed
@clintandrewhall
Copy link
Copy Markdown
Contributor

@gsoldevila @hammad-nasir-elastic The failed CI step above is now showing on any open PR that doesn't alter a saved object. Interestingly, the CI build is still considered "passing", even though the build is "broken".

Used AI and fixed the JSON file, created a utility to update it in the future.

#252435

tylersmalley added a commit that referenced this pull request Feb 10, 2026
@tylersmalley
Copy link
Copy Markdown
Member

I have reverted this commit in 505763b as it was blocking PR's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes reverted v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants