Skip to content

Conversation

@davidB
Copy link
Contributor

@davidB davidB commented Jan 8, 2026

Changes

  • replace the validate.sh by validate.js that failed the CI on invalid json schema or conformance *.json
  • fix the json of 3 jsonschema

BASH script has several issues:

  1. Doesn't failed on error, because in bash variable (like exampled_failed) updated into a while loop are not updated outside the loop, because a while loop is a subprocess, you can look at https://www.baeldung.com/linux/while-loop-variable-scope so exampled_failed are not used to detect invalid conformance vs json schema
  2. find: warning: you have specified the global option -maxdepth after the argument -type, but global options are not positional, i.e., -maxdepth affects tests specified before it as well as those specified after it. Please specify global options before other arguments.

Because 1. is a symptom of the limit of bash for this script, and the tools already require the javascript stack (nodejs/bun/...) I replace the validate.sh by validate.js with the fix (see CI that failed)

FIX #284

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

@davidB davidB force-pushed the fix-conformance-validation branch from 12eae26 to 9920267 Compare January 8, 2026 14:04
@davidB davidB marked this pull request as ready for review January 8, 2026 14:09
@davidB davidB requested a review from a team as a code owner January 8, 2026 14:09
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks @davidB - the shell script was a bit hacky so it's good to have a better implementation.

The only caveat on my side is that I don't know JS so I have a hard time reviewing this and I wouldn't be maintaining the script in future.
There is another effort ongoing to move the release scripts to Python, perhaps we could try and converge to that language instead?

I believe the reason I used the JS tool for this is that it was the best implementation I could find of a tool to validate against JSON schemas.

If @xibz is happy with JS it works for me - only as I said I will have a harder time helping on tools for this repo.

BASH script has several issues:

1. Doesn't failed on error, because in bash variable (like
  `exampled_failed`) updated into a while loop are not updated outside
  the loop, because a while loop is a subprocess, you can look at
  https://www.baeldung.com/linux/while-loop-variable-scope
2. find: warning: you have specified the global option -maxdepth after
  the argument -type, but global options are not positional, i.e.,
  -maxdepth affects tests specified before it as well as those specified
  after it.  Please specify global options before other arguments.
 
 Because 1. is a symptom of the limit of bash for
 this script, and the tools already require the javascript
 stack (nodejs/bun/...) I replace the validate.sh by validate.js
 
Signed-off-by: David Bernard <[email protected]>
@davidB davidB force-pushed the fix-conformance-validation branch from f8afd8c to fd2d389 Compare January 12, 2026 10:33
@davidB
Copy link
Contributor Author

davidB commented Jan 12, 2026

@afrittoli , I also comment on #276 , I'm in favor to not multiple tool "stack" (python, go, javascript) as build tool. TBH, I translated the bash script to js with AI, then I tuned, fixed & integrated it in the CI. As mentioned I selected javascript because it was already used (not python). I don't have strong preferences between the "scripting" languages (they have pros & cons), but in every case we'll need to use libraries (their std lib will not be enough) and maybe called some cli, so to setup the stack...

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.

bug: 3 json schemas in spec-0.5 and main branch list context.version as a required field instead of context.specversion

2 participants