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
Add deployment target to export recipe as json in addition to zip #15384
base: main
Are you sure you want to change the base?
Conversation
@MikeAlhayek I would suggest to keep only one Target "File Download" as currently available.
e.g.
|
I am trying to avoid using shapes here. I am thinking to just add another option to the deployment source that would allow providing formats. When formats are available, we'll just render drop down menu. Also, I am also considering supporting a single additional option "compressed" true/false. This may be all we need without complicating things |
I don't believe it complicates the things. It's about right approach to a problem. Here "Targets" are kinda mode of delivery of recipes. "File Download" is just one mode of delivery - so adding two Targets for same mode of delivery- is not right solution |
@ns8482e I don't want to convert to shapes here. However, I added an optional support for |
|
||
if (format == "json") | ||
{ | ||
filename += ".json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string.Format or interpolated string
string archiveFileName; | ||
var filename = deploymentPlan.Name.ToSafeName() + ".zip"; | ||
filename += ".zip"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here string.Format or use interpolated string
@@ -12,6 +15,8 @@ public DeploymentTarget(LocalizedString name, LocalizedString description, Route | |||
Route = route; | |||
} | |||
|
|||
public IEnumerable<SelectListItem> Formats { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about having common Dictonary/Json like structure here to hold any kind of properties?
e.g. In future if we decide to add blob target, it could save connection string property
I believe this came up at a meeting, but can't remember the conclusion: what about Media files, that require a ZIP file? |
I have to try and see how it'll work when exporting media. I have not had time to try it out |
This pull request has merge conflicts. Please resolve those before requesting a review. |
Fix #15383
I am trying to avoid introducing a breaking change here. But we can cleanup the code if we change the definition of the
DeploymentPlanResult
class.@sebastienros if you agree, I like to introduce this low-risk breaking change. The class
DeploymentPlanResult
should be light and treated as a base class. So it should not depend onIFileBuilder
I like to add another class
FileDeploymentPlanResult
that inherits fromDeploymentPlanResult
just likeMemoryDeploymentPlanResult
. The classFileDeploymentPlanResult
will take an instance of theIFileBuilder
and write the content to the file.Are you good with introducing this low risk breaking change?