Skip to content

Fix schema and it's validation#30

Merged
HaroldCindy merged 40 commits intosecondlife:mainfrom
buildersbrewery:fix-schema-and-its-validation
Dec 18, 2025
Merged

Fix schema and it's validation#30
HaroldCindy merged 40 commits intosecondlife:mainfrom
buildersbrewery:fix-schema-and-its-validation

Conversation

@buildersbrewery
Copy link
Copy Markdown
Contributor

@buildersbrewery buildersbrewery commented Dec 3, 2025

This commit ...

  • updates the workflow that produces test output so that the YAML file is checked against the schema first
  • uses JSON Schema's format instead of yamale's so we can
    • use LSP with LSP-json to validate the schema
    • and use LSP with LSP-yaml to validate YAML code
  • adds an option to validate the YAML file locally against the schema
  • closes bool-semantics for function parameters #33, addresses changes proposed there by including them in the new format used here

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 3, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@buildersbrewery

This comment was marked as resolved.

@buildersbrewery
Copy link
Copy Markdown
Contributor Author

buildersbrewery commented Dec 3, 2025

@bennettgoble and @WolfGangS Could you take a quick look at this while I'm at it since you contributed the original code?

@buildersbrewery

This comment was marked as resolved.

@buildersbrewery
Copy link
Copy Markdown
Contributor Author

buildersbrewery commented Dec 5, 2025

@WolfGangS Thanks for the feedback.

I haven't added checks against true value vs. key-value-pair not being present for the keys you listed. Have to look up how that's done.

With regard to not using third-party actions, GitHub supports adding action code to ./.github/actions/, compare https://github.com/angular/angular/tree/main/.github/. I'll have to make a test repo to see how that all works.

@WolfGangS
Copy link
Copy Markdown
Contributor

WolfGangS commented Dec 5, 2025

With regard to not using third-party actions, GitHub supports adding action code to ./.github/actions/, compare https://github.com/angular/angular/tree/main/.github/. I'll have to make a test repo to see how that all works.

I think a local method for a contributor to validate their work before committing is needed anyway, if something vaguely like what I suggest was added, then the action wouldn't really be more complex than the current step in validate that runs

      - name: Check if definitions file matches schema
        run: |
          # Generate syntax to a temporary file to verify it's valid
          gen-lsl-definitions ./lsl_definitions.yaml syntax /tmp/syntax_output.llsd
          # Check that the output file was created and is not empty
          if [ ! -s /tmp/syntax_output.llsd ]; then
            echo "Error: Syntax generation produced empty output"
            exit 1
          fi
          echo "✓ Syntax generation successful and produced non-empty output"

One could just add

      - name: Check if syntax generation produces valid output
        run: |
          # Run command to check the lsl_definitions against the schema file, to verify it's valid
          validate-schema
          echo "✓ Definitions file matches schema"

@buildersbrewery
Copy link
Copy Markdown
Contributor Author

I have addressed all comments above. Haven't tested myself locally, yet. But everything is ready to go.

I'll switch to "ready for review" once I've tested locally, but feel free to do it yourself and provide feedback in the meantime.

Copy link
Copy Markdown
Collaborator

@HaroldCindy HaroldCindy left a comment

Choose a reason for hiding this comment

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

Seems largely reasonable to me, thanks! Just a couple questions.

@buildersbrewery buildersbrewery marked this pull request as ready for review December 10, 2025 10:31
@HaroldCindy
Copy link
Copy Markdown
Collaborator

Looks like CI is failing, think the command name in the workflow def needs updating

@buildersbrewery
Copy link
Copy Markdown
Contributor Author

@WolfGangS I had to move jsonschema from optional back to required dependencies for workflows to run as intended.

Copy link
Copy Markdown
Collaborator

@HaroldCindy HaroldCindy left a comment

Choose a reason for hiding this comment

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

Generally looks pretty good, just a couple of nits!

Copy link
Copy Markdown
Collaborator

@HaroldCindy HaroldCindy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@HaroldCindy HaroldCindy merged commit 780a482 into secondlife:main Dec 18, 2025
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
@buildersbrewery buildersbrewery deleted the fix-schema-and-its-validation branch December 20, 2025 13:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants