Skip to content

Add website artifact export support#524

Merged
PrzemyslawKlys merged 2 commits intomasterfrom
codex/pswritehtml-website-artifacts-pr
Mar 7, 2026
Merged

Add website artifact export support#524
PrzemyslawKlys merged 2 commits intomasterfrom
codex/pswritehtml-website-artifacts-pr

Conversation

@PrzemyslawKlys
Copy link
Member

Summary

  • enable external help generation in the build so website artifacts can be produced from current content
  • add a website artifact export script for the multi-project Evotec hub contract
  • ignore generated website artifact and en-US help outputs locally

Validation

  • pwsh -NoProfile -File .\Build\Export-WebsiteArtifacts.ps1

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@claude
Copy link

claude bot commented Mar 7, 2026

PR Review: Add website artifact export support

Overall this is a clean addition. A few items worth discussing before merging.

ISSUE 1 - Breaking change to default build behavior (Build/Build-Module.ps1 line 83):
RefreshPSD1Only previously defaulted to true. After this change, when env:RefreshPSD1Only is unset, the expression evaluates to false, so a full build now runs by default instead of a PSD1-only refresh. If intentional, document it. If not, invert the check (env:RefreshPSD1Only -ne false) to preserve the previous default.

ISSUE 2 - Documentation enabled globally (Build/Build-Module.ps1 line 73):
-Enable:false changed to -Enable:true enables doc processing for all builds, not just the export script. Please confirm this will not break normal developer or CI builds that do not expect docs to be generated.

ISSUE 3 - Inconsistency in manifest (Build/Export-WebsiteArtifacts.ps1 lines 99-112):
surfaces.examples is set to false yet examples are still physically copied (line 86) and artifacts.examples still references them. If the surface is intentionally disabled, consider removing both the copy step and the artifact key until the surface is ready, to avoid misleading hub consumers.

ISSUE 4 - No error handling for git command (Build/Export-WebsiteArtifacts.ps1 line 92):
The git rev-parse HEAD call has no guard. If git is not in PATH or the directory is not a git repo, the result is empty or error text written into the manifest. ErrorActionPreference = Stop may not catch this because native command exit codes do not always throw in PowerShell. Consider wrapping it in a Get-Command git check and redirecting stderr.

POSITIVES:

  • Env var save/restore uses try/finally correctly - solid defensive coding.
  • Test-PlaceholderContent is a thoughtful safeguard against stubs in generated XML.
  • LiteralPath is used consistently throughout - correct for paths with special chars.
  • ErrorActionPreference = Stop at the top ensures failures do not silently pass.
  • .gitignore additions (WebsiteArtifacts/, en-US/) are appropriate; EOF newlines fixed.

MINOR NIT: The description field in the manifest is hardcoded. If this becomes a template for other Evotec hub modules, reading it from the PSD1 Description field would be more maintainable.

@PrzemyslawKlys PrzemyslawKlys merged commit 0a9960f into master Mar 7, 2026
6 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the codex/pswritehtml-website-artifacts-pr branch March 7, 2026 17:32
@claude
Copy link

claude bot commented Mar 7, 2026

PR Review: Add website artifact export support

Overall this is a clean, well-structured addition. A few items worth discussing before merging.


Build/Build-Module.ps1

Potential breaking change: RefreshPSD1Only default flipped

The previous value was hardcoded to true (fast/PSD1-only mode). The new expression evaluates to false when the env var is unset, meaning a full build now runs by default. Existing CI pipelines or scripts that relied on the fast mode will be affected without any change on their end.

If the old default should be preserved for routine builds, consider inverting the logic so that a full build is the opt-in behavior.

Documentation always enabled

Enabling docs on every build is required for Export-WebsiteArtifacts.ps1 but may slow down routine local runs. A short comment explaining the reason would help future maintainers. The backward-compat guard for SyncExternalHelpToProjectRoot is a nice touch.


Build/Export-WebsiteArtifacts.ps1

surfaces.examples inconsistency

The script copies the Examples directory into the artifact output, but the manifest declares examples = false. If examples are genuinely included, the flag should be true. If the flag carries a different meaning (e.g. not rendered as a website surface), that distinction should be commented.

[regex]::Escape() redundant with -SimpleMatch

The -SimpleMatch switch tells Select-String to treat the pattern as a plain literal string, making [regex]::Escape() a no-op. Only one of them is needed.

git rev-parse HEAD not guarded against native-exe failure

ErrorActionPreference Stop does not apply to native executables. If git is absent or the directory is not a git repo, the commit variable silently receives error text. Check LASTEXITCODE after the call to guard against this.

ModuleVersion.ToString() can throw if the key is absent

If ModuleVersion is missing from the PSD1, calling .ToString() on a null value throws a NullReferenceException. The null fallback already used for a missing PSD1 file should be extended to cover this case.


.gitignore

Clean additions. Ignoring WebsiteArtifacts/ and en-US/ keeps generated outputs out of version control.


Summary

Area Severity Item
Build-Module.ps1 Medium RefreshPSD1Only default flipped to false, may silently affect existing workflows
Export-WebsiteArtifacts.ps1 Low surfaces.examples=false contradicts example file copy
Export-WebsiteArtifacts.ps1 Low [regex]::Escape() redundant alongside -SimpleMatch
Export-WebsiteArtifacts.ps1 Low git rev-parse not guarded against native-exe failure
Export-WebsiteArtifacts.ps1 Low ModuleVersion.ToString() can throw if key is absent

The core functionality is sound and the overall approach is well thought-out. The RefreshPSD1Only default change is the most impactful item to verify intentionality on.

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.

1 participant