Use version of the assembly with the same name as the package ID (for telemetry data) #16544
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
After PR #16430 got merged that now includes
umbraco-package.json
manifests in telemetry data, I noticed that the package version is only automatically determined for package migration plans.The previous
package.manifest
format contained aversionAssemblyName
property that allows package developers to automatically populate the version based on the assembly informational version (see PR #14046). This got updated to consider the packageid
as fallback, as the package ID should align with the NuGet package ID and that (by default) aligns with the assembly name (see PR #14047).This PR automatically populates the package version (if it's empty) based on the assembly with the same name as the package ID. Note that this automatically determined version is only used to report the installed package version to the telemetry endpoint and is not displayed in the Packages > Installed overview in the back-office (yet).
This can be tested by adding the following package manifest to the Umbraco.Web.UI project in
wwwroot\App_Plugins\Test\umbraco-package.json
(note the package ID aligns with this project's assembly name and the missing/empty version):Although this won't list the version in the back-office:
It will be returned in the telemetry service, which can be verified by adding the composer/component from #16430 (comment) and checking whether the log contains:
Package telemetry for "Test" ("Umbraco.Web.UI") "14.0.0-preview.38"
.