Automatically update Dynatrace App dependencies
- How-to
- 1 minute
We strongly recommend you to keep your application dependencies up to date, as it helps mitigate security risks, resolve known bugs, and leverage the latest features available in your ecosystem.
We recommend using Renovate to automate dependency updates for your Dynatrace Apps. Below, we outline our recommended configuration to make sure your apps stay updated with our SDKs, CLI, and libraries.
Presets
As a starting point, we have the presets config:best-practices
and config:js-app
for a general, ecosystem-agnostic set of dependency management rules, and npm:unpublishSafe
to make sure the packages we update have been published for at least three days, for the sake of security and stability.
{
"extends": ["config:best-practices", "config:js-app", "npm:unpublishSafe"]
}
PackageRules
We have divided our custom packageRules
into four.
First, all the patches on strato dependencies will be grouped together and have a higher priority.
{
"groupName": "Strato - Patches",
"description": "Update Strato patches with priority, without migrations",
"enabled": true,
"matchPackageNames": ["@dynatrace/strato-**"],
"matchUpdateTypes": ["patch"],
"prPriority": 1
}
- Second, all minor and major versions of Strato dependencies are grouped together, updated once a week, and have the proper migrations applied automatically, if available.
{
"groupName": "Strato",
"description": "Weekly Strato update with migrations",
"matchPackageNames": ["@dynatrace/strato-**"],
"matchUpdateTypes": ["major", "minor"],
"postUpgradeTasks": {
"commands": [
"npm ci --ignore-scripts",
"npx dt-app migration execute --package \"{{{depName}}}\" --from \"{{{currentVersion}}}\" --to \"{{{newVersion}}}\"",
"npx eslint . --fix"
],
"executionMode": "update"
},
"schedule": ["on monday"]
}
- Third, all major and minor versions of
dt-app
are updated and migrated automatically.
{
"matchPackageNames": ["dt-app"],
"description": "dt-app updates with migrations",
"matchUpdateTypes": ["major", "minor"],
"postUpgradeTasks": {
"commands": [
"npm ci --ignore-scripts",
"npx dt-app migration execute --package \"{{{depName}}}\" --from \"{{{currentVersion}}}\" --to \"{{{newVersion}}}\"",
"npx eslint . --fix"
],
"executionMode": "update"
}
}
- Finally, the rest of Dynatrace libraries and SDKs are updated independently regardless of the update type, to have smaller PRs which are less likely to have a failed build. Additionally, you can ignore an update by declining the PR, since it won't be triggered again, which isn't the case for groups.
{
"description": "All Dynatrace packages have increased update frequency",
"matchPackageNames": ["@dynatrace/**", "@dynatrace-sdk/**"],
"minimumReleaseAge": "0 days",
"internalChecksFilter": "strict"
}
Complete configuration example
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:best-practices", "config:js-app", "npm:unpublishSafe"],
"timezone": "Europe/Vienna",
"npmrcMerge": true,
"enabledManagers": ["npm"],
"baseBranches": ["main"],
"packageRules": [
{
"description": "All Dynatrace packages have increased update frequency",
"matchPackageNames": ["@dynatrace/**", "@dynatrace-sdk/**"],
"minimumReleaseAge": "0 days",
"internalChecksFilter": "strict"
},
{
"matchPackageNames": ["dt-app"],
"description": "dt-app updates with migrations",
"matchUpdateTypes": ["major", "minor"],
"postUpgradeTasks": {
"commands": [
"npm ci --ignore-scripts",
"npx dt-app migration execute --package \"{{{depName}}}\" --from \"{{{currentVersion}}}\" --to \"{{{newVersion}}}\"",
"npx eslint . --fix"
],
"executionMode": "update"
}
},
{
"groupName": "Strato",
"description": "Weekly Strato update with migrations",
"matchPackageNames": ["@dynatrace/strato-**"],
"matchUpdateTypes": ["major", "minor"],
"postUpgradeTasks": {
"commands": [
"npm ci --ignore-scripts",
"npx dt-app migration execute --package \"{{{depName}}}\" --from \"{{{currentVersion}}}\" --to \"{{{newVersion}}}\"",
"npx eslint . --fix"
],
"executionMode": "update"
},
"schedule": ["on monday"]
},
{
"groupName": "Strato - Patches",
"description": "Update Strato patches with priority, without migrations",
"enabled": true,
"matchPackageNames": ["@dynatrace/strato-**"],
"matchUpdateTypes": ["patch"],
"prPriority": 1
}
]
}
For more information, refer to the official Noise Reduction guide on how to get a smooth Renovate bot experience, and to Dependency pinning for more stable updates.