Skip to content

Reset exp-params and input-exp-params on $draft#1062

Merged
Chris0296 merged 1 commit into
mainfrom
cor-draft-reset-params
Jul 13, 2026
Merged

Reset exp-params and input-exp-params on $draft#1062
Chris0296 merged 1 commit into
mainfrom
cor-draft-reset-params

Conversation

@Chris0296

@Chris0296 Chris0296 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary
$release splits an artifact's expansion parameters into two copies: the author-specified values are snapshotted into a new input-exp-params contained resource (referenced via the cqf-inputParameters extension), while the live exp-params (referenced via cqf-expansionParameters) is then enriched with processing-time values (e.g. pinned system-versions) for use during that release. There was previously no mechanism to undo this, drafting a released artifact left the processing-time values sitting in exp-params and the stale input-exp-params snapshot (plus its extension) hanging around indefinitely, even though they were purely an artifact of a completed release cycle. This could lead to duplicate extensions being applied.

This PR makes $draft reverse that split: it restores the author's original input back onto exp-params and removes the now-redundant input-exp-params resource and extension, so the artifact is back to a clean, author-only state in preparation for its next release.

Changes

  • Added restoreInputExpansionParams(IKnowledgeArtifactAdapter) to new version specific DraftVisitor classes, wired into DraftVisitor.visit(), dispatched by FHIR version, alongside the existing release-label/approval-date reset that already happens at the start of drafting.

Tests

  • Full $release -> $draft workflow, confirming exp-params goes from 3 processing-time-enriched parameters back down to the 1 author-specified parameter on $draft, and input-exp-params/its extension are gone.
  • Unit test of happy path
  • Unit test for case where authored params is empty, confirming exp-params is set to empty
  • Unit test for case where input-exp-params extension is present but there is no matching contained resource, confirms cleanup still happens
  • Unit test for no-op case where there is no input-exp-params extension, confirms artifact is left as is.

@github-actions

Copy link
Copy Markdown

Formatting check succeeded!

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@Chris0296
Chris0296 force-pushed the cor-draft-reset-params branch from c9a547c to 40ca16a Compare July 10, 2026 20:30
@Chris0296
Chris0296 marked this pull request as ready for review July 10, 2026 20:39
@sonarqubecloud

Copy link
Copy Markdown

@Chris0296
Chris0296 merged commit 1857305 into main Jul 13, 2026
9 checks passed
@Chris0296
Chris0296 deleted the cor-draft-reset-params branch July 13, 2026 21:03
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