Add build time launch file schema constraints from allowed tunable properties#1735
Draft
adedoyinNteligen wants to merge 4 commits into
Conversation
Collaborator
Author
|
Add screenshots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #455
Description
[Please include a summary of the change and which issue is fixed. Also include relevant context or motivation.]
If a user adds a invalid tunable their launch.json either by wizard or manually dfdl extension does not fail gracefully.
This PR is meant to prevent users from adding invalid tunables that would crash dfdl. From the wizard, users wont be allowed to save invalid tunables and are alerted if the tunable is invalid. In case a user creates the launch.json manually, when they try to run dfdl, they will get a error box with two options
Ignore Invalid tunables. This option will run dfdl and ignore the invalid tunables in the launch.json. It does NOT remove the tunable from the launch.json, just runs the config without the tunable attached
Cancel. This stops dfdl from running and the user goes back to correct their config.
The list of valid tunables is in constants/tunables.json . This will be updated according to DFDL tunables with each release. A future will be created in the future to give users a way to bypass or add new tunables to the allowed list in case the .json is not updated properly. (The current recommendation is a switch in the launch.json which defaults to true, and the user can set it to false and tunables wont be validated anymore. This way users can remove the guiderails at their own risk )
#1736
The enhancement ticket is listed above
Wiki
Constants/tunables.json is a list of valid tunables. This file will be updated as necessary with each version of DFDL
Review Instructions including Screenshots
[Add review instructions including screenshots or GIFs to help explain the change visually.]
Confirmation Testing
Add a invalid tunable to the launch.json manually
Open the wizard and scroll to where tunables are listed. You should see a invalid warning.
Try to save. This should fail
Edit the tunable to be valid. Save should now work
The launch json should be updated to the valid tunable.
Add a invalid tunable to launch.json manually
Try to run dfdl extension. You should fail with two options
Ignore valid tunable should allow you to proceed with running. Cancel should fail
Regression Testing
[OPTIONAL: Describe any regression testing performed to ensure existing functionality was not broken.
List relevant test suites, manual checks, or validation steps.]