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

fix: add additional validation for global parameters #832

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

kanej
Copy link
Member

@kanej kanej commented Nov 15, 2024

Default values for parameters masked the test cases for our global parameters feature.

This commit adds additional tests for parameters without default values and enhances the validations to support Global Parameters as an option.

TODO

  • Add tests to confirm whether a module specific module parameter will work even if there is a global module parameter but that doesn't have the specified property
  • Look to refactor out duplicated code in the validation steps

Default values for parameters masked the test cases for our global parameters
feature.

This commit adds additional tests for parameters without default values and
enhances the validations to support Global Parameters as an option.
@kanej kanej force-pushed the fix/globals-on-non-default-parameters branch from 0eb6f90 to 04f2765 Compare November 15, 2024 19:29
@kanej kanej linked an issue Nov 18, 2024 that may be closed by this pull request
@kanej kanej force-pushed the fix/globals-on-non-default-parameters branch from 211f508 to 64aa809 Compare November 20, 2024 12:04
If there is a parameter defined in Global parameters,
and a different parameter defined at the module level,
we were failing to find the global parameter.

This has been fixed with a more explicit lookup in
`resolveModuleParameter`. Two tests have been added
to check module param lookup where a different global
parameter exists, and global parameter lookup where
a different module parameter exists.
@kanej kanej force-pushed the fix/globals-on-non-default-parameters branch from 64aa809 to d5d44d6 Compare November 20, 2024 12:11
Pull out the shared validation resolution code for module/global/default value
resolution for module parameters.
@kanej kanej marked this pull request as ready for review November 20, 2024 12:40
@kanej kanej requested a review from zoeyTM November 20, 2024 12:40
Copy link
Contributor

@zoeyTM zoeyTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment, but I don't think any action needs to be taken. This looks good to merge.

packages/core/test/call.ts Show resolved Hide resolved
@kanej kanej merged commit 7942858 into development Nov 21, 2024
11 checks passed
@kanej kanej deleted the fix/globals-on-non-default-parameters branch November 21, 2024 19:32
@zoeyTM zoeyTM mentioned this pull request Nov 22, 2024
zoeyTM pushed a commit that referenced this pull request Nov 22, 2024
* fix: add additional validation for global parameters

Default values for parameters masked the test cases for our global parameters
feature.

This commit adds additional tests for parameters without default values and
enhances the validations to support Global Parameters as an option.

* fix: use global params where other module params exist

If there is a parameter defined in Global parameters,
and a different parameter defined at the module level,
we were failing to find the global parameter.

This has been fixed with a more explicit lookup in
`resolveModuleParameter`. Two tests have been added
to check module param lookup where a different global
parameter exists, and global parameter lookup where
a different module parameter exists.

* refactor: pull out shared validation code

Pull out the shared validation resolution code for module/global/default value
resolution for module parameters.

Fixes #834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

module parameters not working with parameters without defaults
2 participants