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

Add agent hash to check for detecting upgrade rollbacks #3842

Merged
merged 2 commits into from
Nov 30, 2023

Conversation

pchila
Copy link
Member

@pchila pchila commented Nov 29, 2023

What does this PR do?

Change rollback detection based on version check to include commit hash.

For improving related integration tests changes from #3827 and #3837 are needed

Why is it important?

This allows correct version detection in case of upgrade between different builds of the same SNAPSHOT version

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/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@pchila pchila added bug Something isn't working Team:Elastic-Agent Label for the Agent team backport-skip skip-changelog labels Nov 29, 2023
@pchila pchila self-assigned this Nov 29, 2023
@pchila pchila requested a review from a team as a code owner November 29, 2023 18:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Change looks good.

Comment on lines 87 to 88
watcherAgentVersion string
watcherAgentHash string
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not actually the watcher agent version and hash (as we discussed off-PR yesterday). Could you change these to agentVersion/agentHash or currentAgentVersion/currentAgentHash or something along those lines please?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 78cf065

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

LGTM — thanks for fixing this!

Copy link

@pchila pchila merged commit 4a8661d into elastic:main Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip bug Something isn't working skip-changelog Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watcher does not consider build hash when determining if upgrade was rolled back
4 participants