Feedback on "Packages in Umbraco 9 via NuGet" #10411
Replies: 11 comments 47 replies
-
While I do have strong opinions on this, I'd like to keep my questions focused. 🙏 My initial question is: Would the proposed "Hot Reload" feature in .NET 6 have any bearing to revert on this decision? |
Beta Was this translation helpful? Give feedback.
-
Will package developers need to manually create (and maintain) the project page on Our? e.g. when we release a package update (on NuGet), do we need to update on Our too? (either manually or via UmbPack) |
Beta Was this translation helpful? Give feedback.
-
Can we retain the ability to install content/datatype (i.e no dll's) only packages using the packaging service? These should still be able to be installed without the need to restart the application. |
Beta Was this translation helpful? Give feedback.
-
Just out of curiosity. |
Beta Was this translation helpful? Give feedback.
-
Should we start thinking about an official Umbraco CLI? Whilst there will be some non-technical people that struggle with the NuGet change, from my impressions most folks who are used to just installing packages in the BO are those more familiar with front end technologies and not so much .NET. I wonder then if an official CLI would make things a bit more palatable and more familiar to those coming from front end frameworks where CLI's are pretty much the norm. Under the hood this may just proxy to other services, but I think it could allow the hiding of multiple tools and any weird configurations of those that might be needed. You can then provide a simplified API that makes sens to even beginners. |
Beta Was this translation helpful? Give feedback.
-
I feel I may be making a mute point, as the NuGet decision has already been made, but if I don't mention this it will niggle at me. What about maintenance/triage packages? Throughout my Umbraco career (14 years so far) there have been times when certain maintenance packages have saved the day. What I mean by a maintenance package is a utility feature to assist with older Umbraco installations. A general example would be that I pick up a legacy/brownfield project where the client has had a falling out with their existing agency, I'm given zero access to the web-server itself, only access to the CMS backoffice. (Honestly this happens way more that you'd expect!) To this, older packages such as Config Tree (not currently available on Our, but there are modern versions of it, Config Editor Manager, Configuration Editor), User Control File Editor, F.A.L.M. Housekeeping, UnVersion, community Health Checks, et al. could help triage issues for supporting clients with their legacy Umbraco sites. In my mind I'm likening this to compilation types, Ahead of Time (AOT) (features we know we need in advance), and Just In Time (JIT) (features we don't know we need until that moment we need them). I appreciate this may not be an issue or concern for new/current Umbraco implementations, but come 5 years down the line when agencies/freelancers will pick up on old v9 projects, they'll be difficult to triage. Like I say, this may be a mute point, but worth flagging up. |
Beta Was this translation helpful? Give feedback.
-
Question. In the blog post it says various routes were investigated but it couldn’t be made to work. I wonder if what was tried could be detailed so that if someone knows some other way they could suggest something without suggesting things already tried. Ie Microsoft document how to create an application with plugins here https://docs.microsoft.com/en-gb/dotnet/core/tutorials/creating-app-with-plugin-support but I’m guessing something like this was dismissed but I’m not sure why? |
Beta Was this translation helpful? Give feedback.
-
Hi all, For many years I've been talking about "Package Migrations" which is a way to unite Nuget with Umbraco data installation. This is what will be happening now. The great thing is that the CMS code has come a long way to be able to accomplish this now much more easily than it was all those years ago when I created an initial PR for that. I've put together a document internally that I'll share here outlining the high level way this will work. Hopefully this will answer some of your questions. Package MigrationsOriginal implementation WIP here https://github.com/umbraco/Umbraco-CMS/pull/1307/files What is it?We need to be able to install Umbraco data on site load after an Umbraco extensions Nuget package is installed. Previously this was only possible while installing a package via the back office because Umbraco was already running. How to do this?We will re-use much of the logic done for Umbraco's Core migration logic. On startup, the CMS will do some assembly scans for a package migration type, it will then check what "ID" (this will be a GUID) is the last "Step" in a packages published "Plan". The CMS will check in the database key/value table for that package's row and if the value in that row doesn't match the "ID", then it means a package migration needs to execute. This will be a first class citizen. The v8 way that devs hacked their own Migrations in place using the Umbraco migrations classes was an ugly experience because the CMS never natively supported it and Developers would have to try to track state of what was previously run, etc... This will no longer be necessary and will be consistent. The "Plan"Just like in the CMS core, Umbraco has an "UmbracoPlan". This is a class that defines all of the steps involved in migrating from one ID to the next until it reaches the final ID. It is essentially a list of "ID"s mapped to Classes (migrations). This means that a migration will never run a second time on the same database. The "ID"The Umbraco CMS "ID" is a GUID based Id but it uses the registry GUID format which we won't use for packages. For package migrations we'll just use a normal GUID. StartupOn startup we will assembly scan for a new type such as IPackageMigration (TBD). This will resolve an implementation that allows checking for the packages "Plan" to then determine if Umbraco has already tracked its latest "ID". Umbraco will collect all migrations that are needed to run for all packages and will execute these silently during startup. Upon the successful execution of each package's migrations, we will track the successful final ID in the database. We will execute each pacakge's steps within it's own transaction so that if one package's migrations fails, it doesn't rollback all others. Runtime levelIf runnable package migrations are detected the application will be put into a new runtime state: PackagesMigration FailureIf any migrations fail, we will stop Umbraco from booting and show a modified version of the installer where we will list the errors and packages and have a button to retry. This will work very similar to the installer and unattended install failures. Old Package ActionsPackage actions will be gone - we will use the normal Umbraco migration system instead and eventually have some additional handy ext methods for common tasks if necessary. Migrations are just c# code, so you can execute anything. Umbraco package data manifestThis is the xml file that is created by the packager today. This file will be exportable from the Umbraco packages section based on data selected. For the most part, the file format will not change. This file can either be an embedded DLL resource, it it can exist in the root of the packages App_Plugins folder. For packages that don't have c#, the only option is to have a file. Some packages are only c#, in which case it must be an embedded resource. This will be the primary method for installing Umbraco data via package migrations. Explicit vs Implicit migrationsAn implicit package migration is when a package doesn't contain a "Plan" at all and only contains a package data manifest. In this case Umbraco will automatically generate a plan for implicit migrations . This is done by generating a final "ID" which will be the hash of the package version. If the final ID stored in the database doesn't match the hashed ID of the version, then the migration will need to be run. This migration will be a single execution step: Installing the package data manifest (i.e. just like it is done in the back office today). An explicit package migration is when a package contains a c# "Plan". In this case, the developer is entirely in charge of the package migration plan. If the developer wants the package data manifest file to be installed, that will be a line of code in a migration step. Typically the developer will want to run this code in every step (i.e. this is the same as what would happen to day when installing a package in the back office). This could probably be part of a base class for a package migration step. Umbraco Cloud / Deploy / uSyncFor Cloud sites or other sites where there are multiple environments that use tools like Deploy or uSync to synchronize them, it is probably safest to only have Package Migrations enabled on the most downstream environment (i.e. the environment where the package was installed). The developer flow would mean that the Umbraco data installed with a Package Migration is done by the developer locally and then any schema changes that were done will be committed to git (i.e. with Deploy it would be uda files). For any content items that need to be transferred to upstream environments, the developer would transfer the items that they want via the back office. How to do this... Configuration basedIOptions can be created and used to determine if Package Migrations should be enabled/disabled . This can be configured dynamically or via config files. Umbraco Deploy could dynamically disable Package Migrations from running entirely, else since Umbraco Deploy knows the most downstream environment, it could only enable them for that environment. Deployment basedUmbraco Deploy could track package migrations just like it does for schema items. When a migration is successfully run, a uda file can be created for that package. The uda file only needs to contain the final "ID". When Deploy extracts schema (which will need to occur before package migrations are resolved and executed) it can also extract package migrations. This means that migrations for a package would only ever execute on the environment they were installed on. If executed on each environment?If the same package migration is executed on each environment it shouldn't cause issues, however in some cases it may mean extra data will exist on an upstream environment. For example, if a package is installed on the local environment, then a developer deletes some of the Umbraco items installed with the package, then deploys the new codebase to an upstream environment; the package migration will run on the new environment and add the Umbraco items that were removed in the downstream environment. This also depends on if the items are schema vs content and how they are installed from the package. In the majority of cases, Umbraco data will be installed via the package data manifest and all items will be GUID based which ensures duplicates won't occur and data remains in sync. In some cases, a developer will write a custom package migration using Umbraco c# services; in this case it would be possible that duplicate data can be created and data will be out of sync. For example: if a package is installed on the local environment, then a developer pushes the code changes to an upstream environment and the migration runs there, then the same Umbraco objects may be created in both environments but without the same GUID; this can result in duplicates since Deploy will also run and install the same data with different GUIDs. What about DB schema changes?There are some examples of Migrations that would need to execute on all environments such as DB schema migrations. For example, if your package creates a custom DB table in a migration, that migration would need to execute on all environments else the DB table won't exist on those environments. How to solve that? At this stage I don't have a perfect answer. Perhaps there are 2x types of migrations that packages can expose. A default type which should only execute on one environment and another that should explicitly execute on all environments. This could be defined by an Enum on the migration and perhaps that tool that manages environment synchronization like Deploy or uSync dynamically filters the package migrations to be executed based on this enum value and what environment is current running. |
Beta Was this translation helpful? Give feedback.
-
Hmm, interesting thought this morning after this discussion on Twitter https://twitter.com/darrenferguson/status/1402876276591955970 Given the comments about NuGet being really a .NET DLL package system and not really geared towards content files, is NuGet and/or I think there is defo going to be an issue around JS only packages as these can't simply be installed. Anything that contains content files is also going to need the solution to be rebuilt in order to trigger to copying of the content files. If we had a custom Umbraco CLI however, it could be the CLI that controls this and packages could just be installed. |
Beta Was this translation helpful? Give feedback.
-
Hey all, thanks for the discussions here! We are getting closer to launch and we've been thinking about making it easy to get your NuGet package listed on Our Umbraco, we'd love for your help in the follow-up discussion here: #10595 |
Beta Was this translation helpful? Give feedback.
-
An easier way to copy schema between different sites using just the package.xml file?I'm way late to this discussion, but came across it today for a specific reason. I am working on a v10 site, and I want to just "copy" some doctypes/datatypes from a different site (v9, in this case). In versions <=8, one could use the back-office Package section to select a bunch of schema items, create a "package" and download a zip with the XML file, which could be uploaded into the other site via the back-office Package section there. Easy-peasy, no IDE/Compiling/Etc needed. In v10, I see we can still create a "package.xml" file via a nice UI in the back-office, but how do we install it into a new site? Well....... according to Documentation on Creating a Package:
And now... we have a reference to a package which really isn't needed any longer (cause hopefully the DB schema has been updated, so we should be DONE), so I guess we need to remove the package reference in the new site. Anyway, for a one-and-done, local-only sort of "schema import" operation... it would be great if there were a simpler process, with less overhead, more akin to the "old" style of backoffice-to-backoffice export/import. Would it be possible to add some functionality to just import a straight package.xml file via the back-office as a single-time operation for schema updating? What do people think about this? What am I missing in my thought-process? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Today we published a blog post detailing our decision to move v9 to using NuGet packages: https://umbraco.com/blog/packages-in-umbraco-9-via-nuget/
This discussion allows you to give us some feedback ask questions, we understand that most of all package developers might have a lot of questions on their next steps. Umbraco HQ is here to help as much as we can as we know the package eco-system is very important to the success of Umbraco 9.
Beta Was this translation helpful? Give feedback.
All reactions