Skip to content

Template upgrade properties - #3

Open
JC-wk wants to merge 112 commits into
mainfrom
template-upgrade-properties
Open

Template upgrade properties#3
JC-wk wants to merge 112 commits into
mainfrom
template-upgrade-properties

Conversation

@JC-wk

@JC-wk JC-wk commented Dec 12, 2025

Copy link
Copy Markdown
Owner

Resolves HASH_SIGN_FOLLOWED_BY_ISSUE_NUMBER

What is being addressed

Describe the current behavior you are modifying. Please also remember to update any impacted documentation.

How is this addressed

  • Describe the changes made, and if appropriate, why they are addressed this way
  • Note any pending work (with links to the issues that will address them)
  • Update documentation
  • Update CHANGELOG.md if needed
  • Increment template version if needed, for guidelines see Authoring templates - versioning

James Chapman and others added 16 commits December 10, 2025 15:23
This commit aligns the resource upgrade process with the update process by correctly handling conditional properties in the JSON schema.

- The schema generation logic in `ConfirmUpgradeResource.tsx` is updated to include conditional blocks (`if`/`then`/`else`) when the condition is based on an existing property.
- New read-only properties are now submitted during the upgrade process.
This commit aligns the resource upgrade process with the update process by correctly handling conditional properties in the JSON schema.

- The schema generation logic in `ConfirmUpgradeResource.tsx` is updated to include conditional blocks (`if`/`then`/`else`) when the condition is based on an existing property.
- New read-only properties are now submitted during the upgrade process.
- The `liveOmit` prop is added to the form to prevent the submission of unevaluated properties from conditionally hidden fields.
…1346005040390942732

Fix Upgrade Conditional Properties
@github-actions

github-actions Bot commented Dec 24, 2025

Copy link
Copy Markdown

Unit Test Results

668 tests   668 ✅  7s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 2ec1049.

♻️ This comment has been updated with latest results.

James Chapman added 30 commits July 31, 2026 17:34
…src/utils/schemaUpgradeUtils.ts

      • Issue: schemaUpgradeUtils.ts was evaluating conditional allOf schema rules using only newPropertyValues. If a conditional
      requirement depended on existing resource properties already on the resource, the condition would evaluate to false and allow
      upgrading without requiring the newly required field.
      • Fix: Added schemaUpgradeUtils.ts to deeply merge props.resource.properties with newPropertyValues. Updated the Upgrade button's
      ConfirmUpgradeResource.tsx check in ConfirmUpgradeResource.tsx to pass this combined state into isPropertyRequiredInState.
      • Test: Added unit test in ConfirmUpgradeResource.test.tsx to verify that conditional required rules based on existing resource
      properties properly disable the Upgrade button until filled.
  2. api_app/db/repositories/resources.py
      • Issue: resources.py returned the original resource_template object even when templateVersion was patched and new_template was
      fetched and validated, causing downstream callers to receive a stale template object.
      • Fix: Updated line 212 of resources.py to return new_template if new_template is not None else resource_template.
      • Test: Updated test_resource_repository.py to assert that patch_resource returns new_template on upgrade.
…between unexpected and non-updateable fields
…validate current properties against target template
…er ancestors and apply default values in ConfirmUpgradeResource
…d allow unevaluated properties in final schema
…ested properties and improve validation during upgrades
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