Skip to content

Action updates / Complex Type XVer Fixes#182

Merged
GinoCanessa merged 16 commits into
mainfrom
gh_action_updates
May 27, 2026
Merged

Action updates / Complex Type XVer Fixes#182
GinoCanessa merged 16 commits into
mainfrom
gh_action_updates

Conversation

@GinoCanessa
Copy link
Copy Markdown
Collaborator

GH Action Updates
Pass of complex type fixes

GinoCanessa and others added 16 commits May 6, 2026 12:00
Bump actions/checkout to v6, actions/setup-dotnet to v5, actions/configure-pages to v6, actions/upload-pages-artifact to v5, and actions/deploy-pages to v5 to clear the Node.js 20 deprecation annotation before GitHub forces v4-era actions onto Node.js 24 on 2026-06-02 and removes Node.js 20 from runners on 2026-09-16.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump actions/cache and actions/cache/save to v5 and actions/checkout to v6 in the dormant build-and-test workflow so the Node.js 20 deprecation warning will not resurface when the trigger is restored. The v5 major of actions/cache keeps the same input surface (path, key, enableCrossOsArchive, lookup-only) so no other changes are needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ConfigRoot.Parse unconditionally resolved the default FHIR cache path
via FileSystemUtils.FindRelativeDir("~/.fhir/packages") with
throwIfNotFound=true, which threw on any machine without a populated
cache (notably the Docs GitHub Pages runner). Commands like 'docs cli'
that never read the cache aborted before reaching their handler.

Add a protected virtual GetUserProfileDirectory() seam and rewrite the
'FhirCache' case so:
- the default value is computed directly from the user-profile path
  without requiring it to exist (DiskCacheClient already auto-creates
  the directory on first use);
- explicit relative values use throwIfNotFound:false, fall back to the
  supplied value, and emit a single Console.WriteLine warning so a
  typo'd path is at least surfaced;
- explicit rooted values continue to flow through unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add four xUnit/Shouldly tests in ConfigTests.cs that pin down the
behavior introduced by the previous commit:

- Parse_WithMissingDefaultFhirCache_DoesNotThrow_AndUsesUserProfileDefault
- Parse_WithExplicitMissingRelativeFhirCache_DoesNotThrow_AndFallsBackAndWarns
- Parse_WithExplicitRootedFhirCache_PassesValueThrough
- Parse_WithExplicitRelativeFhirCacheThatResolves_DoesNotWarn

