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

Use version of the assembly with the same name as the package ID (for telemetry data) #16544

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

ronaldbarendse
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

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 a versionAssemblyName 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 package id 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):

{
  "name": "Test",
  "id": "Umbraco.Web.UI",
  "version": "",
  "extensions": []
}

Although this won't list the version in the back-office:

Installed packages

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".

@ronaldbarendse
Copy link
Contributor Author

Some additional notes to consider:

  • Should we re-introduce the versionAssemblyName property to the umbraco-package.json manifest again? This is mainly to restore feature-parity with v13 and accommodate package developers that don't manually set the version and don't have aligned package ID/assembly names (both can be fixed/worked around by the package developer though).
  • Do we want to show the automatically determined version in the back-office as well or keep it as-is (so it's a 1:1 representation of what's actually in the package manifests)?
  • The package ID is already returned by the Management API (by the manifest endpoints), so can we display this in the overview?

With the last 2 things implemented, the overview could look like this (very similar to v13, see screenshots of linked PRs):

Package overview

@bergmania bergmania merged commit 14a0e62 into v14/dev Sep 26, 2024
5 of 8 checks passed
@bergmania bergmania deleted the v14/feature/package-version-assembly branch September 26, 2024 05:51
bergmania pushed a commit that referenced this pull request Sep 26, 2024
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.

2 participants