microsoft / microsoft/Documentarian

Use yayaml module for YAML transformations

Open
#115 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentarian Documentarian.DevX Documentarian.MicrosoftDocs Documentarian.Vale enhancement
Dominant language
PowerShell
Stars
50
Forks
16
Avg merge
3h 54m
Merged PRs (30d)
2

Description

Prerequisites
  • Accepted Idea: Proposals in this project are created based on ideas that have been marked as Accepted in their Discussion. Before you file an issue for a feature or change, create a discussion. If you file an issue without a discussion, the team may convert it into one.
  • Existing Issue: Search the existing issues and discussions for this repository. If there is an issue or discussion that fits your needs do not file a new one. Subscribe, react, or comment on that issue or discussion instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Add Get-Foo cmdlet to Documentarian module" instead of "New cmdlet."
Module

Documentarian, Documentarian.DevX, Documentarian.MicrosoftDocs, Documentarian.Vale

Summary

Several of the PowerShell modules rely on the powershell-yaml module to handle transformations to and from YAML, or obviate the dependency and use regular expressions instead. Modules that depend on powershell-yaml can't be used with PlatyPS as the modules have conflicting dependencies on the YamlDotNet nuget library.

We should take a dependency on the yayaml module instead, which loads YamlDotNet in an assembly load context. This would remove the dependency conflict.

Details

The yayaml module is only supported on PowerShell 7.2+. For modules where we need to support Windows PowerShell, we can't rely on yayaml.

In general, the Documentarian modules target PowerShell 7+, not Windows PowerShell. The exception to this rule is Documentarian.ModuleAuthor, which needs to support Windows PowerShell module authors.

When we use yayaml in the module code, we should always use the fully qualified form of the commands, like yayaml\ConvertTo-Yaml and yayaml\ConvertFrom-Yaml. We want to be sure that we're using those commands, not accidentally loading or using a different Yaml-handling module.

[!NOTE]
We may actually want to consider a transformation step that fully-qualifies all commands in the composed modules. That's inconvenient (and potentially impossible, given dot-source model we use) for development, but would be best practice for the published modules.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing YAML transformation code and dependency declarations in Documentarian, Documentarian.DevX, Documentarian.MicrosoftDocs, and Documentarian.Vale, while checking the Windows PowerShell compatibility requirement for Documentarian.ModuleAuthor. Identify current powershell-yaml or regular-expression usage and compare it with yayaml's fully qualified commands. Done means the supported modules avoid the dependency conflict without breaking Windows PowerShell support.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.