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

Agent: populate action_input_type for the .fleet-actions-results #30562

Merged
merged 3 commits into from
Feb 28, 2022

Conversation

aleksmaus
Copy link
Member

@aleksmaus aleksmaus commented Feb 23, 2022

What does this PR do?

Populates input_type for the .fleet-actions-results. This allows to use kibana transformations on .fleet-actions-results for specific integration without a need to correlate them to the original .fleet-actions (via the action_id)

Why is it important?

Allows to use kibana transformations on .fleet-actions-results for specific integration without a need to correlate them to the original .fleet-actions (via the action_id)

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

How to test this PR locally

One of the ways to test is with osquery integration, with corresponding change in fleet-server and elasticsearch fleet mapping. The .fleet-actions-results document should have the new field input_type.

Screenshots

Screen Shot 2022-02-24 at 1 52 00 PM

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 23, 2022

This pull request does not have a backport label. Could you fix it @aleksmaus? 🙏
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 added the backport-skip Skip notification from the automated backport with mergify label Feb 23, 2022
@aleksmaus aleksmaus added backport-v8.2.0 Automated backport with mergify Team:Asset Mgt labels Feb 23, 2022
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Feb 23, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 23, 2022
@aleksmaus aleksmaus added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Feb 23, 2022
@elasticmachine
Copy link
Collaborator

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

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 23, 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

Expand to view the summary

Build stats

  • Start Time: 2022-02-24T18:56:36.064+0000

  • Duration: 101 min 14 sec

Test stats 🧪

Test Results
Failed 0
Passed 5442
Skipped 12
Total 5454

💚 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!)

@@ -114,6 +114,7 @@ func constructEvent(action fleetapi.Action, agentID string) fleetapi.AckEvent {
}

if a, ok := action.(*fleetapi.ActionApp); ok {
ackev.InputType = a.InputType
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any unit tests for this path? Would be great to add a test for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Rewrote acker unit tests, to simplify them, add coverage and eliminate the go routines leak.
This function is fully covered now:
Screen Shot 2022-02-24 at 11 53 39 AM

… simplify them and eliminate the go routines leak
@aleksmaus aleksmaus changed the title Agent: populate input_type for the .fleet-actions-results Agent: populate action_input_type for the .fleet-actions-results Feb 24, 2022
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.

Nice! Really like the improved testing. Thank you!

Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

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

Let's add a changelog entry in changelog.next.asciidoc

Thanks for improving the code! 🤗

@aleksmaus aleksmaus merged commit e9e86a8 into elastic:main Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.2.0 Automated backport with mergify Team:Asset Mgt Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants