Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: dynamic value handling #2042

Merged

Conversation

roleyfoley
Copy link
Contributor

Intent of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves the structure or operation of the implementation)
  • New feature (non-breaking change which adds functionality)

Description

  • Moves to detecting dynamic value replacement requirements using regex instead of split based pattern matching
  • Changes type handling for replacement values to only support string based replacements ( if number or bool returned then convert to string )
  • Moves replacement miss handling to the invoke function instead of requiring the dynamic value handlers to manage missing values
  • Moves occurrence dynamic value replacement to support subOccurrences along with occurrences
  • Adds baseline dynamic value provider to perform lookups of baseline components

Motivation and Context

This was all found during the troubleshooting of an issue where a number based attribute in a replacement was causing the entire value to be replaced. While troubleshooting this I found a number of issues along the way that this resolves.

  • No error responses when a value isn't quite right
  • SubOccurrence's wern't working as the occurrence passed to the resolution was always the parent
  • The removal of the OPSDATA_BUCKET default var as this is no longer a default and is provided by baseline

How Has This Been Tested?

Tested locally

Related Changes

Prerequisite PRs:

  • None

Dependent PRs:

  • None

Consumer Actions:

  • None

- Moves to detecting dynamic value replacement requirements using
regex instead of split based pattern matching
- Changes type handling for replacement values to only support
string based replacements ( if number or bool returned then convert
to string )
- Moves replacement miss handling to the invoke function instead of
requiring the dynamic value handlers to manage missing values
- Moves occurrence dynamic value replacement to support
subOccurrences along with occurrences
- Adds baseline dynamic value provider to perform lookups of
baseline components
@roleyfoley roleyfoley requested a review from a team September 9, 2022 03:21
@roleyfoley roleyfoley merged commit c8787f9 into hamlet-io:master Sep 9, 2022
@roleyfoley roleyfoley deleted the refactor-dynamic-value-handling branch September 9, 2022 03:34
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.

None yet

1 participant