Finish the cutover to source-generated schemas and publish missing version folders
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- powershell, rust
- 領域
- build-system, ci-cd, devtools
調査の方向性
まず schemas/src と schemas/build.ps1 を読み、次に lib/dsc-lib 配下の DscRepoSchema 実装を調べて、cargo xtask schema export を実行します。生成された出力を既存の schemas/ フォルダーおよび dsc/tests に提案されている Pester のカバレッジと比較します。完了の条件は、生成されたスキーマが宣言された型とリリース済みバージョンをカバーし、ドリフトを避け、リポジトリのサンプルマニフェストを検証することです。
索引モデルが issue の本文から書いたものです。
説明
Summary of the new feature / enhancement
As a configuration author or resource developer using the published DSC schemas,
I want the schemas to publish for every released version and stay in sync with the engine automatically,
So that editor validation and IntelliSense help me instead of contradicting DSC.
Currently the published schemas under schemas/ are built from hand-maintained YAML sources (schemas/src via schemas/build.ps1) that were last generated for v3.1.0, while the engine has moved on to 3.4.
The most visible symptom is that recognized $schema URIs don't resolve. The engine accepts every version through v3.2.3 as a valid $schema value, but no schema folder was ever published after v3.1.0, so a document pinned to a URI like this validates in DSC and 404s in the editor:
$schema: https://aka.ms/dsc/schemas/v3.2/bundled/config/document.json
The YAML sources have also drifted from the engine — fields, enum values, and whole subsystems added since v3.1.0 aren't represented, and in several cases the published schemas reject manifests this repository ships. Those content gaps will be filed as individual issues; this issue tracks the underlying problem that makes them inevitable.
That underlying problem is that the repository has two schema systems mid-migration. The YAML pipeline is what publishes, but every release requires manually editing schemas.config.yaml, re-running build.ps1 per version folder, and hand-updating the $schema URI enums in the sources — steps nothing enforces, which is how seven releases shipped without schemas. Meanwhile the source-based generator from #538/#1406 (DscRepoSchema + cargo xtask schema export) derives schemas directly from the engine's types — making drift structurally impossible — but is nearly complete rather than complete: it has never published anything, and no CI exercises either system.
Proposed technical implementation details (optional)
Finish the cutover to generated schemas in phases, each independently reviewable:
- Exporter correctness (#1672): fix the two silent path collisions (
AdaptedDscResourceManifest,DeleteWhatIfResult), export every type that derivesDscRepoSchema, fail on duplicate output paths, add--schema-version/--releasetargeting, and routedsc schemathrough the same machinery so the CLI and exporter agree. - Bundling and namespace parity: expand
should_bundleto match the 24 bundled schemas the YAML pipeline publishes today, and decide the disposition of each YAML-only schema (resource/stdout/*,resource/properties/*,metadata/Microsoft.DSC/*), with$refalias stubs in the floating version folders for moved paths. - Authoring parity: port the
title/description/VS Code keywords from the YAML sources onto the Rust types using the existingschema_i18n!pattern, with a comparison report gating the cutover so generated schemas don't regress the editor experience. - CI: commit
schemas/vNext, regenerate it in CI and fail on drift, and validate the repository's own example configurations and manifests against the generated schemas. - Backfill: publish the missing
v3.1.1–v3.2.3folders from each release tag's own sources so every recognized URI resolves. - Cutover: the next stable release publishes its folders via
cargo xtask schema export --release, after whichschemas/srcandschemas/build.ps1can be retired.
The CI checks (phase 4) fit naturally as a Pester test in dsc/tests, so they run in the existing ./build.ps1 -Test -PesterTestGroup dsc job as well as in a dedicated schemas workflow that invokes cargo xtask schema export first. Something like:
BeforeDiscovery {
# Every (folder_path, base_name) pair declared with #[dsc_repo_schema(...)]
$declarations = Get-ChildItem lib/dsc-lib/src -Recurse -Filter '*.rs' | ForEach-Object {
[regex]::Matches(
(Get-Content $_.FullName -Raw),
'(?s)base_name\s*=\s*"(?<base>[^"]+)"\s*,\s*folder_path\s*=\s*"(?<folder>[^"]+)"'
) | ForEach-Object {
@{ folder = $_.Groups['folder'].Value; base = $_.Groups['base'].Value }
}
}
}
Describe 'exported schemas' {
It 'exports <folder>/<base>.json' -TestCases $declarations {
Join-Path 'schemas/vNext' $folder "$base.json" | Should -Exist
}
It 'has no uncommitted drift' {
git diff --exit-code -- schemas/vNext
$LASTEXITCODE | Should -Be 0 -Because 'run `cargo xtask schema export` and commit the result'
}
}
Describe 'instance validation' {
It 'validates <name> against the generated manifest schema' -TestCases $manifests {
Test-Json -Path $path -SchemaFile 'schemas/vNext/bundled/resource/manifest.json' | Should -BeTrue
}
}
The first block also catches the "derives DscRepoSchema but was never exported" class of bug statically, and the instance validation is the regression proof for the drift issues: manifests in this repository that fail against the published v3.1.0 schemas today must pass against the generated ones.
- 主要言語
- Rust
- スター
- 532
- フォーク
- 76
- 平均マージ
- 4日 20時間
- マージ済み PR(30日)
- 24
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/DSC のほかの issue
-
Issue-Enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
PowerShell/DSC#1729 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Feature Request: Support dsc functions in executable args対応中かも @SteveL-MSFT が 7 日前に担当しました。 オープンIssue-Enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
PowerShell/DSC#1722 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Dev-UX Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
PowerShell/DSC#1694 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Enhancement Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
PowerShell/DSC#1683 · コメント 5 件 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Enhancement Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
PowerShell/DSC#1669 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
agent:triaged bug bughunt pm:npm priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SocketDev/socket-patch#464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信