umbraco / Umbraco.Cloud.Issues

Public issue tracker for Umbraco Cloud
24 stars 2 forks source link

Umbraco Cloud/Deploy: Create "Adding to Git" Extension Point #33

Open Nicholas-Westby opened 5 years ago

Nicholas-Westby commented 5 years ago

Søren Kottal created this issue on the old tracker and I'm porting it over with some new information: https://issues.umbraco.org/issue/UAAS-649

In essence, if somebody makes a change in a third-party package that causes a file to be created/modified/deleted, it would be nice if Umbraco Deploy or Umbraco Cloud allowed that file to be committed directly to the Umbraco Cloud Git repository.

It seems like this should in essence be possible, as it already happens with document types (i.e., if you create a document type on dev/live, it will be added to the Git repository immediately). Exposing this functionality publicly and documenting it would be nice.

My use case is that I have a package that creates files that are structural in nature (similar to document types, but stored purely on the file system without a database counterpart), which you can read about here: https://our.umbraco.com/forum/umbraco-cloud/95107-transferring-non-content-with-umbraco-deploy

Nicholas-Westby commented 5 years ago

It seems this is already possible: https://our.umbraco.com/forum/umbraco-cloud/95107-transferring-non-content-with-umbraco-deploy#comment-300918

Which shows the code:

var service = global::Umbraco.Deploy.DeployComponent.SourceControlService;
var path = "~/App_Data/Formulate/Json/Forms/fb06ee9c2dc84512bc13e3679e23d3e1.form";
path = HostingEnvironment.MapPath(path);
service.AddFiles("fb06ee9c2dc84512bc13e3679e23d3e1.form", "Form", new[] { path });

However, I'll leave this issue open. There are two things that would be nice to see:

nul800sebastiaan commented 5 years ago

Please note that this is an undocumented and accidental public API, we don't yet support this scenario.

That said: yes, we would love a well-documented way to implement this functionality in the future. I've added the idea tag to this issue so we can get back to it at a later time,

Note: we used to watch paths for changes and it was terrible for performance, we're unlikely implement that again.

azure-devops-sync[bot] commented 5 years ago

AB#668

jmayntzhusen commented 4 years ago

@skttl & @Nicholas-Westby

I'd like to understand the need for this further. I raised an internal issue yesterday about need for this functionality and then took it down again. The reason being that I am not sure this is the right way to go about this..

If you are developing something you host elsewhere and deploy in other ways you would also not be able to commit to git from a staging env, etc. In those cases you would ensure configuration in another way, right? Well on Cloud you would also be able to install a package locally, include configuration in one or more config transforms and deploy to the environments just like you would on other hosting.

So is the root of the issue here that you are missing a way to store configuration generally - as in both on and off Umbraco Cloud? Or is there something specific to Cloud that makes it a lot more complicated than other ways of hosting sites?

Nicholas-Westby commented 4 years ago

I have a package that allows users to create files in a given environment (e.g., stage). They then want to transfer these files to another environment (e.g., prod).

This feature would facilitate the transfer of user-created content from one environment to another.

To clarify, it's not a developer that would necessarily be creating these files (though, they could surely create some of them).

Also, it would perhaps sometimes go in reverse (e.g., create the files on prod, bring them back down to stage and dev).

I can get a bit more concrete than that if you need me to, but I figured I'd keep it pretty generic to show that this is something that could benefit others.

jmayntzhusen commented 4 years ago

Thanks for elaborating!

How would you go about handling this same thing if you self-hosted the site? I think the feature you describe would be super cool, but wouldn't any self-hosted site have the exact same issue?

What I am getting at is that allowing you to commit on Cloud doesn't seem to address the main issue. With Deploy on premise on our roadmap we would also need to consider how this functionality should work outside of Cloud.

Maybe this feature request should instead be for an extension point for Deploy to allow Deploy to track and handle custom files as it does with uda files fx? (Do mind that I am not part of the Deploy team, and don't know the plans for Deploy on premise and the details of how it will work)

Not sure what the correct answer is, but I don't think "just" adding an endpoint on Cloud is the right call at this point, happy to hear your thoughts!

skttl commented 4 years ago

You are right in the fact that you need to handle this manually in self-hosted setups. But you are used to that anyway.

On Cloud you get used to Cloud/Deploy having your back, and introducing a manual process for this makes it confusing.

Nicholas-Westby commented 4 years ago

It makes no difference to me where this is implemented (Umbraco Cloud or Umbraco Deploy). That's why the ticket title starts with "Umbraco Cloud/Deploy".

To me, the separation between the two isn't all that clear. For example, I've already got something working with what is apparently an "undocumented and accidental public API" with Umbraco Deploy that adds the files to Git (and Git is something you seem to be associating primarily with Umbraco Cloud). See this link for info on that. Maybe on Umbraco Cloud the Umbraco Deploy API would commit to Git and on the future on-premise implementation of Umbraco Deploy the Umbraco Deploy API would do something else with the files.

Is there some more appropriate place to make feature requests for Umbraco Deploy?

skttl commented 4 years ago

There was this session at codegarden a few years ago, demonstrating how to get Courier to work with custom schema data. https://video.twentythree.net/packages-and-your-data-on-umbraco-as-a-service-2

Is this still possible?