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

Fix download verification in snapshot builds #255

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Mar 25, 2022

What does this PR do?

Modify verifier to only delete the binary and .sha512 files when there is a
checksum mismatch. And only delete the .asc file when the signature does not
validate.

Fixes #252

Why is it important?

Downloaded artifacts fail signature validation in SNAPSHOT builds. You cannot test Packetbeat or Auditbeat with 8.2.0-SNAPSHOT builds.

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.

Related issues

Modify verifier to only delete the binary and .sha512 files when there is a
checksum mismatch. And only delete the .asc file when the signature does not
validate.

Fixes elastic#252
@andrewkroh andrewkroh changed the title Fix snapshot download verification Fix download verification in snapshot builds Mar 25, 2022
@mergify
Copy link
Contributor

mergify bot commented Mar 25, 2022

This pull request does not have a backport label. Could you fix it @andrewkroh? 🙏
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.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 25, 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-03-28T13:34:36.479+0000

  • Duration: 19 min 2 sec

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@ph ph requested review from blakerouse and ph March 28, 2022 12:20
@ph ph added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Mar 28, 2022
@mergify mergify bot removed the backport-skip label Mar 28, 2022
@andrewkroh
Copy link
Member Author

andrewkroh commented Mar 28, 2022

There is something weird with the linter failure on darwin CI.

Error: directive //nolint:staticcheck // crypto/openpgp is only receiving security updates. is unused for linter "staticcheck" (nolintlint)

If I remove the //nolint then the linter fails (on Linux) due to the same issue that nolint comment addresses. 🤷

@andrewkroh andrewkroh marked this pull request as ready for review March 28, 2022 14:11
@ph ph requested a review from a team March 29, 2022 20:18
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.

@andrewkroh look good to me, I will merge it.. Not sure about why the linter is so weird.

I'll make a note we need an integration test for this scenario. To be honest I hope with the changes of shippers and the beats we can remove the download on demande when features are need.

cc @nimarezainia, we will also need to add this feature to the artifact api so we can control the bandwith/speed over a network, if not we will have the same issues as an upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.2.0 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.

verifier fails in snapshot builds for downloaded artifacts
3 participants