Skip to content

Add build time launch file schema constraints from allowed tunable properties#1735

Open
adedoyinNteligen wants to merge 1 commit into
apache:mainfrom
ctc-oss:Add-build-time-launch-file-schema-constraints-from-allowed-tunable-properties
Open

Add build time launch file schema constraints from allowed tunable properties#1735
adedoyinNteligen wants to merge 1 commit into
apache:mainfrom
ctc-oss:Add-build-time-launch-file-schema-constraints-from-allowed-tunable-properties

Conversation

@adedoyinNteligen

@adedoyinNteligen adedoyinNteligen commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #455

Description

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

  1. 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

  2. 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

  • [] I have determined that no documentation updates are needed for these changes
  • I have added the following documentation for these changes

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

  1. Add a invalid tunable to the launch.json manually

  2. Open the wizard and scroll to where tunables are listed. You should see a invalid warning.

  3. Try to save. This should fail

  4. Edit the tunable to be valid. Save should now work

  5. The launch json should be updated to the valid tunable.

  6. Add a invalid tunable to launch.json manually

  7. Try to run dfdl extension. You should fail with two options

  8. 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.]

@adedoyinNteligen

Copy link
Copy Markdown
Collaborator Author

Add screenshots
Create enhancement ticket
Add docs on tunables.json to wiki

@adedoyinNteligen adedoyinNteligen marked this pull request as draft June 26, 2026 01:53
@hdalsania hdalsania moved this to In Review in daffodil-vscode v1.6.0 Jun 27, 2026
@hdalsania hdalsania added this to the 1.6.0 milestone Jun 27, 2026
@hdalsania hdalsania moved this from In Review to In Progress in daffodil-vscode v1.6.0 Jun 27, 2026
@adedoyinNteligen adedoyinNteligen force-pushed the Add-build-time-launch-file-schema-constraints-from-allowed-tunable-properties branch from a15b6f0 to b99e844 Compare June 29, 2026 14:17
@hdalsania hdalsania marked this pull request as ready for review June 29, 2026 15:25
@hdalsania hdalsania moved this from In Progress to In Review in daffodil-vscode v1.6.0 Jun 29, 2026

@lrbarber lrbarber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some of the Daffodil tunables seem to be missing from the list used for validating entries -- mostly from the bottom of the list provided at https://daffodil.apache.org/tunables/

Also (minor) when the tunable name is invalid, the error message changes the vertical spacing so that the value field is lower than then name field.

Image

@adedoyinNteligen

Copy link
Copy Markdown
Collaborator Author

The validation of values in the wizard is not very strong, to avoid blocking from someone from submitting something that may be omitted in documentation accidentally. this can always be improved upon, but runs the risk of a valid value being omitted.

changes to scripts.js

dont let users save invalud key or value

move tunables.json and add feature

Document allowed tunables and error handling

Added section on allowed tunables and their validation process.

Exclude tunables.json from RAT and prettier

documentation + more tunables + verifiy values
@adedoyinNteligen adedoyinNteligen force-pushed the Add-build-time-launch-file-schema-constraints-from-allowed-tunable-properties branch from b99e844 to a40d571 Compare June 29, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Add build-time launch file schema constraints from allowed tunable properties

3 participants