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

Update imports to elastic-agent-libs/file where needed #31419

Merged
merged 18 commits into from
Apr 29, 2022

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Apr 26, 2022

What does this PR do?

This PR removes some parts of libbeat/common/file package that was moved to elastic-agent-libs.

Why is it important?

We avoid maintaining the same code twice in different repositories.

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.

@kvch kvch requested a review from a team as a code owner April 26, 2022 14:39
@kvch kvch requested review from belimawr and faec and removed request for a team April 26, 2022 14:39
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 26, 2022
@mergify mergify bot assigned kvch Apr 26, 2022
@kvch kvch added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Apr 26, 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 Apr 26, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 26, 2022

💔 Build Failed

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-04-29T11:01:15.610+0000

  • Duration: 81 min 15 sec

Test stats 🧪

Test Results
Failed 0
Passed 22251
Skipped 1934
Total 24185

Steps errors 5

Expand to view the steps failures

filebeat-goIntegTest - mage goIntegTest
  • Took 5 min 15 sec . View more details here
  • Description: mage goIntegTest
filebeat-goIntegTest - mage goIntegTest
  • Took 2 min 28 sec . View more details here
  • Description: mage goIntegTest
filebeat-packaging-linux - mage package
  • Took 6 min 29 sec . View more details here
  • Description: mage package
filebeat-packaging-arm-arm - mage package
  • Took 2 min 26 sec . View more details here
  • Description: mage package
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

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

@mergify
Copy link
Contributor

mergify bot commented Apr 27, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b use-file-from-libs upstream/use-file-from-libs
git merge upstream/main
git push upstream use-file-from-libs

@jlind23 jlind23 changed the title Update imports to elasit-agent-libs/file where needed Update imports to elastic-agent-libs/file where needed Apr 28, 2022
@mergify
Copy link
Contributor

mergify bot commented Apr 29, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b use-file-from-libs upstream/use-file-from-libs
git merge upstream/main
git push upstream use-file-from-libs

base64Encoder.Close()
f.Sync()
_ = f.Sync()
Copy link
Member

Choose a reason for hiding this comment

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

Can we at least return these errors, I know it was not there before but should we suppress them in this function? This does not feel write, I think it was a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

f.Sync errors are not returned on purpose. Those might fail sometimes, but it is not an error from Beats point of view. Also, if the write calls return an error it is not an issue, because Beat saves the files constantly, so we are not losing data/information.

Unfortunately, when we touch the disk things can go wrong more times than we think. So we have resilience at strategically important file writes (see. SafeFileRotate). But not all Write call has to be checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, if we happened to expose a non-error "error" I do not want to track down what changed... I would rather focus on the actual goal of my project: moving stuff out of libbeat. The scope of this PR is already too big thanks to the linter.

Copy link
Member

Choose a reason for hiding this comment

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

@kvch could you please turn your reply into a comment before those suppressed errors? otherwise it looks strange that everyone is fine with it.

@kvch kvch merged commit 97c9200 into elastic:main Apr 29, 2022
kush-elastic pushed a commit to kush-elastic/beats that referenced this pull request May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants