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

Enhancement: Do not write index template if nothing changed. #36665

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nutmos
Copy link

@nutmos nutmos commented Sep 23, 2023

Proposed commit message

  • Reduce Elasticsearch PUT command by GET template and compare with the template that beat intended to overwrite. Only apply when the template content is changed.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@nutmos nutmos requested a review from a team as a code owner September 23, 2023 14:53
@nutmos nutmos requested review from rdner and faec September 23, 2023 14:53
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 23, 2023
@cla-checker-service
Copy link

cla-checker-service bot commented Sep 23, 2023

💚 CLA has been signed

@mergify mergify bot assigned nutmos Sep 23, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 23, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @nutmos? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 23, 2023

❕ Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-30T14:39:21.111+0000

  • Duration: 5 min 51 sec

Steps errors 2

Expand to view the steps failures

Load a resource file from a library
  • Took 0 min 0 sec . View more details here
  • Description: approval-list/elastic/beats.yml
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/nutmos return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/nutmos : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/nutmos : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user"}

🤖 GitHub comments

Expand to view the 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!)

@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Sep 23, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 23, 2023
@rdner
Copy link
Member

rdner commented Sep 25, 2023

@nutmos thank you for your contribution!

Please fix the linter issues.

@fearful-symmetry would this conflict with any changes you're currently working on?

libbeat/template/load.go Outdated Show resolved Hide resolved
libbeat/template/load.go Outdated Show resolved Hide resolved
libbeat/template/load.go Outdated Show resolved Hide resolved
libbeat/template/load.go Outdated Show resolved Hide resolved
libbeat/template/load.go Outdated Show resolved Hide resolved
libbeat/template/load.go Outdated Show resolved Hide resolved
@rdner
Copy link
Member

rdner commented Sep 25, 2023

@nutmos What steps did you take for testing?

libbeat/template/load.go Outdated Show resolved Hide resolved
@fearful-symmetry
Copy link
Contributor

So, this probably won't cause a merge conflict with #36649. Probably...

@nutmos
Copy link
Author

nutmos commented Sep 29, 2023

@rdner Resolved. I'll provide the testing later this week.

@pierrehilbert
Copy link
Collaborator

Hey @nutmos, did you find time for the testing part?

@pierrehilbert
Copy link
Collaborator

Sorry for this new ping @nutmos, but did you find time for the testing part?

@nutmos
Copy link
Author

nutmos commented Nov 11, 2023

Sorry for this new ping @nutmos, but did you find time for the testing part?

Sorry I have no time for the testing part yet.

@nutmos
Copy link
Author

nutmos commented Nov 11, 2023

I just have a time to test this PR. The method reflect.DeepEqual doesn't work well. I need to find another method to check this case.

@pierrehilbert
Copy link
Collaborator

Hey @nutmos
I'm putting this one back to draft for now.

@pierrehilbert pierrehilbert marked this pull request as draft November 22, 2023 12:58
Copy link
Contributor

mergify bot commented Feb 5, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @nutmos? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not overwrite index template if it has not changed
5 participants