A private TestConfigRoot subclass overrides GetUserProfileDirectory()
so the default-resolution test can use a temp directory without
mutating process-global HOME/USERPROFILE env vars (which is unsafe
under xUnit parallelism and unreliable on Windows for SpecialFolder
lookups). Console.Out is captured via a swap-and-restore helper to
verify the warning surfaces only on the fallback branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previously, ~-rooted inputs to FileSystemUtils.FindRelativeDir
'worked' only by accident via the walk-up loop: the leading ~/ was
stripped to 'dirName' and currentDir was set under the user profile,
then the loop fell back to walking the filesystem when the joined
testDir did not exist. On a fresh machine the walk-up reached the
filesystem root and threw with a misleading message ('Could not find
directory .fhir/packages!' instead of '~/.fhir/packages').

Short-circuit ~-rooted inputs before the walk-up: expand against the
user-profile directory, return Path.GetFullPath when the directory
exists, otherwise honor throwIfNotFound and produce an error message
that retains the ~/ prefix. Behavior for non-~ inputs is unchanged.

Add FileSystemUtilsTests.cs covering the resolved, throwIfNotFound:false
empty-return, and throwIfNotFound:true throw paths. The throw test
also pins the message-format fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Renames XVerIgExportTrackingRecord.SdPageContentFiles to
ResourceLookupFiles and adds an empty TypeLookupFiles sibling, in
preparation for splitting the structure lookup pages into a Resource
lane and a Type lane. Pure rename + addition; no behavioural change.

Updates all 9 in-tree references in IgExporter.cs and 2 in
StructurePageExporter.cs. The new TypeLookupFiles list is intentionally
not added to AsPackageContents, mirroring how ResourceLookupFiles is
already excluded (lookup pages are pagecontent, not package files).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Phase 2 of widening the xver IG exporter beyond Resources:

* Lift the abstract-base exclusion set (Base, BackboneType,
  BackboneElement, Element) to a shared internal static
  StructurePageExporter.StructureExportExclusions, and delete the
  duplicate copy in StructureFhirExporter.
* Introduce StructureFhirExporter._xverSourceArtifactClasses =
  [Resource, ComplexType] so the per-class widening is a single
  named constant.
* exportProfiles: select source structures from both Resource and
  ComplexType artifact classes (concatenated, since SelectList takes
  a single ArtifactClass), and skip exclusion-set entries before
  any output is generated.

exportExtensions already iterated DbElementOutcome rows with no
ArtifactClass filter and used SelectDict without one for source SDs,
so ComplexType extensions are naturally in scope once the exclusion
set is shared; only the reference rename was needed there.

exportElementMaps is widened in the next phase.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Phase 3 of widening the xver IG exporter beyond Resources.

exportElementMaps now selects source structures from both Resource
and ComplexType artifact classes, and applies the shared
StructureExportExclusions filter so abstract bases never produce
per-structure element ConceptMaps.

createElementConceptMap and addMappedElementsToElementCm operate from
DbStructureOutcome / DbElementOutcome rows (which do not branch on
ArtifactClass), so no further changes were needed there.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Phase 4 of widening the xver IG exporter beyond Resources.

* Adds XVerIgExportTrackingRecord.TypeMapFiles next to ResourceMapFiles.
* Adds createTypeConceptMap, a sibling of createResourceConceptMap,
  scoped to data-types value sets instead of resource-types, with
  id pattern {src}-type-map-to-{tgt}.
* Adds exportTypeMaps, mirroring exportResourceMaps but selecting only
  DbStructureOutcome rows with SourceArtifactClass == ComplexType and
  applying the shared StructureExportExclusions filter. Writes the
  ConceptMap into the existing ResourceMapDir lane per plan decision
  (no new *Dir property).
* Wires exportTypeMaps(igTr) into Export() between exportResourceMaps
  and exportElementMaps, removing the // TODO: decide if we are
  exporting type maps marker.
* AsPackageContents, writeIgJsonR4, and writeIgJsonR5 now include
  TypeMapFiles next to ResourceMapFiles so the manifest references
  the new ConceptMap.
* exportTypeMaps skips writing the file when no complex-type outcomes
  were produced, to avoid emitting an empty ConceptMap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Phase 5 of widening the xver IG exporter beyond Resources.

* StructurePageExporter: parameterized exportStructureIndexPage and
  exportStructureLookupPages into exportLookupIndexPage and
  exportLookupPages (sourceArtifactClass, indexFileName, indexTitle,
  trackerList). Export() now runs them once per artifact class:
  Resource -> lookup-sd.md / 'Resource Lookup' / ResourceLookupFiles,
  ComplexType -> lookup-sd-types.md / 'Type Lookup' / TypeLookupFiles.
  Per-structure pages keep the lookup-sd-{id}.md scheme for both
  lanes (resource and complex-type IDs are disjoint in FHIR).
* IgExporter.writeMenuXml: 'Structure Lookup' -> 'Resource Lookup',
  added 'Type Lookup' nav entry pointing at lookup-sd-types.html.
* IgExporter: added 'lookup-sd-types' to all four skipPages sets so
  the new index page is not duplicated in the per-structure listing.
* IgExporter.writeIgJsonR4: emits a parallel type-lookup branch
  matching the resource-lookup block when TypeLookupFiles is
  non-empty.
* IgExporter.writeIgJsonR5: constructs an optional typeLookupPage
  PageComponent and inserts it into igPage.Page between sdLookupPage
  and vsLookupPage when complex-type outcomes were produced.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds CrossVersionTests.XVerEmitsComplexTypeArtifacts, a
RequiresExternalRepo=true gated Theory that walks an existing
out/xver/<package>/ tree and asserts:

* At least one StructureDefinition profile per sentinel complex type
  (Dosage, Address, HumanName, Identifier, CodeableReference,
  ContactDetail, Expression, RelatedArtifact).
* At least one extension StructureDefinition per sentinel.
* A *-type-map-to-* ConceptMap exists under input/resources/.
* Both lookup-sd.md and lookup-sd-types.md exist under
  input/pagecontent/.
* No artifacts emitted for the abstract bases (Base, Element,
  BackboneElement, BackboneType).

The test is skipped under the standard CI filter
(--filter 'RequiresExternalRepo!=true') so it does not impact the
nightly build, but compiles and can be run locally once the xver
CLI has been invoked against a populated ~/.fhir cache.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…iles

Cosmetic rename of the dead-code field on the private
XverPackageIndexInfo class for name-parity with the live tracker
field renamed in Phase 1.

Touches:
* XVerProcessorDbFhir.cs:154 (declaration)
* XVerProcessorOutcomes.cs (3 call sites)
* XVerProcessorDbPackage.cs (3 sites including a commented reference)

No behavioural change. The XVerProcessor.WriteFhirFromDbOutcomes path
this field belongs to is superseded by XVerExporter and is no longer
reachable from any current ProcessCommand case, but renaming keeps
future maintenance grep-able.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GinoCanessa GinoCanessa merged commit e73390d into main May 27, 2026
1 check failed
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.

2 participants