Skip to content

internal/testrunner/script: add breaking change conditionals#3263

Merged
efd6 merged 6 commits intoelastic:mainfrom
efd6:skip_breaking
Feb 13, 2026
Merged

internal/testrunner/script: add breaking change conditionals#3263
efd6 merged 6 commits intoelastic:mainfrom
efd6:skip_breaking

Conversation

@efd6
Copy link
Contributor

@efd6 efd6 commented Feb 10, 2026

These two commits add conditionals that can be used to allow skipping tests or running commands based on whether the change is a breaking change or is a back port. This improves the robustness of testing for situations like upgrade testing.

There is testing for the breaking change conditional, but not for the "is latest version" conditional since it depends on EPR and the name of the package being in the EPR, the first of which is not a stable workbench to test on and the latter of which is not possible because the tests here don't end up in the EPR.

Please take a look.

This allows skipping test or running conditional commands based on
whether the tested version is a breaking change.

Breaking change status is determined by whether the type of the change
in the changelog.yml is "breaking-change" or the major version of the
current version is different to the major version of the previous
version in the changelog.yml.
@efd6 efd6 requested a review from a team February 10, 2026 01:49
@efd6 efd6 self-assigned this Feb 10, 2026
@efd6 efd6 added the enhancement New feature or request label Feb 10, 2026
…T_EPR_VERSION env var

This allows skipping tests for back-ports.
This is another condition to allow upgrade testing.
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @efd6

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Looks good thanks, added a couple of small suggestions.

if err != nil {
return err
}
eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL())
Copy link
Member

Choose a reason for hiding this comment

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

Nit. A new client is created for each directory in dirs, though it could be reused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +206 to +220
eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL())
revisions, err := eprClient.Revisions(manifest.Name, registry.SearchOptions{})
if err != nil {
return err
}
if len(revisions) > 0 {
latestEPRVersion = revisions[len(revisions)-1].Version
latestSemver, err := semver.NewVersion(latestEPRVersion)
if err != nil {
return fmt.Errorf("failed to parse latest epr version: %w", err)
}
if latestSemver.GreaterThanEqual(currSemver) {
isLatestVersion = false
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit. Consider moving this logic to its own function.

Suggested change
eprClient := registry.NewClient(appConfig.PackageRegistryBaseURL())
revisions, err := eprClient.Revisions(manifest.Name, registry.SearchOptions{})
if err != nil {
return err
}
if len(revisions) > 0 {
latestEPRVersion = revisions[len(revisions)-1].Version
latestSemver, err := semver.NewVersion(latestEPRVersion)
if err != nil {
return fmt.Errorf("failed to parse latest epr version: %w", err)
}
if latestSemver.GreaterThanEqual(currSemver) {
isLatestVersion = false
}
}
latestEPRVersion, isLatestVersion, err := getLatestEPRVersion(eprClient, manifest.Name)
if err != nil {
return err
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've hoisted the manifest reading and revision checks out as for the client, but I'm not sure the indirection is something that improves clarity.

@efd6 efd6 requested a review from jsoriano February 12, 2026 20:17
@efd6 efd6 merged commit 1560deb into elastic:main Feb 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants