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

Refactor action policy change handler #4563

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

pchila
Copy link
Member

@pchila pchila commented Apr 11, 2024

What does this PR do?

Refactor action policy handler splitting validation, persistence and runtime update of the new configuration

Why is it important?

This is a prerequisite for implementing #2851

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?
  • ...

Sorry, something went wrong.

@pchila pchila added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent Label for the Agent team refactoring skip-changelog labels Apr 11, 2024
@pchila pchila self-assigned this Apr 11, 2024
Copy link
Contributor

mergify bot commented Apr 11, 2024

This pull request does not have a backport label. Could you fix it @pchila? 🙏
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 8./d branch. /d is the digit

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

@pchila pchila force-pushed the refactor-action-policy-change-handler branch from ec6a05b to 23507f5 Compare April 11, 2024 11:25
@pchila pchila marked this pull request as ready for review April 11, 2024 11:27
@pchila pchila requested a review from a team as a code owner April 11, 2024 11:27
@pchila pchila requested review from AndersonQ and blakerouse April 11, 2024 11:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pchila pchila force-pushed the refactor-action-policy-change-handler branch from 0fff76a to 237bc4a Compare April 12, 2024 14:27
@pchila
Copy link
Member Author

pchila commented Apr 12, 2024

Fixed bug that caused Fleet APIKey to be removed from fleet.enc store https://buildkite.com/elastic/elastic-agent/builds/8306#018ed0f1-7e0d-4bbc-b906-28be625f219e

Fix in 237bc4a

@cmacknz
Copy link
Member

cmacknz commented Apr 12, 2024

Fixed bug that caused Fleet APIKey to be removed from fleet.enc store https://buildkite.com/elastic/elastic-agent/builds/8306#018ed0f1-7e0d-4bbc-b906-28be625f219e

Is there a unit test that could have caught this?

Copy link

Quality Gate passed Quality Gate passed

The SonarQube Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
82.1% 82.1% Coverage on New Code
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

@pchila
Copy link
Member Author

pchila commented Apr 13, 2024

Fixed bug that caused Fleet APIKey to be removed from fleet.enc store https://buildkite.com/elastic/elastic-agent/builds/8306#018ed0f1-7e0d-4bbc-b906-28be625f219e

Is there a unit test that could have caught this?

Not one that we have right now because the changes in memory actually worked correctly. The only way to detect this would be to write the config in the store and then either assert the contents of the store (probably the preferred option) or make the agent reload the config from file and attempt to contact fleet server

@pchila pchila merged commit d600673 into elastic:main Apr 15, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants