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

Adds installation information when using deb and rpm packages #5481

Merged
merged 17 commits into from
May 15, 2020

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented May 8, 2020

What does this PR do?

  • Creates install_info file (if not already present) when installing the agent using.deb and .rpm packages, adding information about the installer version.
  • Ensures the file is deleted after uninstall but it is kept untouched after upgrades.

Motivation

  • Allow users to track their installation methods
  • Allows Datadog to make stats on installation methods

Additional information

The install_info format should be:

---
install_method:
  tool: [dpkg/rpm]
  tool_version: [dpkg/rpm]-<dpkg/rpm version number>
  installer_version: [deb/rpm/rpm_suse]_package(-iot)

In case dpkg or rpm are not available tool and tool_version would be replaced by unknown.

The rpm install_info is created in posttrans to avoid creating the file until the last moment, since rpm does not seem to recover from failed installs and we wouldn't want to leave the file laying around in that case.

Describe your test plan

On each platform:

  • install the package,
  • check that the file was created correctly,
  • remove the package,
  • check that the file was removed,
  • create a dummy install_info file,
  • install the package again and
  • check that the file was not modified this time.

Tested platforms:

  • Debian-based
  • Debian-based (IoT)
  • RPM-based non-SUSE
  • RPM-based SUSE
  • RPM-based (IoT)

@mx-psi mx-psi added this to the 7.20.0 milestone May 8, 2020
@mx-psi mx-psi marked this pull request as ready for review May 11, 2020 10:49
@mx-psi mx-psi requested a review from a team as a code owner May 11, 2020 10:49
albertvaka
albertvaka previously approved these changes May 14, 2020
Copy link
Contributor

@albertvaka albertvaka left a comment

Choose a reason for hiding this comment

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

🚀

@albertvaka albertvaka dismissed their stale review May 14, 2020 16:48

wait! XD

Copy link
Contributor

@julien-lebot julien-lebot left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@mx-psi mx-psi merged commit 13ae4f8 into master May 15, 2020
@mx-psi mx-psi deleted the mx-psi/deb-rpm-install-info branch May 15, 2020 13:55
mx-psi added a commit that referenced this pull request Jun 4, 2020
@mx-psi mx-psi mentioned this pull request Jun 4, 2020
mx-psi added a commit that referenced this pull request Jun 5, 2020
* Revert "Overrides install info unconditionally (#5623)"

This reverts commit 068b60a.

* Revert "Adds installation information when using deb and rpm packages (#5481)"

This reverts commit 13ae4f8.

* Corrects step number
albertvaka added a commit that referenced this pull request Apr 14, 2022
albertvaka added a commit that referenced this pull request Apr 14, 2022
albertvaka added a commit that referenced this pull request Apr 20, 2022
Reverts the revert of #5481 + adds install_info also from the DMG intaller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants