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

CLI Support and changes to make PowerDocu more friendly for usage with DevOps #111

Merged
merged 13 commits into from
Jan 30, 2024

Conversation

a1dancole
Copy link
Contributor

Change Documenter projects to be Library types instead of Console to avoid confusion in how to interact with the projects following this change.

Add a new Console application PowerDocu.CLI to define the entry point for use in the command line. This change also includes support for all available variables that are possible in the GUI with validation.

I see this proposed change as the start of making PowerDocu available in DevOps by providing a clearly defined, documented CLI interface. I will be using these proposed changes to start working on making PowerDocu available in Azure DevOps as I want to integrate it with existing pipelines that I currently use

Introduce support for all variables in the front-end and add in console validation.
@@ -3,7 +3,7 @@

namespace PowerDocu.SolutionDocumenter
{
class SolutionDocumentationContent
public class SolutionDocumentationContent
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This access modifier was causing me build issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@modery
Copy link
Owner

modery commented Jun 3, 2023

Hi Aidan, many thanks for this! Wanted to look into this at some point "soon" as well, this helps a lot. Will review it in detail in the upcoming days

@a1dancole
Copy link
Contributor Author

Hi Rene, my pleasure. Thank you for creating this awesome tool!

There's a consideration that might be worth exploring which is why I haven't marked this PR as Ready for review.

The CLI support can be added to the GUI app by taking advantage of Main and args variable Main() and command-line arguments
to remove the two entry points to the application and combine into one.

Aidan Cole and others added 6 commits June 7, 2023 16:11
…nd introducing a .order file at the route of the documentation. This allows documentation to be source controlled and viewable in DevOps wiki
Add support for devops wiki  by changing the folder structure format …
@a1dancole
Copy link
Contributor Author

Just some updates on this PR as well as on Azure DevOps

I made some additional changes to the CLI project, introduced an output variable and made some changes to the solution output so that it can be used in DevOps wiki's. The naming conventions didn't work with DevOps wiki, even with a .order file. There also needed to be the generation of a .order file to allow DevOps wiki's to understand the multiple levels in solution documentation.

I've also successfully created an Azure DevOps custom task PowerDocu-DevOps that downloads a the release of PowerDocu to the agent from GitHub and accepts all of the CLI arguments as part of the PR and executes PowerDocu. It's currently a private project being executed in our own Pipelines but is so far successful. I'm happy to share access to the task on Marketplace.

How it looks in DevOps:

image
image

Our pipelines source control our solutions, but by setting the output folder we're able to separate out the solution from the documentation

image

Then by using Azure DevOps 'Publish code as wiki' we're able to create a wiki page from the repository

image

@@ -24,7 +24,7 @@ class AppDocumentationContent
public AppDocumentationContent(AppEntity app, string path)
{
NotificationHelper.SendNotification("Preparing documentation content for " + app.Name);
folderPath = path + CharsetHelper.GetSafeName(@"\AppDoc - " + app.Name + @"\");
folderPath = path + CharsetHelper.GetSafeName(@"\AppDoc " + app.Name + @"\");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '-' is read in DevOps Wiki's as a space, which got the wiki structure very confused so this had to be removed

@@ -10,21 +10,22 @@ namespace PowerDocu.AppDocumenter
{
public static class AppDocumentationGenerator
{
public static List<AppEntity> GenerateDocumentation(string filePath, string fileFormat, bool documentDefaultChangesOnly, bool documentDefaults, string wordTemplate = null)
public static List<AppEntity> GenerateDocumentation(string filePath, string fileFormat, bool documentDefaultChangesOnly, bool documentDefaults, string wordTemplate = null, string outputPath = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add support for a different path to save the documentation to so that in a DevOps pipeline the documentation can be created in a specific folder on an agent and then commited to the repository.

It becomes hard to extract the documentation out when it's being saved in the folder that the solution is so this is a quality of life feature

@@ -19,7 +19,7 @@ class FlowDocumentationContent
public FlowDocumentationContent(FlowEntity flow, string path, FlowActionSortOrder sortOrder = FlowActionSortOrder.SortByName)
{
NotificationHelper.SendNotification("Preparing documentation content for " + flow.Name);
folderPath = path + CharsetHelper.GetSafeName(@"\FlowDoc - " + flow.Name + @"\");
folderPath = path + CharsetHelper.GetSafeName(@"\FlowDoc " + flow.Name + @"\");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '-' is read in DevOps Wiki's as a space, which got the wiki structure very confused so this had to be removed

@@ -7,21 +7,22 @@ namespace PowerDocu.FlowDocumenter
{
public static class FlowDocumentationGenerator
{
public static List<FlowEntity> GenerateDocumentation(string filePath, string fileFormat, string flowActionSortOrder, string wordTemplate = null)
public static List<FlowEntity> GenerateDocumentation(string filePath, string fileFormat, string flowActionSortOrder, string wordTemplate = null, string outputPath = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add support for a different path to save the documentation to so that in a DevOps pipeline the documentation can be created in a specific folder on an agent and then commited to the repository.

It becomes hard to extract the documentation out when it's being saved in the folder that the solution is so this is a quality of life feature

@@ -9,7 +9,7 @@ namespace PowerDocu.SolutionDocumenter
{
public static class SolutionDocumentationGenerator
{
public static void GenerateDocumentation(string filePath, string fileFormat, bool documentDefaultChangesOnly, bool documentDefaults, string flowActionSortOrder, string wordTemplate = null)
public static void GenerateDocumentation(string filePath, string fileFormat, bool documentDefaultChangesOnly, bool documentDefaults, string flowActionSortOrder, string wordTemplate = null, string outputPath = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add support for a different path to save the documentation to so that in a DevOps pipeline the documentation can be created in a specific folder on an agent and then commited to the repository.

It becomes hard to extract the documentation out when it's being saved in the folder that the solution is so this is a quality of life feature

@@ -322,5 +322,19 @@ private MdImageSpan getAccessLevelIcon(string accessLevel)
};
return getAccessLevelIcon(level);
}

private void createOrderFile()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This order file is needed to allow DevOps wiki to understand the folder structure of a solution's documentation

Wiki files and file structure

@a1dancole a1dancole marked this pull request as ready for review June 15, 2023 20:57
@a1dancole a1dancole changed the title Refactor CLI support to a common Console project. CLI Support and changes to make PowerDocu more friendly for usage with DevOps Jun 15, 2023
@keinMEME
Copy link

Hi guys,
this feature looks very good.
Is a new official release version planned?

@modery modery merged commit 7c8ff37 into modery:main Jan 30, 2024
@modery
Copy link
Owner

modery commented Jan 31, 2024

Hi @a1dancole , finally came back to PowerDocu and continued working on it. Your PRs have all been requested, and I'm about to release a new version overall in the next few days.
Do you want to add a bit of documentation on the functionality you added here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants