Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore bugfix version when running version compatibility check against Elasticsearch #30746

Merged
merged 3 commits into from
Mar 9, 2022

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Mar 9, 2022

What does this PR do?

In #29683 we introduced a check to make sure we are not sending events to Elasticsearch instances that might be incompatible with Beats. However, the current check is too strict. Patch versions should not be considered during version checks. Beats 8.1.1 should be able to connect to Elasticsearch 8.1.0.

Why is it important?

The check is too strict. This is not what we agreed on in the original issue. Furthermore, it interferes with our own release process.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

#30157

@kvch kvch requested a review from a team as a code owner March 9, 2022 10:41
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 9, 2022
@mergify
Copy link
Contributor

mergify bot commented Mar 9, 2022

This pull request does not have a backport label. Could you fix it @kvch? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot assigned kvch Mar 9, 2022
@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Mar 9, 2022
@kvch kvch added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team and removed backport-skip Skip notification from the automated backport with mergify labels Mar 9, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 9, 2022
@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Mar 9, 2022
@kvch kvch added backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Mar 9, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 9, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview [preview](https://ci-stats.elastic.co/app/apm/services/beats-ci/transactions/view?rangeFrom=2022-03-09T12:23:30.018Z&rangeTo=2022-03-09T12:43:30.018Z&transactionName=BUILD Beats/beats/PR-{number}&transactionType=job&latencyAggregationType=avg&traceId=6ed280a7abbc7312aab3581d0d7af1bc&transactionId=fa9c7dd8c61be7b5)

Expand to view the summary

Build stats

  • Start Time: 2022-03-09T12:33:30.018+0000

  • Duration: 100 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 43016
Skipped 3846
Total 46862

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

libbeat/common/version.go Outdated Show resolved Hide resolved
@@ -883,7 +883,7 @@ func (b *Beat) checkElasticsearchVersion() {
if err != nil {
return err
}
if esVersion.LessThan(beatVersion) {
if esVersion.LessThanMajorMinor(beatVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't our comparison be LessThanOrEqual?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we return an error if the version of ES is less than the version of Beats. If this was LessThanOrEqual, we would return an error when ES and Beats is on the same version.

Copy link
Contributor

Choose a reason for hiding this comment

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

I compared the wrong way around 🤦‍♂️

Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -883,7 +883,7 @@ func (b *Beat) checkElasticsearchVersion() {
if err != nil {
return err
}
if esVersion.LessThan(beatVersion) {
if esVersion.LessThanMajorMinor(beatVersion) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I compared the wrong way around 🤦‍♂️

@kvch kvch merged commit 46be42e into elastic:main Mar 9, 2022
mergify bot pushed a commit that referenced this pull request Mar 9, 2022
…t Elasticsearch (#30746)

(cherry picked from commit 46be42e)

# Conflicts:
#	libbeat/cmd/instance/beat.go
mergify bot pushed a commit that referenced this pull request Mar 9, 2022
kvch added a commit that referenced this pull request Mar 10, 2022
…t Elasticsearch (#30746) (#30750)

(cherry picked from commit 46be42e)

Co-authored-by: Noémi Ványi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants