Skip to content

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Sep 12, 2025

This commit adds a few more validations:

  • we cannot jump the primary id more than the normal increment
  • we cannot remove an existing id

Also fixed definition path output in some validation error messages.

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
@rjernst rjernst added >non-issue :Core/Infra/Core Core issues without another label auto-backport Automatically create backport pull requests when merged labels Sep 12, 2025
@rjernst rjernst requested a review from a team as a code owner September 12, 2025 00:08
@rjernst rjernst requested review from jdconrad and mark-vieira and removed request for a team September 12, 2025 00:08
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team v9.2.0 labels Sep 12, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

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

LGTM

when:
def result = validateResourcesFails()
then:
assertValidateResourcesFailure(result, "Transport version definition file " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I get the same error if entire file is removed? Say, I commit a TV change and then revert the entire thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. In that case you would get an error about a referenced transport version that doesn't have a definition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean if you reverted the entire change. So you removed any references as well. Would we catch such a revert?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do not, at least not directly, but sort of by design. We have to be able to remove transport versions eventually. The trick is we have to remove them from the tail end. However, if someone were to just remove a transport version in the middle of the known transport versions, we should eventually catch this with our primary id density check. But we can't do that until we've migrated more transport versions to remove the gap we currently have.

@rjernst rjernst enabled auto-merge (squash) September 16, 2025 22:46
@rjernst rjernst merged commit 0d0c0ad into elastic:main Sep 17, 2025
35 checks passed
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 17, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 17, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 17, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Sep 17, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
9.1
8.18
9.0

elasticsearchmachine pushed a commit that referenced this pull request Sep 18, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
gmjehovich pushed a commit to gmjehovich/elasticsearch that referenced this pull request Sep 18, 2025
This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.
@rjernst rjernst deleted the transport/more_validation branch September 18, 2025 20:45
elasticsearchmachine pushed a commit that referenced this pull request Sep 19, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.

* fix compile
elasticsearchmachine pushed a commit that referenced this pull request Sep 19, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.

* fix compile
elasticsearchmachine pushed a commit that referenced this pull request Sep 23, 2025
* Add more transport version validation cases (#134597)

This commit adds a few more validations:
* we cannot jump the primary id more than the normal increment
* we cannot remove an existing id

Also fixed definition path output in some validation error messages.

* Only validate primary ids on release branches (#135044)

Primary ids are only incremented on the main branch. For release branches
only patch ids will be created. The primary id validation won't always
work on release branches because only some of the primary ids will be
backported.

This commit skips primary id validation if we are sure we are on a
release branch. We can tell this by looking at the current upper bound
compared to other upper bounds. If there is a newer one, we know we are
on a release branch. If there isn't a newer one, we _might_ be on a
release branch, or on main, but in this case doing primary id validation
is ok because there's effectively no difference, we are looking at the
latest upper bound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants